Commit 86c223ff authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

Merge patch series "can: bcm: can: bcm: random optimizations"

Ziyang Xuan <william.xuanziyang@huawei.com> says:

Do some small optimization for can_bcm.

v1: https://lore.kernel.org/all/cover.1662606045.git.william.xuanziyang@huawei.com

Link: https://lore.kernel.org/all/cover.1663206163.git.william.xuanziyang@huawei.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parents d05d9eb7 3fd7bfd2
......@@ -274,6 +274,7 @@ static void bcm_can_tx(struct bcm_op *op)
struct sk_buff *skb;
struct net_device *dev;
struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe;
int err;
/* no target device? => exit */
if (!op->ifindex)
......@@ -298,11 +299,11 @@ static void bcm_can_tx(struct bcm_op *op)
/* send with loopback */
skb->dev = dev;
can_skb_set_owner(skb, op->sk);
can_send(skb, 1);
err = can_send(skb, 1);
if (!err)
op->frames_abs++;
/* update statistics */
op->currframe++;
op->frames_abs++;
/* reached last frame? */
if (op->currframe >= op->nframes)
......@@ -1749,15 +1750,27 @@ static int __init bcm_module_init(void)
pr_info("can: broadcast manager protocol\n");
err = register_pernet_subsys(&canbcm_pernet_ops);
if (err)
return err;
err = register_netdevice_notifier(&canbcm_notifier);
if (err)
goto register_notifier_failed;
err = can_proto_register(&bcm_can_proto);
if (err < 0) {
printk(KERN_ERR "can: registration of bcm protocol failed\n");
return err;
goto register_proto_failed;
}
register_pernet_subsys(&canbcm_pernet_ops);
register_netdevice_notifier(&canbcm_notifier);
return 0;
register_proto_failed:
unregister_netdevice_notifier(&canbcm_notifier);
register_notifier_failed:
unregister_pernet_subsys(&canbcm_pernet_ops);
return err;
}
static void __exit bcm_module_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment