]> git.baikalelectronics.ru Git - kernel.git/commit
jffs2: avoid Wempty-body warnings
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Mar 2021 11:34:29 +0000 (12:34 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 15 Apr 2021 20:01:11 +0000 (22:01 +0200)
commit8a06a1c2315fe3795e23616bd89fa6db3b2d3570
tree11a5404331afe211141c1084fc9122b863b991c6
parent00f4b74748a6fba074e7ac223d48c7011952958e
jffs2: avoid Wempty-body warnings

Building with W=1 shows a few warnings for empty macros:

fs/jffs2/scan.c: In function 'jffs2_scan_xattr_node':
fs/jffs2/scan.c:378:66: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  378 |                 jffs2_sum_add_xattr_mem(s, rx, ofs - jeb->offset);
      |                                                                  ^
fs/jffs2/scan.c: In function 'jffs2_scan_xref_node':
fs/jffs2/scan.c:434:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  434 |                 jffs2_sum_add_xref_mem(s, rr, ofs - jeb->offset);
      |                                                                 ^
fs/jffs2/scan.c: In function 'jffs2_scan_eraseblock':
fs/jffs2/scan.c:893:88: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  893 |                                 jffs2_sum_add_padding_mem(s, je32_to_cpu(node->totlen));
      |                                                                                        ^

Change all these macros to 'do { } while (0)' statements to avoid the
warnings and make the code a little more robust.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/jffs2/summary.h