All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	eric.dumazet@gmail.com, jkacur@redhat.com,
	dvhart@linux.intel.com, peterz@infradead.org,
	matt@console-pimps.org, u.kleine-koenig@pengutronix.de,
	tglx@linutronix.de, mingo@elte.hu
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:core/urgent] futex: Address compiler warnings in exit_robust_list
Date: Wed, 10 Nov 2010 08:14:51 -0800	[thread overview]
Message-ID: <4CDAC4FB.8040905@linux.intel.com> (raw)
In-Reply-To: <tip-4c115e951d80aff126468adaec7a6c7854f61ab8@git.kernel.org>

On 11/10/2010 04:30 AM, tip-bot for Darren Hart wrote:
> Commit-ID:  4c115e951d80aff126468adaec7a6c7854f61ab8
> Gitweb:     http://git.kernel.org/tip/4c115e951d80aff126468adaec7a6c7854f61ab8
> Author:     Darren Hart<dvhart@linux.intel.com>
> AuthorDate: Thu, 4 Nov 2010 15:00:00 -0400
> Committer:  Thomas Gleixner<tglx@linutronix.de>
> CommitDate: Wed, 10 Nov 2010 13:27:50 +0100
>
> futex: Address compiler warnings in exit_robust_list
>
> Since commit 1dcc41bb (futex: Change 3rd arg of fetch_robust_entry()
> to unsigned int*) some gcc versions decided to emit the following
> warning:
>
> kernel/futex.c: In function ‘exit_robust_list’:
> kernel/futex.c:2492: warning: ‘next_pi’ may be used uninitialized in this function
>
> The commit did not introduce the warning as gcc should have warned
> before that commit as well. It's just gcc being silly.


I agree that it should not have - but I did the bisect and this is the 
patch where the warning was first observed. I agree that it is still gcc 
being silly, and I don't know why it treats uninitialized ints different 
than uninitialized unsigned ints (or why it thinks this value is every 
used uninitialized for that matter).

Thanks for catching the compat-futex.c

--
Darren

>
> The code path really can't result in next_pi being unitialized (or
> should not), but let's keep the build clean. Annotate next_pi as an
> uninitialized_var.
>
> [ tglx: Addressed the same issue in futex_compat.c and massaged the
>    	changelog ]
>
> Signed-off-by: Darren Hart<dvhart@linux.intel.com>
> Tested-by: Matt Fleming<matt@console-pimps.org>
> Tested-by: Uwe Kleine-König<u.kleine-koenig@pengutronix.de>
> Cc: Peter Zijlstra<peterz@infradead.org>
> Cc: Eric Dumazet<eric.dumazet@gmail.com>
> Cc: John Kacur<jkacur@redhat.com>
> Cc: Ingo Molnar<mingo@elte.hu>
> LKML-Reference:<1288897200-13008-1-git-send-email-dvhart@linux.intel.com>
> Signed-off-by: Thomas Gleixner<tglx@linutronix.de>
> ---
>   kernel/futex.c        |    3 ++-
>   kernel/futex_compat.c |    3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 6c683b3..40a8777 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -2489,7 +2489,8 @@ void exit_robust_list(struct task_struct *curr)
>   {
>   	struct robust_list_head __user *head = curr->robust_list;
>   	struct robust_list __user *entry, *next_entry, *pending;
> -	unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
> +	unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
> +	unsigned int uninitialized_var(next_pi);
>   	unsigned long futex_offset;
>   	int rc;
>
> diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
> index 06da4df..a7934ac 100644
> --- a/kernel/futex_compat.c
> +++ b/kernel/futex_compat.c
> @@ -49,7 +49,8 @@ void compat_exit_robust_list(struct task_struct *curr)
>   {
>   	struct compat_robust_list_head __user *head = curr->compat_robust_list;
>   	struct robust_list __user *entry, *next_entry, *pending;
> -	unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
> +	unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
> +	unsigned int uninitialized_var(next_pi);
>   	compat_uptr_t uentry, next_uentry, upending;
>   	compat_long_t futex_offset;
>   	int rc;


-- 
Darren Hart
Embedded Linux Kernel

  parent reply	other threads:[~2010-11-10 16:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 21:54 [PATCH 0/3] futex: compiler warning and cleanups Darren Hart
2010-10-27 21:54 ` [PATCH 1/3] futex: fix compiler warnings in exit_robust_list Darren Hart
2010-11-04 10:49   ` [1/3] " Uwe Kleine-König
2010-11-04 19:00     ` [PATCH V2] " Darren Hart
2010-11-10 12:20       ` Thomas Gleixner
     [not found]       ` <tip-4c115e951d80aff126468adaec7a6c7854f61ab8@git.kernel.org>
2010-11-10 16:14         ` Darren Hart [this message]
2010-11-10 20:16         ` [tip:core/urgent] futex: Address " Uwe Kleine-König
2010-11-10 20:21           ` Darren Hart
2010-11-10 20:22           ` Darren Hart
2010-10-27 21:54 ` [PATCH 2/3] futex: replace fshared and clockrt with combined flags Darren Hart
2010-11-08 16:47   ` Thomas Gleixner
2010-11-08 21:10     ` [PATCH V2] " Darren Hart
2010-10-27 21:54 ` [PATCH 3/3] futex: add futex_q static initializer Darren Hart
2010-11-08 16:42   ` Thomas Gleixner
2010-11-08 18:12     ` Peter Zijlstra
2010-11-08 19:39       ` Thomas Gleixner
2010-11-08 21:12         ` [PATCH V2] " Darren Hart
2010-11-08 21:40           ` [PATCH V3] " Darren Hart
2010-11-08 21:48             ` Thomas Gleixner
2010-11-08 21:59               ` Darren Hart

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=4CDAC4FB.8040905@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.