From: Borislav Petkov <bp@alien8.de>
To: Zhengwang Ruan <ruan.zhengwang@gmail.com>
Cc: rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Trace: initialize variable to clear warning
Date: Tue, 28 Feb 2012 11:27:03 +0100 [thread overview]
Message-ID: <20120228102703.GA6090@x1.osrc.amd.com> (raw)
In-Reply-To: <1330420174-20537-1-git-send-email-ruan.zhengwang@gmail.com>
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@gmail.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.
next prev parent reply other threads:[~2012-02-28 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 9:09 [PATCH] Trace: initialize variable to clear warning Zhengwang Ruan
2012-02-28 10:27 ` Borislav Petkov [this message]
2012-02-28 14:16 ` Steven Rostedt
2012-02-29 22:40 ` Valdis.Kletnieks
2012-03-01 1:09 ` Steven Rostedt
2012-03-01 2:08 ` Zhengwang Ruan
2012-03-01 2:23 ` Valdis.Kletnieks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120228102703.GA6090@x1.osrc.amd.com \
--to=bp@alien8.de \
--cc=fweisbec@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=ruan.zhengwang@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox