linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Mark Brown <broonie@kernel.org>
Cc: lhjeff911@gmail.com, nathan@kernel.org, ndesaulniers@google.com,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] spi: initialize ret variable
Date: Wed, 9 Feb 2022 08:44:21 -0800	[thread overview]
Message-ID: <61a545d5-224d-86fb-2fe3-406c3ffd78fb@redhat.com> (raw)
In-Reply-To: <YgPs8U85ZFbDWYlx@sirena.org.uk>


On 2/9/22 8:33 AM, Mark Brown wrote:
> On Wed, Feb 09, 2022 at 08:30:29AM -0800, trix@redhat.com wrote:
>> From: Tom Rix <trix@redhat.com>
>>
>> Clang build fails with
>> spi-sunplus-sp7021.c:405:2: error: variable 'ret' is used
>>    uninitialized whenever switch default is taken
>>          default:
>>          ^~~~~~~
>>
>> Restore initializing ret.
> Are you sure this is a good fix and that the compiler hasn't instead
> identifed that we should be returning an error in the default case?

If setting mode to idle is not really a valid state, then default should 
return an error.

The old behavior returned 0 and I am treating this as a regression.

Tom


  reply	other threads:[~2022-02-09 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 16:30 [PATCH] spi: initialize ret variable trix
2022-02-09 16:33 ` Mark Brown
2022-02-09 16:44   ` Tom Rix [this message]
2022-02-09 17:04     ` Mark Brown
     [not found]       ` <CAGcXWkyCQ4JExvHv3cEL7vLMOcq_iPu0vOyOmnfzbQmMxHEp=Q@mail.gmail.com>
     [not found]         ` <27a1822d798641f5bba33d7529ec02c0@sphcmbx02.sunplus.com.tw>
2022-02-10  2:45           ` 郭力豪

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=61a545d5-224d-86fb-2fe3-406c3ffd78fb@redhat.com \
    --to=trix@redhat.com \
    --cc=broonie@kernel.org \
    --cc=lhjeff911@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).