* [PATCH] backlight: ili922x: add an error code check in ili922x_write
@ 2023-11-30 5:11 Su Hui
2023-12-07 14:28 ` Daniel Thompson
2023-12-07 15:55 ` (subset) " Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Su Hui @ 2023-11-30 5:11 UTC (permalink / raw)
To: lee, daniel.thompson, jingoohan1, deller, nathan, ndesaulniers,
trix
Cc: Su Hui, dri-devel, linux-fbdev, linux-kernel, llvm,
kernel-janitors
Clang static analyzer complains that value stored to 'ret' is never read.
Return the error code when spi_sync() failed.
Signed-off-by: Su Hui <suhui@nfschina.com>
---
drivers/video/backlight/ili922x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
index e7b6bd827986..47b872ac64a7 100644
--- a/drivers/video/backlight/ili922x.c
+++ b/drivers/video/backlight/ili922x.c
@@ -269,6 +269,10 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
spi_message_add_tail(&xfer_regindex, &msg);
ret = spi_sync(spi, &msg);
+ if (ret < 0) {
+ dev_err(&spi->dev, "Error sending SPI message 0x%x", ret);
+ return ret;
+ }
spi_message_init(&msg);
tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] backlight: ili922x: add an error code check in ili922x_write
2023-11-30 5:11 [PATCH] backlight: ili922x: add an error code check in ili922x_write Su Hui
@ 2023-12-07 14:28 ` Daniel Thompson
2023-12-07 15:55 ` (subset) " Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Thompson @ 2023-12-07 14:28 UTC (permalink / raw)
To: Su Hui
Cc: lee, jingoohan1, deller, nathan, ndesaulniers, trix, dri-devel,
linux-fbdev, linux-kernel, llvm, kernel-janitors
On Thu, Nov 30, 2023 at 01:11:56PM +0800, Su Hui wrote:
> Clang static analyzer complains that value stored to 'ret' is never read.
> Return the error code when spi_sync() failed.
>
> Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Daniel.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (subset) [PATCH] backlight: ili922x: add an error code check in ili922x_write
2023-11-30 5:11 [PATCH] backlight: ili922x: add an error code check in ili922x_write Su Hui
2023-12-07 14:28 ` Daniel Thompson
@ 2023-12-07 15:55 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2023-12-07 15:55 UTC (permalink / raw)
To: lee, daniel.thompson, jingoohan1, deller, nathan, ndesaulniers,
trix, Su Hui
Cc: dri-devel, linux-fbdev, linux-kernel, llvm, kernel-janitors
On Thu, 30 Nov 2023 13:11:56 +0800, Su Hui wrote:
> Clang static analyzer complains that value stored to 'ret' is never read.
> Return the error code when spi_sync() failed.
>
>
Applied, thanks!
[1/1] backlight: ili922x: add an error code check in ili922x_write
commit: 769ff5283f0d7edc819743f183d51af077411107
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-07 15:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30 5:11 [PATCH] backlight: ili922x: add an error code check in ili922x_write Su Hui
2023-12-07 14:28 ` Daniel Thompson
2023-12-07 15:55 ` (subset) " Lee Jones
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).