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
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+2−1
@@ -57,7 +57,6 @@ source "net/can/j1939/Kconfig" · 56 unmodified lines
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 · 3 unmodified lines
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+7−7
@@ -222,8 +222,8 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus) · 221 unmodified lines
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) · 539 unmodified lines
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 @@ isotp_tx_burst: · 22 unmodified lines
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) · 136 unmodified lines
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