diff --git a/scripts/coccinelle/shorthand_operator.cocci b/scripts/coccinelle/shorthand_operator.cocci new file mode 100644 index 0000000000..f7019d4040 --- /dev/null +++ b/scripts/coccinelle/shorthand_operator.cocci @@ -0,0 +1,12 @@ +@@ +identifier data; +constant x; +@@ + +( +- data = data + x ++ data += x +| +- data = data - x ++ data -= x +) diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index c2812aa47b..7cdd6ef84e 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -556,7 +556,7 @@ int ifm_read(struct if_msghdr *ifm) * is 12 bytes larger than the 32 bit version. */ if (((struct sockaddr *)cp)->sa_family == AF_UNSPEC) - cp = cp + 12; + cp += 12; #endif /* Look up for RTA_IFP and skip others. */