* [PATCH] mtd: rawnand: pl353: Use int type to store negative error codes
@ 2025-08-30 10:06 Qianfeng Rong
2025-09-01 13:02 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Qianfeng Rong @ 2025-08-30 10:06 UTC (permalink / raw)
To: Miquel Raynal, Michal Simek, Richard Weinberger,
Vignesh Raghavendra, linux-mtd, linux-kernel
Cc: Qianfeng Rong
Change the 'ret' variable from u32 to int in pl35x_nand_probe() to store
negative error codes or zero;
Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.
No effect on runtime.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/mtd/nand/raw/pl35x-nand-controller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c
index 09440ed4652e..37e92b86bf26 100644
--- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
+++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
@@ -1137,7 +1137,7 @@ static int pl35x_nand_probe(struct platform_device *pdev)
struct device *smc_dev = pdev->dev.parent;
struct amba_device *smc_amba = to_amba_device(smc_dev);
struct pl35x_nandc *nfc;
- u32 ret;
+ int ret;
nfc = devm_kzalloc(&pdev->dev, sizeof(*nfc), GFP_KERNEL);
if (!nfc)
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: rawnand: pl353: Use int type to store negative error codes
2025-08-30 10:06 [PATCH] mtd: rawnand: pl353: Use int type to store negative error codes Qianfeng Rong
@ 2025-09-01 13:02 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2025-09-01 13:02 UTC (permalink / raw)
To: Michal Simek, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
linux-kernel, Qianfeng Rong
On Sat, 30 Aug 2025 18:06:37 +0800, Qianfeng Rong wrote:
> Change the 'ret' variable from u32 to int in pl35x_nand_probe() to store
> negative error codes or zero;
>
> Storing the negative error codes in unsigned type, doesn't cause an issue
> at runtime but can be confusing. Additionally, assigning negative error
> codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
> flag is enabled.
>
> [...]
Applied to nand/next, thanks!
[1/1] mtd: rawnand: pl353: Use int type to store negative error codes
commit: 8a9e097def55391273d3042b32350ded1ec83e04
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-01 13:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-30 10:06 [PATCH] mtd: rawnand: pl353: Use int type to store negative error codes Qianfeng Rong
2025-09-01 13:02 ` Miquel Raynal
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).