[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52A5935A.4040709@imgtec.com>
Date: Mon, 9 Dec 2013 09:54:34 +0000
From: James Hogan <james.hogan@...tec.com>
To: Chen Gang <gang.chen.5i5j@...il.com>
CC: Seth Jennings <sjenning@...ux.vnet.ibm.com>, <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/zswap.c: add BUG() for default case in zswap_writeback_entry()
On 09/12/13 02:51, Chen Gang wrote:
> 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@...il.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();
This doesn't hide the warning when CONFIG_BUG=n since BUG() optimises
out completely.
Since the metag compiler is stuck on an old version (gcc 4.2.4), which
is wrong to warn in this case, and newer versions of gcc don't appear to
warn about it anyway (I just checked with gcc 4.7.2 x86_64), I have no
objection to this warning remaining in the metag build.
Cheers
James
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists