[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61a545d5-224d-86fb-2fe3-406c3ffd78fb@redhat.com>
Date:   Wed, 9 Feb 2022 08:44:21 -0800
From:   Tom Rix <trix@...hat.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     lhjeff911@...il.com, nathan@...nel.org, ndesaulniers@...gle.com,
        linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH] spi: initialize ret variable
On 2/9/22 8:33 AM, Mark Brown wrote:
> On Wed, Feb 09, 2022 at 08:30:29AM -0800, trix@...hat.com wrote:
>> From: Tom Rix <trix@...hat.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
Powered by blists - more mailing lists
 
