* [PATCH] spi: exynos: Remove extra term from test
@ 2025-08-12 12:01 Andrew Goodbody
2025-08-25 2:17 ` Minkyu Kang
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Goodbody @ 2025-08-12 12:01 UTC (permalink / raw)
To: Jagan Teki, Tom Rini; +Cc: u-boot, Andrew Goodbody
In spi_rx_tx there comes a test for execution of a code block that
allows execution if rxp is not NULL or stopping is true. However all the
code in this block relies on rxp being valid so allowing entry just if
stopping is true does not make sense. So remove this from the test
expression leaving just a NULL check for rxp.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
---
drivers/spi/exynos_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
index 1b9bf004b7c..d11952afe5d 100644
--- a/drivers/spi/exynos_spi.c
+++ b/drivers/spi/exynos_spi.c
@@ -166,7 +166,7 @@ static int spi_rx_tx(struct exynos_spi_priv *priv, int todo,
stopping = 0;
}
} else {
- if (rxp || stopping) {
+ if (rxp) {
if (step == 4)
*(uint32_t *)rxp = temp;
else
---
base-commit: 7807ed921314cd7af83fd88162d0b8c6fb20a9ca
change-id: 20250812-exynos_spi-8172ecb31a83
Best regards,
--
Andrew Goodbody <andrew.goodbody@linaro.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: exynos: Remove extra term from test
2025-08-12 12:01 [PATCH] spi: exynos: Remove extra term from test Andrew Goodbody
@ 2025-08-25 2:17 ` Minkyu Kang
2025-09-01 15:08 ` Andrew Goodbody
0 siblings, 1 reply; 3+ messages in thread
From: Minkyu Kang @ 2025-08-25 2:17 UTC (permalink / raw)
To: Andrew Goodbody; +Cc: Jagan Teki, Tom Rini, u-boot
Hi,
2025년 8월 12일 (화) 21:01, Andrew Goodbody <andrew.goodbody@linaro.org>님이 작성:
> In spi_rx_tx there comes a test for execution of a code block that
> allows execution if rxp is not NULL or stopping is true. However all the
> code in this block relies on rxp being valid so allowing entry just if
> stopping is true does not make sense. So remove this from the test
> expression leaving just a NULL check for rxp.
>
> This issue was found by Smatch.
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
> ---
> drivers/spi/exynos_spi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
> index 1b9bf004b7c..d11952afe5d 100644
> --- a/drivers/spi/exynos_spi.c
> +++ b/drivers/spi/exynos_spi.c
> @@ -166,7 +166,7 @@ static int spi_rx_tx(struct exynos_spi_priv *priv, int
> todo,
> stopping = 0;
> }
> } else {
> - if (rxp || stopping) {
> + if (rxp) {
then, isn't the stopping variable no longer necessary?
> if (step == 4)
> *(uint32_t *)rxp =
> temp;
> else
>
> ---
> base-commit: 7807ed921314cd7af83fd88162d0b8c6fb20a9ca
> change-id: 20250812-exynos_spi-8172ecb31a83
>
> Best regards,
> --
> Andrew Goodbody <andrew.goodbody@linaro.org>
>
Thanks.
Minkyu Kang.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: exynos: Remove extra term from test
2025-08-25 2:17 ` Minkyu Kang
@ 2025-09-01 15:08 ` Andrew Goodbody
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Goodbody @ 2025-09-01 15:08 UTC (permalink / raw)
To: Minkyu Kang; +Cc: Jagan Teki, Tom Rini, u-boot
On 25/08/2025 03:17, Minkyu Kang wrote:
> Hi,
>
>
> 2025년 8월 12일 (화) 21:01, Andrew Goodbody <andrew.goodbody@linaro.org
> <mailto:andrew.goodbody@linaro.org>>님이 작성:
>
> In spi_rx_tx there comes a test for execution of a code block that
> allows execution if rxp is not NULL or stopping is true. However all the
> code in this block relies on rxp being valid so allowing entry just if
> stopping is true does not make sense. So remove this from the test
> expression leaving just a NULL check for rxp.
>
> This issue was found by Smatch.
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org
> <mailto:andrew.goodbody@linaro.org>>
> ---
> drivers/spi/exynos_spi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
> index 1b9bf004b7c..d11952afe5d 100644
> --- a/drivers/spi/exynos_spi.c
> +++ b/drivers/spi/exynos_spi.c
> @@ -166,7 +166,7 @@ static int spi_rx_tx(struct exynos_spi_priv
> *priv, int todo,
> stopping = 0;
> }
> } else {
> - if (rxp || stopping) {
> + if (rxp) {
>
>
> then, isn't the stopping variable no longer necessary?
Yes indeed, thanks for spotting that. V2 coming.
Andrew
>
> if (step == 4)
> *(uint32_t
> *)rxp = temp;
> else
>
> ---
> base-commit: 7807ed921314cd7af83fd88162d0b8c6fb20a9ca
> change-id: 20250812-exynos_spi-8172ecb31a83
>
> Best regards,
> --
> Andrew Goodbody <andrew.goodbody@linaro.org
> <mailto:andrew.goodbody@linaro.org>>
>
>
> Thanks.
> Minkyu Kang.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-01 15:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 12:01 [PATCH] spi: exynos: Remove extra term from test Andrew Goodbody
2025-08-25 2:17 ` Minkyu Kang
2025-09-01 15:08 ` Andrew Goodbody
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).