linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/zswap.c: add BUG() for default case in zswap_writeback_entry()
@ 2013-12-09  2:51 Chen Gang
  2013-12-09  9:54 ` James Hogan
  2013-12-09 15:36 ` Seth Jennings
  0 siblings, 2 replies; 10+ messages in thread
From: Chen Gang @ 2013-12-09  2:51 UTC (permalink / raw)
  To: Seth Jennings; +Cc: linux-mm, linux-kernel@vger.kernel.org, James Hogan

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@gmail.com>
---
 mm/zswap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mm/zswap.c b/mm/zswap.c
index 5a63f78..bfd1807 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -585,6 +585,8 @@ static int zswap_writeback_entry(struct zbud_pool *pool, unsigned long handle)
 
 		/* page is up to date */
 		SetPageUptodate(page);
+	default:
+		BUG();
 	}
 
 	/* move it to the tail of the inactive list after end_writeback */
-- 
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-11  2:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09  2:51 [PATCH] mm/zswap.c: add BUG() for default case in zswap_writeback_entry() Chen Gang
2013-12-09  9:54 ` James Hogan
2013-12-09 10:11   ` Chen Gang
2013-12-09 10:18     ` James Hogan
2013-12-09 11:21       ` Chen Gang
2013-12-09 11:40         ` James Hogan
2013-12-09 13:34           ` Chen Gang
2013-12-09 15:36 ` Seth Jennings
2013-12-10  2:16   ` Chen Gang
2013-12-11  2:11     ` [PATCH v2] " Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).