Skip to content

Commit ac911bf

Browse files
hartkoppmarckleinebudde
authored andcommitted
can: isotp: implement cleanups / improvements from review
As pointed out by Jakub Kicinski here: http://lore.kernel.org/r/20201009175751.5c54097f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com this patch addresses the remarked issues: - remove empty line in comment - remove default=y for CAN_ISOTP in Kconfig - make use of pr_notice_once() - use GFP_ATOMIC instead of gfp_any() in soft hrtimer context The version strings in the CAN subsystem are removed by a separate patch. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/r/20201012074354.25839-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent bc081a6 commit ac911bf

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

include/uapi/linux/can/isotp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ struct can_isotp_ll_options {
160160
* these default settings can be changed via sockopts.
161161
* For that reason the STmin value is intentionally _not_ checked for
162162
* consistency and copied directly into the flow control (FC) frame.
163-
*
164163
*/
165164

166165
#endif /* !_UAPI_CAN_ISOTP_H */

net/can/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ source "net/can/j1939/Kconfig"
5757

5858
config CAN_ISOTP
5959
tristate "ISO 15765-2:2016 CAN transport protocol"
60-
default y
6160
help
6261
CAN Transport Protocols offer support for segmented Point-to-Point
6362
communication between CAN nodes via two defined CAN Identifiers.
@@ -67,6 +66,8 @@ config CAN_ISOTP
6766
vehicle diagnosis (UDS, ISO 14229) or IP-over-CAN traffic.
6867
This protocol driver implements data transfers according to
6968
ISO 15765-2:2016 for 'classic' CAN and CAN FD frame types.
69+
If you want to perform automotive vehicle diagnostic services (UDS),
70+
say 'y'.
7071

7172
source "drivers/net/can/Kconfig"
7273

net/can/isotp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus)
222222

223223
can_send_ret = can_send(nskb, 1);
224224
if (can_send_ret)
225-
printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",
226-
__func__, can_send_ret);
225+
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
226+
__func__, can_send_ret);
227227

228228
dev_put(dev);
229229

@@ -769,7 +769,7 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer)
769769

770770
isotp_tx_burst:
771771
skb = alloc_skb(so->ll.mtu + sizeof(struct can_skb_priv),
772-
gfp_any());
772+
GFP_ATOMIC);
773773
if (!skb) {
774774
dev_put(dev);
775775
break;
@@ -798,8 +798,8 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer)
798798

799799
can_send_ret = can_send(skb, 1);
800800
if (can_send_ret)
801-
printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",
802-
__func__, can_send_ret);
801+
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
802+
__func__, can_send_ret);
803803

804804
if (so->tx.idx >= so->tx.len) {
805805
/* we are done */
@@ -942,8 +942,8 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
942942
err = can_send(skb, 1);
943943
dev_put(dev);
944944
if (err) {
945-
printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",
946-
__func__, err);
945+
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
946+
__func__, err);
947947
return err;
948948
}
949949

0 commit comments

Comments
 (0)