From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Raju Rangoju <Raju.Rangoju@amd.com>,
Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op()
Date: Mon, 13 Jan 2025 11:42:06 +0100 [thread overview]
Message-ID: <87h6630zcx.fsf@bootlin.com> (raw)
In-Reply-To: <20250111-spi-amd-fix-uninitialized-ret-v1-1-c66ab9f6a23d@kernel.org> (Nathan Chancellor's message of "Sat, 11 Jan 2025 12:08:38 -0700")
Hello,
On 11/01/2025 at 12:08:38 -07, Nathan Chancellor <nathan@kernel.org> wrote:
> After commit e6204f39fe3a ("spi: amd: Drop redundant check"), clang warns (or
> errors with CONFIG_WERROR=y):
>
> drivers/spi/spi-amd.c:695:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
> 695 | return ret;
> | ^~~
> drivers/spi/spi-amd.c:673:9: note: initialize the variable 'ret' to silence this warning
> 673 | int ret;
> | ^
> | = 0
> 1 error generated.
>
> ret is no longer set on anything other than the default switch path.
> Replace ret with a direct return of 0 at the end of the function and
> -EOPNOTSUPP in the default case to resolve the warning.
Correct, thanks.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
next prev parent reply other threads:[~2025-01-13 10:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 19:08 [PATCH] spi: amd: Fix -Wuninitialized in amd_spi_exec_mem_op() Nathan Chancellor
2025-01-11 19:27 ` Miguel Ojeda
2025-01-13 10:42 ` Miquel Raynal [this message]
2025-01-13 16:45 ` Mark Brown
2025-01-14 10:03 ` Miquel Raynal
2025-01-14 15:17 ` Mark Brown
2025-01-15 18:30 ` Miquel Raynal
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=87h6630zcx.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=Raju.Rangoju@amd.com \
--cc=broonie@kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=patches@lists.linux.dev \
/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.