[PATCH v2] mm/zswap.c: add BUG() for default case in zswap_writeback_entry()

From: Chen Gang
Date: Tue Dec 10 2013 - 21:09:39 EST


Recommend to add default case to avoid compiler's warning, although at
present, the original implementation is still correct.

The related warning (with allmodconfig for metag):

CC mm/zswap.o
mm/zswap.c: In function 'zswap_writeback_entry':
mm/zswap.c:537: warning: 'ret' may be used uninitialized in this function


Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
---
mm/zswap.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mm/zswap.c b/mm/zswap.c
index 5a63f78..f58a001 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -585,6 +585,10 @@ static int zswap_writeback_entry(struct zbud_pool *pool, unsigned long handle)

/* page is up to date */
SetPageUptodate(page);
+ break;
+
+ default:
+ BUG();
}

/* move it to the tail of the inactive list after end_writeback */
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/