summaryrefslogtreecommitdiffstats
path: root/net/can/gw.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2019-07-24 08:28:21 -0400
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-08-13 11:32:20 -0400
commitf62564f5e3f2463d3b252f7e73b86700c89795e0 (patch)
tree7d22412ec0807635a90a0d021a75b0a7d55ec245 /net/can/gw.c
parent465c0deb10577e384937970dc99b61cc69212651 (diff)
can: gw: remove unnecessary blank lines, add suggested blank lines
This patch removes unnecessary blank lines, and adds suggested ones, so that checkpatch doesn't complain anymore. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can/gw.c')
-rw-r--r--net/can/gw.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/net/can/gw.c b/net/can/gw.c
index 0f13649c0b36..faecd1047611 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -111,7 +111,6 @@ struct cf_mod {
111 u32 uid; 111 u32 uid;
112}; 112};
113 113
114
115/* So far we just support CAN -> CAN routing and frame modifications. 114/* So far we just support CAN -> CAN routing and frame modifications.
116 * 115 *
117 * The internal can_can_gw structure contains data and attributes for 116 * The internal can_can_gw structure contains data and attributes for
@@ -268,7 +267,6 @@ static void cgw_csum_crc8_rel(struct can_frame *cf, struct cgw_csum_crc8 *crc8)
268 } 267 }
269 268
270 switch (crc8->profile) { 269 switch (crc8->profile) {
271
272 case CGW_CRC8PRF_1U8: 270 case CGW_CRC8PRF_1U8:
273 crc = crc8->crctab[crc^crc8->profile_data[0]]; 271 crc = crc8->crctab[crc^crc8->profile_data[0]];
274 break; 272 break;
@@ -281,7 +279,6 @@ static void cgw_csum_crc8_rel(struct can_frame *cf, struct cgw_csum_crc8 *crc8)
281 crc = crc8->crctab[crc^(cf->can_id & 0xFF)^ 279 crc = crc8->crctab[crc^(cf->can_id & 0xFF)^
282 (cf->can_id >> 8 & 0xFF)]; 280 (cf->can_id >> 8 & 0xFF)];
283 break; 281 break;
284
285 } 282 }
286 283
287 cf->data[crc8->result_idx] = crc^crc8->final_xor_val; 284 cf->data[crc8->result_idx] = crc^crc8->final_xor_val;
@@ -296,7 +293,6 @@ static void cgw_csum_crc8_pos(struct can_frame *cf, struct cgw_csum_crc8 *crc8)
296 crc = crc8->crctab[crc^cf->data[i]]; 293 crc = crc8->crctab[crc^cf->data[i]];
297 294
298 switch (crc8->profile) { 295 switch (crc8->profile) {
299
300 case CGW_CRC8PRF_1U8: 296 case CGW_CRC8PRF_1U8:
301 crc = crc8->crctab[crc^crc8->profile_data[0]]; 297 crc = crc8->crctab[crc^crc8->profile_data[0]];
302 break; 298 break;
@@ -323,7 +319,6 @@ static void cgw_csum_crc8_neg(struct can_frame *cf, struct cgw_csum_crc8 *crc8)
323 crc = crc8->crctab[crc^cf->data[i]]; 319 crc = crc8->crctab[crc^cf->data[i]];
324 320
325 switch (crc8->profile) { 321 switch (crc8->profile) {
326
327 case CGW_CRC8PRF_1U8: 322 case CGW_CRC8PRF_1U8:
328 crc = crc8->crctab[crc^crc8->profile_data[0]]; 323 crc = crc8->crctab[crc^crc8->profile_data[0]];
329 break; 324 break;
@@ -478,14 +473,12 @@ static int cgw_notifier(struct notifier_block *nb,
478 return NOTIFY_DONE; 473 return NOTIFY_DONE;
479 474
480 if (msg == NETDEV_UNREGISTER) { 475 if (msg == NETDEV_UNREGISTER) {
481
482 struct cgw_job *gwj = NULL; 476 struct cgw_job *gwj = NULL;
483 struct hlist_node *nx; 477 struct hlist_node *nx;
484 478
485 ASSERT_RTNL(); 479 ASSERT_RTNL();
486 480
487 hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) { 481 hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
488
489 if (gwj->src.dev == dev || gwj->dst.dev == dev) { 482 if (gwj->src.dev == dev || gwj->dst.dev == dev) {
490 hlist_del(&gwj->list); 483 hlist_del(&gwj->list);
491 cgw_unregister_filter(net, gwj); 484 cgw_unregister_filter(net, gwj);
@@ -583,7 +576,6 @@ static int cgw_put_job(struct sk_buff *skb, struct cgw_job *gwj, int type,
583 } 576 }
584 577
585 if (gwj->gwtype == CGW_TYPE_CAN_CAN) { 578 if (gwj->gwtype == CGW_TYPE_CAN_CAN) {
586
587 if (gwj->ccgw.filter.can_id || gwj->ccgw.filter.can_mask) { 579 if (gwj->ccgw.filter.can_id || gwj->ccgw.filter.can_mask) {
588 if (nla_put(skb, CGW_FILTER, sizeof(struct can_filter), 580 if (nla_put(skb, CGW_FILTER, sizeof(struct can_filter),
589 &gwj->ccgw.filter) < 0) 581 &gwj->ccgw.filter) < 0)
@@ -737,7 +729,6 @@ static int cgw_parse_attr(struct nlmsghdr *nlh, struct cf_mod *mod,
737 729
738 /* check for checksum operations after CAN frame modifications */ 730 /* check for checksum operations after CAN frame modifications */
739 if (modidx) { 731 if (modidx) {
740
741 if (tb[CGW_CS_CRC8]) { 732 if (tb[CGW_CS_CRC8]) {
742 struct cgw_csum_crc8 *c = nla_data(tb[CGW_CS_CRC8]); 733 struct cgw_csum_crc8 *c = nla_data(tb[CGW_CS_CRC8]);
743 734
@@ -790,10 +781,9 @@ static int cgw_parse_attr(struct nlmsghdr *nlh, struct cf_mod *mod,
790 } 781 }
791 782
792 if (gwtype == CGW_TYPE_CAN_CAN) { 783 if (gwtype == CGW_TYPE_CAN_CAN) {
793
794 /* check CGW_TYPE_CAN_CAN specific attributes */ 784 /* check CGW_TYPE_CAN_CAN specific attributes */
795
796 struct can_can_gw *ccgw = (struct can_can_gw *)gwtypeattr; 785 struct can_can_gw *ccgw = (struct can_can_gw *)gwtypeattr;
786
797 memset(ccgw, 0, sizeof(*ccgw)); 787 memset(ccgw, 0, sizeof(*ccgw));
798 788
799 /* check for can_filter in attributes */ 789 /* check for can_filter in attributes */
@@ -854,12 +844,10 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh,
854 return err; 844 return err;
855 845
856 if (mod.uid) { 846 if (mod.uid) {
857
858 ASSERT_RTNL(); 847 ASSERT_RTNL();
859 848
860 /* check for updating an existing job with identical uid */ 849 /* check for updating an existing job with identical uid */
861 hlist_for_each_entry(gwj, &net->can.cgw_list, list) { 850 hlist_for_each_entry(gwj, &net->can.cgw_list, list) {
862
863 if (gwj->mod.uid != mod.uid) 851 if (gwj->mod.uid != mod.uid)
864 continue; 852 continue;
865 853
@@ -980,7 +968,6 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh,
980 968
981 /* remove only the first matching entry */ 969 /* remove only the first matching entry */
982 hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) { 970 hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
983
984 if (gwj->flags != r->flags) 971 if (gwj->flags != r->flags)
985 continue; 972 continue;
986 973