• Arnd Bergmann's avatar
    jffs2: avoid Wempty-body warnings · 81af4b7b
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    81af4b7b
summary.h 6.44 KB