Skip to content

Commit 6bc9f42

Browse files
andy-shevmiquelraynal
authored andcommitted
mtd: mtdpart: Do not supply NULL to printf()
GCC compiler is not happy about NULL being supplied as printf() parameter: drivers/mtd/mtdpart.c:693:34: error: ‘%s’ directive argument is null [-Werror=format-overflow=] Move the code after the parser test for NULL, and drop the ternary completely. The user can deduct this since when it's not NULL two messages will be printed. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Zhihao Cheng <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 2a6a445 commit 6bc9f42

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/mtd/mtdpart.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,9 @@ int parse_mtd_partitions(struct mtd_info *master, const char *const *types,
690690
parser = mtd_part_parser_get(*types);
691691
if (!parser && !request_module("%s", *types))
692692
parser = mtd_part_parser_get(*types);
693-
pr_debug("%s: got parser %s\n", master->name,
694-
parser ? parser->name : NULL);
695693
if (!parser)
696694
continue;
695+
pr_debug("%s: got parser %s\n", master->name, parser->name);
697696
ret = mtd_part_do_parse(parser, master, &pparts, data);
698697
if (ret <= 0)
699698
mtd_part_parser_put(parser);

0 commit comments

Comments
 (0)