Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jffs2: Fix if/else empty body warnings

When debug (print) macros are not enabled, change them to use the
no_printk() macro instead of <nothing>. This fixes gcc warnings when
-Wextra is used:

../fs/jffs2/nodelist.c:255:37: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../fs/jffs2/nodelist.c:278:38: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../fs/jffs2/nodelist.c:558:52: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
../fs/jffs2/xattr.c:1247:58: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../fs/jffs2/xattr.c:1281:65: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Builds without warnings on all 3 levels of CONFIG_JFFS2_FS_DEBUG.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Randy Dunlap and committed by
Richard Weinberger
8fdaaf4c b8f1da98

+12 -11
+12 -11
fs/jffs2/debug.h
··· 13 13 #ifndef _JFFS2_DEBUG_H_ 14 14 #define _JFFS2_DEBUG_H_ 15 15 16 + #include <linux/printk.h> 16 17 #include <linux/sched.h> 17 18 18 19 #ifndef CONFIG_JFFS2_FS_DEBUG ··· 100 99 #ifdef JFFS2_DBG_READINODE_MESSAGES 101 100 #define dbg_readinode(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 102 101 #else 103 - #define dbg_readinode(fmt, ...) 102 + #define dbg_readinode(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 104 103 #endif 105 104 #ifdef JFFS2_DBG_READINODE2_MESSAGES 106 105 #define dbg_readinode2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 107 106 #else 108 - #define dbg_readinode2(fmt, ...) 107 + #define dbg_readinode2(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 109 108 #endif 110 109 111 110 /* Fragtree build debugging messages */ 112 111 #ifdef JFFS2_DBG_FRAGTREE_MESSAGES 113 112 #define dbg_fragtree(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 114 113 #else 115 - #define dbg_fragtree(fmt, ...) 114 + #define dbg_fragtree(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 116 115 #endif 117 116 #ifdef JFFS2_DBG_FRAGTREE2_MESSAGES 118 117 #define dbg_fragtree2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 119 118 #else 120 - #define dbg_fragtree2(fmt, ...) 119 + #define dbg_fragtree2(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 121 120 #endif 122 121 123 122 /* Directory entry list manilulation debugging messages */ 124 123 #ifdef JFFS2_DBG_DENTLIST_MESSAGES 125 124 #define dbg_dentlist(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 126 125 #else 127 - #define dbg_dentlist(fmt, ...) 126 + #define dbg_dentlist(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 128 127 #endif 129 128 130 129 /* Print the messages about manipulating node_refs */ 131 130 #ifdef JFFS2_DBG_NODEREF_MESSAGES 132 131 #define dbg_noderef(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 133 132 #else 134 - #define dbg_noderef(fmt, ...) 133 + #define dbg_noderef(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 135 134 #endif 136 135 137 136 /* Manipulations with the list of inodes (JFFS2 inocache) */ 138 137 #ifdef JFFS2_DBG_INOCACHE_MESSAGES 139 138 #define dbg_inocache(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 140 139 #else 141 - #define dbg_inocache(fmt, ...) 140 + #define dbg_inocache(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 142 141 #endif 143 142 144 143 /* Summary debugging messages */ 145 144 #ifdef JFFS2_DBG_SUMMARY_MESSAGES 146 145 #define dbg_summary(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 147 146 #else 148 - #define dbg_summary(fmt, ...) 147 + #define dbg_summary(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 149 148 #endif 150 149 151 150 /* File system build messages */ 152 151 #ifdef JFFS2_DBG_FSBUILD_MESSAGES 153 152 #define dbg_fsbuild(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 154 153 #else 155 - #define dbg_fsbuild(fmt, ...) 154 + #define dbg_fsbuild(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 156 155 #endif 157 156 158 157 /* Watch the object allocations */ 159 158 #ifdef JFFS2_DBG_MEMALLOC_MESSAGES 160 159 #define dbg_memalloc(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 161 160 #else 162 - #define dbg_memalloc(fmt, ...) 161 + #define dbg_memalloc(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 163 162 #endif 164 163 165 164 /* Watch the XATTR subsystem */ 166 165 #ifdef JFFS2_DBG_XATTR_MESSAGES 167 166 #define dbg_xattr(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) 168 167 #else 169 - #define dbg_xattr(fmt, ...) 168 + #define dbg_xattr(fmt, ...) no_printk(fmt, ##__VA_ARGS__) 170 169 #endif 171 170 172 171 /* "Sanity" checks */