All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dennis Zhou <dennis@kernel.org>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Prasad Sodagudi <psodagud@codeaurora.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] arm64: percpu: Initialize ret in the default case
Date: Tue, 25 Sep 2018 16:33:55 -0400	[thread overview]
Message-ID: <20180925203355.GA61443@dennisz-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20180925194459.13088-1-natechancellor@gmail.com>

Hi Nathan,

On Tue, Sep 25, 2018 at 12:44:59PM -0700, Nathan Chancellor wrote:
> Clang warns that if the default case is taken, ret will be
> uninitialized.
> 
> ./arch/arm64/include/asm/percpu.h:196:2: warning: variable 'ret' is used
> uninitialized whenever switch default is taken
> [-Wsometimes-uninitialized]
>         default:
>         ^~~~~~~
> ./arch/arm64/include/asm/percpu.h:200:9: note: uninitialized use occurs
> here
>         return ret;
>                ^~~
> ./arch/arm64/include/asm/percpu.h:157:19: note: initialize the variable
> 'ret' to silence this warning
>         unsigned long ret, loop;
>                          ^
>                           = 0
> 
> This warning appears several times while building the erofs filesystem.
> While it's not strictly wrong, the BUILD_BUG will prevent this from
> becoming a true problem. Initialize ret to 0 in the default case right
> before the BUILD_BUG to silence all of these warnings.
> 
> Reported-by: Prasad Sodagudi <psodagud@codeaurora.org>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

I've applied this to percpu/for-4.20.

Thanks,
Dennis

WARNING: multiple messages have this Message-ID (diff)
From: dennis@kernel.org (Dennis Zhou)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: percpu: Initialize ret in the default case
Date: Tue, 25 Sep 2018 16:33:55 -0400	[thread overview]
Message-ID: <20180925203355.GA61443@dennisz-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20180925194459.13088-1-natechancellor@gmail.com>

Hi Nathan,

On Tue, Sep 25, 2018 at 12:44:59PM -0700, Nathan Chancellor wrote:
> Clang warns that if the default case is taken, ret will be
> uninitialized.
> 
> ./arch/arm64/include/asm/percpu.h:196:2: warning: variable 'ret' is used
> uninitialized whenever switch default is taken
> [-Wsometimes-uninitialized]
>         default:
>         ^~~~~~~
> ./arch/arm64/include/asm/percpu.h:200:9: note: uninitialized use occurs
> here
>         return ret;
>                ^~~
> ./arch/arm64/include/asm/percpu.h:157:19: note: initialize the variable
> 'ret' to silence this warning
>         unsigned long ret, loop;
>                          ^
>                           = 0
> 
> This warning appears several times while building the erofs filesystem.
> While it's not strictly wrong, the BUILD_BUG will prevent this from
> becoming a true problem. Initialize ret to 0 in the default case right
> before the BUILD_BUG to silence all of these warnings.
> 
> Reported-by: Prasad Sodagudi <psodagud@codeaurora.org>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

I've applied this to percpu/for-4.20.

Thanks,
Dennis

  parent reply	other threads:[~2018-09-25 20:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 19:44 [PATCH] arm64: percpu: Initialize ret in the default case Nathan Chancellor
2018-09-25 19:44 ` Nathan Chancellor
2018-09-25 20:24 ` Nick Desaulniers
2018-09-25 20:24   ` Nick Desaulniers
2018-09-25 20:29   ` Nick Desaulniers
2018-09-25 20:29     ` Nick Desaulniers
2018-09-25 20:35   ` Dennis Zhou
2018-09-25 20:35     ` Dennis Zhou
2018-09-25 20:33 ` Dennis Zhou [this message]
2018-09-25 20:33   ` Dennis Zhou

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=20180925203355.GA61443@dennisz-mbp.dhcp.thefacebook.com \
    --to=dennis@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=cl@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=psodagud@codeaurora.org \
    --cc=tj@kernel.org \
    --cc=will.deacon@arm.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 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.