Skip to content

Commit ff847ee

Browse files
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>
1 parent adb552c commit ff847ee

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

include/net/netns/can.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <linux/spinlock.h>
1010

11-
struct dev_rcv_lists;
11+
struct can_dev_rcv_lists;
1212
struct s_stats;
1313
struct s_pstats;
1414

@@ -28,7 +28,7 @@ struct netns_can {
2828
#endif
2929

3030
/* 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;
3232
spinlock_t can_rcvlists_lock;
3333
struct timer_list can_stattimer;/* timer for statistics update */
3434
struct s_stats *can_stats; /* packet statistics */

net/can/af_can.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ EXPORT_SYMBOL(can_send);
321321
* af_can rx path
322322
*/
323323

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,
325325
struct net_device *dev)
326326
{
327327
if (!dev)
328328
return net->can.can_rx_alldev_list;
329329
else
330-
return (struct dev_rcv_lists *)dev->ml_priv;
330+
return (struct can_dev_rcv_lists *)dev->ml_priv;
331331
}
332332

333333
/**
@@ -381,7 +381,7 @@ static unsigned int effhash(canid_t can_id)
381381
* Reduced can_id to have a preprocessed filter compare value.
382382
*/
383383
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)
385385
{
386386
canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */
387387

@@ -464,7 +464,7 @@ int can_rx_register(struct net *net, struct net_device *dev, canid_t can_id,
464464
{
465465
struct receiver *r;
466466
struct hlist_head *rl;
467-
struct dev_rcv_lists *d;
467+
struct can_dev_rcv_lists *d;
468468
struct s_pstats *can_pstats = net->can.can_pstats;
469469
int err = 0;
470470

@@ -542,7 +542,7 @@ void can_rx_unregister(struct net *net, struct net_device *dev, canid_t can_id,
542542
struct receiver *r = NULL;
543543
struct hlist_head *rl;
544544
struct s_pstats *can_pstats = net->can.can_pstats;
545-
struct dev_rcv_lists *d;
545+
struct can_dev_rcv_lists *d;
546546

547547
if (dev && dev->type != ARPHRD_CAN)
548548
return;
@@ -615,7 +615,7 @@ static inline void deliver(struct sk_buff *skb, struct receiver *r)
615615
r->matches++;
616616
}
617617

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)
619619
{
620620
struct receiver *r;
621621
int matches = 0;
@@ -682,7 +682,7 @@ static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb)
682682

683683
static void can_receive(struct sk_buff *skb, struct net_device *dev)
684684
{
685-
struct dev_rcv_lists *d;
685+
struct can_dev_rcv_lists *d;
686686
struct net *net = dev_net(dev);
687687
struct s_stats *can_stats = net->can.can_stats;
688688
int matches;
@@ -829,7 +829,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
829829
void *ptr)
830830
{
831831
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
832-
struct dev_rcv_lists *d;
832+
struct can_dev_rcv_lists *d;
833833

834834
if (dev->type != ARPHRD_CAN)
835835
return NOTIFY_DONE;
@@ -874,7 +874,7 @@ static int can_pernet_init(struct net *net)
874874
{
875875
spin_lock_init(&net->can.can_rcvlists_lock);
876876
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);
878878
if (!net->can.can_rx_alldev_list)
879879
goto out;
880880
net->can.can_stats = kzalloc(sizeof(struct s_stats), GFP_KERNEL);
@@ -920,7 +920,7 @@ static void can_pernet_exit(struct net *net)
920920
rcu_read_lock();
921921
for_each_netdev_rcu(net, dev) {
922922
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;
924924

925925
BUG_ON(d->entries);
926926
kfree(d);

net/can/af_can.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct receiver {
6767
enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX };
6868

6969
/* per device receive filters linked at dev->ml_priv */
70-
struct dev_rcv_lists {
70+
struct can_dev_rcv_lists {
7171
struct hlist_head rx[RX_MAX];
7272
struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ];
7373
struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];

net/can/proc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static const struct file_operations can_version_proc_fops = {
338338

339339
static inline void can_rcvlist_proc_show_one(struct seq_file *m, int idx,
340340
struct net_device *dev,
341-
struct dev_rcv_lists *d)
341+
struct can_dev_rcv_lists *d)
342342
{
343343
if (!hlist_empty(&d->rx[idx])) {
344344
can_print_recv_banner(m);
@@ -353,7 +353,7 @@ static int can_rcvlist_proc_show(struct seq_file *m, void *v)
353353
/* double cast to prevent GCC warning */
354354
int idx = (int)(long)PDE_DATA(m->file->f_inode);
355355
struct net_device *dev;
356-
struct dev_rcv_lists *d;
356+
struct can_dev_rcv_lists *d;
357357
struct net *net = m->private;
358358

359359
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,
417417
static int can_rcvlist_sff_proc_show(struct seq_file *m, void *v)
418418
{
419419
struct net_device *dev;
420-
struct dev_rcv_lists *d;
420+
struct can_dev_rcv_lists *d;
421421
struct net *net = m->private;
422422

423423
/* RX_SFF */
@@ -461,7 +461,7 @@ static const struct file_operations can_rcvlist_sff_proc_fops = {
461461
static int can_rcvlist_eff_proc_show(struct seq_file *m, void *v)
462462
{
463463
struct net_device *dev;
464-
struct dev_rcv_lists *d;
464+
struct can_dev_rcv_lists *d;
465465
struct net *net = m->private;
466466

467467
/* RX_EFF */

0 commit comments

Comments
 (0)