[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120228102703.GA6090@x1.osrc.amd.com>
Date: Tue, 28 Feb 2012 11:27:03 +0100
From: Borislav Petkov <bp@...en8.de>
To: Zhengwang Ruan <ruan.zhengwang@...il.com>
Cc: rostedt@...dmis.org, fweisbec@...il.com, mingo@...hat.com,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] Trace: initialize variable to clear warning
On Tue, Feb 28, 2012 at 05:09:34PM +0800, Zhengwang Ruan wrote:
> GCC warns that 'page2' is used without being initialized previously before
> being used, this is to clear it.
>
> Signed-off-by: Zhengwang Ruan <ruan.zhengwang@...il.com>
> ---
> kernel/trace/trace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index a3f1bc5..47376ba 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -3694,7 +3694,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
> int nr_pages = 1;
> ssize_t written;
> void *page1;
> - void *page2;
> + void *uninitialized_var(page2);
> int offset;
> int size;
> int len;
We had this already - gcc 4.5 warns incorrectly about this, you should
upgrade to 4.6: http://marc.info/?l=linux-kernel&m=132083844427859
--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists