summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2019-07-24 08:16:29 -0400
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-08-13 11:32:19 -0400
commit147d9e9a67e118270bc83ea89cc989f7f1e4edea (patch)
tree084f6547f158d511741a3bf4dfa1355a6e715776
parent3e994ff28f867a20ae0dd055a5e4a4a34aad9c3c (diff)
can: af_can: convert block comments to network style comments
This patch converts all block comments to network subsystem style block comments. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--net/can/af_can.c49
-rw-r--r--net/can/af_can.h3
2 files changed, 15 insertions, 37 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 76cf83b2bd40..dc8f9720d5cd 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -1,6 +1,5 @@
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2/* 2/* af_can.c - Protocol family CAN core module
3 * af_can.c - Protocol family CAN core module
4 * (used by different CAN protocol modules) 3 * (used by different CAN protocol modules)
5 * 4 *
6 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research 5 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research
@@ -84,9 +83,7 @@ static DEFINE_MUTEX(proto_tab_lock);
84 83
85static atomic_t skbcounter = ATOMIC_INIT(0); 84static atomic_t skbcounter = ATOMIC_INIT(0);
86 85
87/* 86/* af_can socket functions */
88 * af_can socket functions
89 */
90 87
91static void can_sock_destruct(struct sock *sk) 88static void can_sock_destruct(struct sock *sk)
92{ 89{
@@ -132,8 +129,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
132 129
133 err = request_module("can-proto-%d", protocol); 130 err = request_module("can-proto-%d", protocol);
134 131
135 /* 132 /* In case of error we only print a message but don't
136 * In case of error we only print a message but don't
137 * return the error code immediately. Below we will 133 * return the error code immediately. Below we will
138 * return -EPROTONOSUPPORT 134 * return -EPROTONOSUPPORT
139 */ 135 */
@@ -180,9 +176,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
180 return err; 176 return err;
181} 177}
182 178
183/* 179/* af_can tx path */
184 * af_can tx path
185 */
186 180
187/** 181/**
188 * can_send - transmit a CAN frame (optional with local loopback) 182 * can_send - transmit a CAN frame (optional with local loopback)
@@ -218,8 +212,7 @@ int can_send(struct sk_buff *skb, int loop)
218 } else 212 } else
219 goto inval_skb; 213 goto inval_skb;
220 214
221 /* 215 /* Make sure the CAN frame can pass the selected CAN netdevice.
222 * Make sure the CAN frame can pass the selected CAN netdevice.
223 * As structs can_frame and canfd_frame are similar, we can provide 216 * As structs can_frame and canfd_frame are similar, we can provide
224 * CAN FD frames to legacy CAN drivers as long as the length is <= 8 217 * CAN FD frames to legacy CAN drivers as long as the length is <= 8
225 */ 218 */
@@ -250,8 +243,7 @@ int can_send(struct sk_buff *skb, int loop)
250 /* indication for the CAN driver: do loopback */ 243 /* indication for the CAN driver: do loopback */
251 skb->pkt_type = PACKET_LOOPBACK; 244 skb->pkt_type = PACKET_LOOPBACK;
252 245
253 /* 246 /* The reference to the originating sock may be required
254 * The reference to the originating sock may be required
255 * by the receiving socket to check whether the frame is 247 * by the receiving socket to check whether the frame is
256 * its own. Example: can_raw sockopt CAN_RAW_RECV_OWN_MSGS 248 * its own. Example: can_raw sockopt CAN_RAW_RECV_OWN_MSGS
257 * Therefore we have to ensure that skb->sk remains the 249 * Therefore we have to ensure that skb->sk remains the
@@ -260,8 +252,7 @@ int can_send(struct sk_buff *skb, int loop)
260 */ 252 */
261 253
262 if (!(skb->dev->flags & IFF_ECHO)) { 254 if (!(skb->dev->flags & IFF_ECHO)) {
263 /* 255 /* If the interface is not capable to do loopback
264 * If the interface is not capable to do loopback
265 * itself, we do it here. 256 * itself, we do it here.
266 */ 257 */
267 newskb = skb_clone(skb, GFP_ATOMIC); 258 newskb = skb_clone(skb, GFP_ATOMIC);
@@ -304,9 +295,7 @@ inval_skb:
304} 295}
305EXPORT_SYMBOL(can_send); 296EXPORT_SYMBOL(can_send);
306 297
307/* 298/* af_can rx path */
308 * af_can rx path
309 */
310 299
311static struct can_dev_rcv_lists *find_dev_rcv_lists(struct net *net, 300static struct can_dev_rcv_lists *find_dev_rcv_lists(struct net *net,
312 struct net_device *dev) 301 struct net_device *dev)
@@ -498,9 +487,7 @@ int can_rx_register(struct net *net, struct net_device *dev, canid_t can_id,
498} 487}
499EXPORT_SYMBOL(can_rx_register); 488EXPORT_SYMBOL(can_rx_register);
500 489
501/* 490/* can_rx_delete_receiver - rcu callback for single receiver entry removal */
502 * can_rx_delete_receiver - rcu callback for single receiver entry removal
503 */
504static void can_rx_delete_receiver(struct rcu_head *rp) 491static void can_rx_delete_receiver(struct rcu_head *rp)
505{ 492{
506 struct receiver *r = container_of(rp, struct receiver, rcu); 493 struct receiver *r = container_of(rp, struct receiver, rcu);
@@ -549,8 +536,7 @@ void can_rx_unregister(struct net *net, struct net_device *dev, canid_t can_id,
549 536
550 rl = find_rcv_list(&can_id, &mask, d); 537 rl = find_rcv_list(&can_id, &mask, d);
551 538
552 /* 539 /* Search the receiver list for the item to delete. This should
553 * Search the receiver list for the item to delete. This should
554 * exist, since no receiver may be unregistered that hasn't 540 * exist, since no receiver may be unregistered that hasn't
555 * been registered before. 541 * been registered before.
556 */ 542 */
@@ -561,8 +547,7 @@ void can_rx_unregister(struct net *net, struct net_device *dev, canid_t can_id,
561 break; 547 break;
562 } 548 }
563 549
564 /* 550 /* Check for bugs in CAN protocol implementations using af_can.c:
565 * Check for bugs in CAN protocol implementations using af_can.c:
566 * 'r' will be NULL if no matching list item was found for removal. 551 * 'r' will be NULL if no matching list item was found for removal.
567 */ 552 */
568 553
@@ -737,9 +722,7 @@ static int canfd_rcv(struct sk_buff *skb, struct net_device *dev,
737 return NET_RX_SUCCESS; 722 return NET_RX_SUCCESS;
738} 723}
739 724
740/* 725/* af_can protocol functions */
741 * af_can protocol functions
742 */
743 726
744/** 727/**
745 * can_proto_register - register CAN transport protocol 728 * can_proto_register - register CAN transport protocol
@@ -801,9 +784,7 @@ void can_proto_unregister(const struct can_proto *cp)
801} 784}
802EXPORT_SYMBOL(can_proto_unregister); 785EXPORT_SYMBOL(can_proto_unregister);
803 786
804/* 787/* af_can notifier to create/remove CAN netdevice specific structs */
805 * af_can notifier to create/remove CAN netdevice specific structs
806 */
807static int can_notifier(struct notifier_block *nb, unsigned long msg, 788static int can_notifier(struct notifier_block *nb, unsigned long msg,
808 void *ptr) 789 void *ptr)
809{ 790{
@@ -913,9 +894,7 @@ static void can_pernet_exit(struct net *net)
913 kfree(net->can.can_pstats); 894 kfree(net->can.can_pstats);
914} 895}
915 896
916/* 897/* af_can module init/exit functions */
917 * af_can module init/exit functions
918 */
919 898
920static struct packet_type can_packet __read_mostly = { 899static struct packet_type can_packet __read_mostly = {
921 .type = cpu_to_be16(ETH_P_CAN), 900 .type = cpu_to_be16(ETH_P_CAN),
diff --git a/net/can/af_can.h b/net/can/af_can.h
index ef21f7c6bc80..41a45e3bc4a4 100644
--- a/net/can/af_can.h
+++ b/net/can/af_can.h
@@ -1,6 +1,5 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ 1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2/* 2/* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
3 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
4 * All rights reserved. 3 * All rights reserved.
5 * 4 *
6 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without