Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17 -17
+2 -2
include/net/netns/can.h
··· 8 8 9 9 #include <linux/spinlock.h> 10 10 11 - struct dev_rcv_lists; 11 + struct can_dev_rcv_lists; 12 12 struct s_stats; 13 13 struct s_pstats; 14 14 ··· 28 28 #endif 29 29 30 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 32 spinlock_t can_rcvlists_lock; 33 33 struct timer_list can_stattimer;/* timer for statistics update */ 34 34 struct s_stats *can_stats; /* packet statistics */
+10 -10
net/can/af_can.c
··· 321 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 325 struct net_device *dev) 326 326 { 327 327 if (!dev) 328 328 return net->can.can_rx_alldev_list; 329 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 381 * Reduced can_id to have a preprocessed filter compare value. 382 382 */ 383 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 386 canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */ 387 387 ··· 464 464 { 465 465 struct receiver *r; 466 466 struct hlist_head *rl; 467 - struct dev_rcv_lists *d; 467 + struct can_dev_rcv_lists *d; 468 468 struct s_pstats *can_pstats = net->can.can_pstats; 469 469 int err = 0; 470 470 ··· 542 542 struct receiver *r = NULL; 543 543 struct hlist_head *rl; 544 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 547 if (dev && dev->type != ARPHRD_CAN) 548 548 return; ··· 615 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 620 struct receiver *r; 621 621 int matches = 0; ··· 682 682 683 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 686 struct net *net = dev_net(dev); 687 687 struct s_stats *can_stats = net->can.can_stats; 688 688 int matches; ··· 829 829 void *ptr) 830 830 { 831 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 834 if (dev->type != ARPHRD_CAN) 835 835 return NOTIFY_DONE; ··· 874 874 { 875 875 spin_lock_init(&net->can.can_rcvlists_lock); 876 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 878 if (!net->can.can_rx_alldev_list) 879 879 goto out; 880 880 net->can.can_stats = kzalloc(sizeof(struct s_stats), GFP_KERNEL); ··· 920 920 rcu_read_lock(); 921 921 for_each_netdev_rcu(net, dev) { 922 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 925 BUG_ON(d->entries); 926 926 kfree(d);
+1 -1
net/can/af_can.h
··· 67 67 enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX }; 68 68 69 69 /* per device receive filters linked at dev->ml_priv */ 70 - struct dev_rcv_lists { 70 + struct can_dev_rcv_lists { 71 71 struct hlist_head rx[RX_MAX]; 72 72 struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ]; 73 73 struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];
+4 -4
net/can/proc.c
··· 338 338 339 339 static inline void can_rcvlist_proc_show_one(struct seq_file *m, int idx, 340 340 struct net_device *dev, 341 - struct dev_rcv_lists *d) 341 + struct can_dev_rcv_lists *d) 342 342 { 343 343 if (!hlist_empty(&d->rx[idx])) { 344 344 can_print_recv_banner(m); ··· 353 353 /* double cast to prevent GCC warning */ 354 354 int idx = (int)(long)PDE_DATA(m->file->f_inode); 355 355 struct net_device *dev; 356 - struct dev_rcv_lists *d; 356 + struct can_dev_rcv_lists *d; 357 357 struct net *net = m->private; 358 358 359 359 seq_printf(m, "\nreceive list '%s':\n", rx_list_name[idx]); ··· 417 417 static int can_rcvlist_sff_proc_show(struct seq_file *m, void *v) 418 418 { 419 419 struct net_device *dev; 420 - struct dev_rcv_lists *d; 420 + struct can_dev_rcv_lists *d; 421 421 struct net *net = m->private; 422 422 423 423 /* RX_SFF */ ··· 461 461 static int can_rcvlist_eff_proc_show(struct seq_file *m, void *v) 462 462 { 463 463 struct net_device *dev; 464 - struct dev_rcv_lists *d; 464 + struct can_dev_rcv_lists *d; 465 465 struct net *net = m->private; 466 466 467 467 /* RX_EFF */