History

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.

Oliver Hartkopp committed 6 years ago

Commit ac911bf1 parent bc081a63 files · +9 −9Browse files

Unified · Split

3 files
  1. include/uapi/linux/can/isotp.h +0 −1
  2. net/can/Kconfig +2 −1
  3. net/can/isotp.c +7 −7
include/uapi/linux/can/isotp.h+0−1
@@ -160,7 +160,6 @@ struct can_isotp_ll_options { · 159 unmodified lines
160 * these default settings can be changed via sockopts.160 * these default settings can be changed via sockopts.
161 * For that reason the STmin value is intentionally _not_ checked for161 * For that reason the STmin value is intentionally _not_ checked for
162 * consistency and copied directly into the flow control (FC) frame.162 * consistency and copied directly into the flow control (FC) frame.
163 *
164 */163 */
165 164
166#endif /* !_UAPI_CAN_ISOTP_H */165#endif /* !_UAPI_CAN_ISOTP_H */
net/can/Kconfig+2−1
@@ -57,7 +57,6 @@ source "net/can/j1939/Kconfig" · 56 unmodified lines
57 57
58config CAN_ISOTP58config CAN_ISOTP
59 tristate "ISO 15765-2:2016 CAN transport protocol"59 tristate "ISO 15765-2:2016 CAN transport protocol"
60 default y
61 help60 help
62 CAN Transport Protocols offer support for segmented Point-to-Point61 CAN Transport Protocols offer support for segmented Point-to-Point
63 communication between CAN nodes via two defined CAN Identifiers.62 communication between CAN nodes via two defined CAN Identifiers.
@@ -67,6 +66,8 @@ config CAN_ISOTP · 3 unmodified lines
67 vehicle diagnosis (UDS, ISO 14229) or IP-over-CAN traffic.66 vehicle diagnosis (UDS, ISO 14229) or IP-over-CAN traffic.
68 This protocol driver implements data transfers according to67 This protocol driver implements data transfers according to
69 ISO 15765-2:2016 for 'classic' CAN and CAN FD frame types.68 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'.
70 71
71source "drivers/net/can/Kconfig"72source "drivers/net/can/Kconfig"
72 73
net/can/isotp.c+7−7
@@ -222,8 +222,8 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus) · 221 unmodified lines
222 222
223 can_send_ret = can_send(nskb, 1);223 can_send_ret = can_send(nskb, 1);
224 if (can_send_ret)224 if (can_send_ret)
225 printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",225 pr_notice_once("can-isotp: %s: can_send_ret %d\n",
226 __func__, can_send_ret);226 __func__, can_send_ret);
227 227
228 dev_put(dev);228 dev_put(dev);
229 229
@@ -769,7 +769,7 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer) · 539 unmodified lines
769 769
770isotp_tx_burst:770isotp_tx_burst:
771 skb = alloc_skb(so->ll.mtu + sizeof(struct can_skb_priv),771 skb = alloc_skb(so->ll.mtu + sizeof(struct can_skb_priv),
772 gfp_any());772 GFP_ATOMIC);
773 if (!skb) {773 if (!skb) {
774 dev_put(dev);774 dev_put(dev);
775 break;775 break;
@@ -798,8 +798,8 @@ isotp_tx_burst: · 22 unmodified lines
798 798
799 can_send_ret = can_send(skb, 1);799 can_send_ret = can_send(skb, 1);
800 if (can_send_ret)800 if (can_send_ret)
801 printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",801 pr_notice_once("can-isotp: %s: can_send_ret %d\n",
802 __func__, can_send_ret);802 __func__, can_send_ret);
803 803
804 if (so->tx.idx >= so->tx.len) {804 if (so->tx.idx >= so->tx.len) {
805 /* we are done */805 /* we are done */
@@ -942,8 +942,8 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) · 136 unmodified lines
942 err = can_send(skb, 1);942 err = can_send(skb, 1);
943 dev_put(dev);943 dev_put(dev);
944 if (err) {944 if (err) {
945 printk_once(KERN_NOTICE "can-isotp: %s: can_send_ret %d\n",945 pr_notice_once("can-isotp: %s: can_send_ret %d\n",
946 __func__, err);946 __func__, err);
947 return err;947 return err;
948 }948 }
949 949