diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2017-06-03 14:10:03 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-01-05 05:12:08 -0500 |
commit | ff847ee47be27621f978921919f035fcd87d6d08 (patch) | |
tree | db569993159747f61bd4233479aebec009f2f696 | |
parent | adb552c31915415fdb374172085f174f459727ea (diff) |
can: af_can: give struct holding the CAN per device receive lists a sensible name
This patch adds a "can_" prefix to the "struct dev_rcv_lists" to better
reflect the meaning and improbe code readability.
The conversion is done with:
sed -i \
-e "s/struct dev_rcv_lists/struct can_dev_rcv_lists/g" \
net/can/*.[ch] include/net/netns/can.h
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | include/net/netns/can.h | 4 | ||||
-rw-r--r-- | net/can/af_can.c | 20 | ||||
-rw-r--r-- | net/can/af_can.h | 2 | ||||
-rw-r--r-- | net/can/proc.c | 8 |
4 files changed, 17 insertions, 17 deletions
diff --git a/include/net/netns/can.h b/include/net/netns/can.h index ecf238b8862c..ca9bd9fba5b5 100644 --- a/include/net/netns/can.h +++ b/include/net/netns/can.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | 10 | ||
11 | struct dev_rcv_lists; | 11 | struct can_dev_rcv_lists; |
12 | struct s_stats; | 12 | struct s_stats; |
13 | struct s_pstats; | 13 | struct s_pstats; |
14 | 14 | ||
@@ -28,7 +28,7 @@ struct netns_can { | |||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | /* receive filters subscribed for 'all' CAN devices */ | 30 | /* receive filters subscribed for 'all' CAN devices */ |
31 | struct dev_rcv_lists *can_rx_alldev_list; | 31 | struct can_dev_rcv_lists *can_rx_alldev_list; |
32 | spinlock_t can_rcvlists_lock; | 32 | spinlock_t can_rcvlists_lock; |
33 | struct timer_list can_stattimer;/* timer for statistics update */ | 33 | struct timer_list can_stattimer;/* timer for statistics update */ |
34 | struct s_stats *can_stats; /* packet statistics */ | 34 | struct s_stats *can_stats; /* packet statistics */ |
diff --git a/net/can/af_can.c b/net/can/af_can.c index 003b2d6d655f..f22b886ed081 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -321,13 +321,13 @@ EXPORT_SYMBOL(can_send); | |||
321 | * af_can rx path | 321 | * af_can rx path |
322 | */ | 322 | */ |
323 | 323 | ||
324 | static struct dev_rcv_lists *find_dev_rcv_lists(struct net *net, | 324 | static struct can_dev_rcv_lists *find_dev_rcv_lists(struct net *net, |
325 | struct net_device *dev) | 325 | struct net_device *dev) |
326 | { | 326 | { |
327 | if (!dev) | 327 | if (!dev) |
328 | return net->can.can_rx_alldev_list; | 328 | return net->can.can_rx_alldev_list; |
329 | else | 329 | else |
330 | return (struct dev_rcv_lists *)dev->ml_priv; | 330 | return (struct can_dev_rcv_lists *)dev->ml_priv; |
331 | } | 331 | } |
332 | 332 | ||
333 | /** | 333 | /** |
@@ -381,7 +381,7 @@ static unsigned int effhash(canid_t can_id) | |||
381 | * Reduced can_id to have a preprocessed filter compare value. | 381 | * Reduced can_id to have a preprocessed filter compare value. |
382 | */ | 382 | */ |
383 | static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask, | 383 | static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask, |
384 | struct dev_rcv_lists *d) | 384 | struct can_dev_rcv_lists *d) |
385 | { | 385 | { |
386 | canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */ | 386 | canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */ |
387 | 387 | ||
@@ -464,7 +464,7 @@ int can_rx_register(struct net *net, struct net_device *dev, canid_t can_id, | |||
464 | { | 464 | { |
465 | struct receiver *r; | 465 | struct receiver *r; |
466 | struct hlist_head *rl; | 466 | struct hlist_head *rl; |
467 | struct dev_rcv_lists *d; | 467 | struct can_dev_rcv_lists *d; |
468 | struct s_pstats *can_pstats = net->can.can_pstats; | 468 | struct s_pstats *can_pstats = net->can.can_pstats; |
469 | int err = 0; | 469 | int err = 0; |
470 | 470 | ||
@@ -542,7 +542,7 @@ void can_rx_unregister(struct net *net, struct net_device *dev, canid_t can_id, | |||
542 | struct receiver *r = NULL; | 542 | struct receiver *r = NULL; |
543 | struct hlist_head *rl; | 543 | struct hlist_head *rl; |
544 | struct s_pstats *can_pstats = net->can.can_pstats; | 544 | struct s_pstats *can_pstats = net->can.can_pstats; |
545 | struct dev_rcv_lists *d; | 545 | struct can_dev_rcv_lists *d; |
546 | 546 | ||
547 | if (dev && dev->type != ARPHRD_CAN) | 547 | if (dev && dev->type != ARPHRD_CAN) |
548 | return; | 548 | return; |
@@ -615,7 +615,7 @@ static inline void deliver(struct sk_buff *skb, struct receiver *r) | |||
615 | r->matches++; | 615 | r->matches++; |
616 | } | 616 | } |
617 | 617 | ||
618 | static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb) | 618 | static int can_rcv_filter(struct can_dev_rcv_lists *d, struct sk_buff *skb) |
619 | { | 619 | { |
620 | struct receiver *r; | 620 | struct receiver *r; |
621 | int matches = 0; | 621 | int matches = 0; |
@@ -682,7 +682,7 @@ static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb) | |||
682 | 682 | ||
683 | static void can_receive(struct sk_buff *skb, struct net_device *dev) | 683 | static void can_receive(struct sk_buff *skb, struct net_device *dev) |
684 | { | 684 | { |
685 | struct dev_rcv_lists *d; | 685 | struct can_dev_rcv_lists *d; |
686 | struct net *net = dev_net(dev); | 686 | struct net *net = dev_net(dev); |
687 | struct s_stats *can_stats = net->can.can_stats; | 687 | struct s_stats *can_stats = net->can.can_stats; |
688 | int matches; | 688 | int matches; |
@@ -829,7 +829,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg, | |||
829 | void *ptr) | 829 | void *ptr) |
830 | { | 830 | { |
831 | struct net_device *dev = netdev_notifier_info_to_dev(ptr); | 831 | struct net_device *dev = netdev_notifier_info_to_dev(ptr); |
832 | struct dev_rcv_lists *d; | 832 | struct can_dev_rcv_lists *d; |
833 | 833 | ||
834 | if (dev->type != ARPHRD_CAN) | 834 | if (dev->type != ARPHRD_CAN) |
835 | return NOTIFY_DONE; | 835 | return NOTIFY_DONE; |
@@ -874,7 +874,7 @@ static int can_pernet_init(struct net *net) | |||
874 | { | 874 | { |
875 | spin_lock_init(&net->can.can_rcvlists_lock); | 875 | spin_lock_init(&net->can.can_rcvlists_lock); |
876 | net->can.can_rx_alldev_list = | 876 | net->can.can_rx_alldev_list = |
877 | kzalloc(sizeof(struct dev_rcv_lists), GFP_KERNEL); | 877 | kzalloc(sizeof(struct can_dev_rcv_lists), GFP_KERNEL); |
878 | if (!net->can.can_rx_alldev_list) | 878 | if (!net->can.can_rx_alldev_list) |
879 | goto out; | 879 | goto out; |
880 | net->can.can_stats = kzalloc(sizeof(struct s_stats), GFP_KERNEL); | 880 | net->can.can_stats = kzalloc(sizeof(struct s_stats), GFP_KERNEL); |
@@ -920,7 +920,7 @@ static void can_pernet_exit(struct net *net) | |||
920 | rcu_read_lock(); | 920 | rcu_read_lock(); |
921 | for_each_netdev_rcu(net, dev) { | 921 | for_each_netdev_rcu(net, dev) { |
922 | if (dev->type == ARPHRD_CAN && dev->ml_priv) { | 922 | if (dev->type == ARPHRD_CAN && dev->ml_priv) { |
923 | struct dev_rcv_lists *d = dev->ml_priv; | 923 | struct can_dev_rcv_lists *d = dev->ml_priv; |
924 | 924 | ||
925 | BUG_ON(d->entries); | 925 | BUG_ON(d->entries); |
926 | kfree(d); | 926 | kfree(d); |
diff --git a/net/can/af_can.h b/net/can/af_can.h index eca6463c6213..9cb3719632bd 100644 --- a/net/can/af_can.h +++ b/net/can/af_can.h | |||
@@ -67,7 +67,7 @@ struct receiver { | |||
67 | enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX }; | 67 | enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX }; |
68 | 68 | ||
69 | /* per device receive filters linked at dev->ml_priv */ | 69 | /* per device receive filters linked at dev->ml_priv */ |
70 | struct dev_rcv_lists { | 70 | struct can_dev_rcv_lists { |
71 | struct hlist_head rx[RX_MAX]; | 71 | struct hlist_head rx[RX_MAX]; |
72 | struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ]; | 72 | struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ]; |
73 | struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ]; | 73 | struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ]; |
diff --git a/net/can/proc.c b/net/can/proc.c index 0c59f876fe6f..45e38a3085bc 100644 --- a/net/can/proc.c +++ b/net/can/proc.c | |||
@@ -338,7 +338,7 @@ static const struct file_operations can_version_proc_fops = { | |||
338 | 338 | ||
339 | static inline void can_rcvlist_proc_show_one(struct seq_file *m, int idx, | 339 | static inline void can_rcvlist_proc_show_one(struct seq_file *m, int idx, |
340 | struct net_device *dev, | 340 | struct net_device *dev, |
341 | struct dev_rcv_lists *d) | 341 | struct can_dev_rcv_lists *d) |
342 | { | 342 | { |
343 | if (!hlist_empty(&d->rx[idx])) { | 343 | if (!hlist_empty(&d->rx[idx])) { |
344 | can_print_recv_banner(m); | 344 | can_print_recv_banner(m); |
@@ -353,7 +353,7 @@ static int can_rcvlist_proc_show(struct seq_file *m, void *v) | |||
353 | /* double cast to prevent GCC warning */ | 353 | /* double cast to prevent GCC warning */ |
354 | int idx = (int)(long)PDE_DATA(m->file->f_inode); | 354 | int idx = (int)(long)PDE_DATA(m->file->f_inode); |
355 | struct net_device *dev; | 355 | struct net_device *dev; |
356 | struct dev_rcv_lists *d; | 356 | struct can_dev_rcv_lists *d; |
357 | struct net *net = m->private; | 357 | struct net *net = m->private; |
358 | 358 | ||
359 | seq_printf(m, "\nreceive list '%s':\n", rx_list_name[idx]); | 359 | seq_printf(m, "\nreceive list '%s':\n", rx_list_name[idx]); |
@@ -417,7 +417,7 @@ static inline void can_rcvlist_proc_show_array(struct seq_file *m, | |||
417 | static int can_rcvlist_sff_proc_show(struct seq_file *m, void *v) | 417 | static int can_rcvlist_sff_proc_show(struct seq_file *m, void *v) |
418 | { | 418 | { |
419 | struct net_device *dev; | 419 | struct net_device *dev; |
420 | struct dev_rcv_lists *d; | 420 | struct can_dev_rcv_lists *d; |
421 | struct net *net = m->private; | 421 | struct net *net = m->private; |
422 | 422 | ||
423 | /* RX_SFF */ | 423 | /* RX_SFF */ |
@@ -461,7 +461,7 @@ static const struct file_operations can_rcvlist_sff_proc_fops = { | |||
461 | static int can_rcvlist_eff_proc_show(struct seq_file *m, void *v) | 461 | static int can_rcvlist_eff_proc_show(struct seq_file *m, void *v) |
462 | { | 462 | { |
463 | struct net_device *dev; | 463 | struct net_device *dev; |
464 | struct dev_rcv_lists *d; | 464 | struct can_dev_rcv_lists *d; |
465 | struct net *net = m->private; | 465 | struct net *net = m->private; |
466 | 466 | ||
467 | /* RX_EFF */ | 467 | /* RX_EFF */ |