checkpatch.pl complains about the pointer symbol * being attached to the type instead of being attached to the variable: ERROR: "foo* bar" should be "foo *bar" #85: FILE: ip/iplink_can.c:85: + const char* name) ERROR: "foo* bar" should be "foo *bar" #93: FILE: ip/iplink_can.c:93: +static void print_ctrlmode(enum output_type t, __u32 flags, const char* key) Fix those two warnings. Signed-off-by: Vincent Mailhol --- ip/iplink_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/iplink_can.c b/ip/iplink_can.c index 9f6084e63986bd05d25a050176f4640c30596b85..1afdf08825f3d9cbbb0454592d2ed7dc1388a6de 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -82,7 +82,7 @@ static void set_ctrlmode(char *name, char *arg, } static void print_flag(enum output_type t, __u32 *flags, __u32 flag, - const char* name) + const char *name) { if (*flags & flag) { *flags &= ~flag; @@ -90,7 +90,7 @@ static void print_flag(enum output_type t, __u32 *flags, __u32 flag, } } -static void print_ctrlmode(enum output_type t, __u32 flags, const char* key) +static void print_ctrlmode(enum output_type t, __u32 flags, const char *key) { if (!flags) return; -- 2.49.1 In .c files, the SPDX tag uses the C++ comment style. Fix below checkpatch.pl warning: WARNING: Improper SPDX comment style for 'ip/iplink_can.c', please use '//' instead #1: FILE: ip/iplink_can.c:1: +/* SPDX-License-Identifier: GPL-2.0-or-later */ WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #1: FILE: ip/iplink_can.c:1: +/* SPDX-License-Identifier: GPL-2.0-or-later */ Signed-off-by: Vincent Mailhol --- ip/iplink_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink_can.c b/ip/iplink_can.c index 1afdf08825f3d9cbbb0454592d2ed7dc1388a6de..56c258b023ef57e37574f44981b76086a0a140db 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +// SPDX-License-Identifier: GPL-2.0-or-later /* * iplink_can.c CAN device support * -- 2.49.1 usage() is called either if the user passes the "help" argument or passes an invalid argument. Factorise those two cases together. This silences below checkpatch.pl warning: WARNING: else is not generally useful after a break or return #274: FILE: ip/iplink_can.c:274: + return -1; + } else { Signed-off-by: Vincent Mailhol --- ip/iplink_can.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ip/iplink_can.c b/ip/iplink_can.c index 56c258b023ef57e37574f44981b76086a0a140db..2a13df7bcf6d404e17cf747f29c682fa80e4f6fc 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -268,11 +268,9 @@ static int can_parse_opt(struct link_util *lu, int argc, char **argv, invarg("invalid \"termination\" value", *argv); addattr16(n, 1024, IFLA_CAN_TERMINATION, val); - } else if (matches(*argv, "help") == 0) { - usage(); - return -1; } else { - fprintf(stderr, "can: unknown option \"%s\"\n", *argv); + if (matches(*argv, "help") != 0) + fprintf(stderr, "can: unknown option \"%s\"\n", *argv); usage(); return -1; } -- 2.49.1