linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] code optimization for mtd
@ 2021-04-08 11:15 Yu Kuai
  2021-04-08 11:15 ` [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() Yu Kuai
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Yu Kuai @ 2021-04-08 11:15 UTC (permalink / raw)
  To: joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek,
	yukuai3, yi.zhang

Yu Kuai (3):
  mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe()
  mtd: plat-ram: remove redundant dev_err call in platram_probe()
  mtd: phram: Fix error return code in phram_setup()

 drivers/mtd/devices/phram.c    | 1 +
 drivers/mtd/maps/plat-ram.c    | 1 -
 drivers/mtd/nand/raw/mtk_ecc.c | 4 +---
 3 files changed, 2 insertions(+), 4 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe()
  2021-04-08 11:15 [PATCH 0/3] code optimization for mtd Yu Kuai
@ 2021-04-08 11:15 ` Yu Kuai
  2021-05-10  9:10   ` Miquel Raynal
  2021-04-08 11:15 ` [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe() Yu Kuai
  2021-04-08 11:15 ` [PATCH 3/3] mtd: phram: Fix error return code in phram_setup() Yu Kuai
  2 siblings, 1 reply; 11+ messages in thread
From: Yu Kuai @ 2021-04-08 11:15 UTC (permalink / raw)
  To: joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek,
	yukuai3, yi.zhang

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/mtd/nand/raw/mtk_ecc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/raw/mtk_ecc.c
index 75f1fa3d4d35..c437d97debb8 100644
--- a/drivers/mtd/nand/raw/mtk_ecc.c
+++ b/drivers/mtd/nand/raw/mtk_ecc.c
@@ -515,10 +515,8 @@ static int mtk_ecc_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	ecc->regs = devm_ioremap_resource(dev, res);
-	if (IS_ERR(ecc->regs)) {
-		dev_err(dev, "failed to map regs: %ld\n", PTR_ERR(ecc->regs));
+	if (IS_ERR(ecc->regs))
 		return PTR_ERR(ecc->regs);
-	}
 
 	ecc->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(ecc->clk)) {
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe()
  2021-04-08 11:15 [PATCH 0/3] code optimization for mtd Yu Kuai
  2021-04-08 11:15 ` [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() Yu Kuai
@ 2021-04-08 11:15 ` Yu Kuai
  2021-05-10  9:10   ` Miquel Raynal
  2021-04-08 11:15 ` [PATCH 3/3] mtd: phram: Fix error return code in phram_setup() Yu Kuai
  2 siblings, 1 reply; 11+ messages in thread
From: Yu Kuai @ 2021-04-08 11:15 UTC (permalink / raw)
  To: joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek,
	yukuai3, yi.zhang

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/mtd/maps/plat-ram.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 0bec7c791d17..cedd8ef9a6bf 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -127,7 +127,6 @@ static int platram_probe(struct platform_device *pdev)
 	info->map.virt = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(info->map.virt)) {
 		err = PTR_ERR(info->map.virt);
-		dev_err(&pdev->dev, "failed to ioremap() region\n");
 		goto exit_free;
 	}
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 11:15 [PATCH 0/3] code optimization for mtd Yu Kuai
  2021-04-08 11:15 ` [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() Yu Kuai
  2021-04-08 11:15 ` [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe() Yu Kuai
@ 2021-04-08 11:15 ` Yu Kuai
  2021-04-08 12:46   ` Miquel Raynal
  2 siblings, 1 reply; 11+ messages in thread
From: Yu Kuai @ 2021-04-08 11:15 UTC (permalink / raw)
  To: joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek,
	yukuai3, yi.zhang

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/mtd/devices/phram.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 5b04ae6c3057..6ed6c51fac69 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -270,6 +270,7 @@ static int phram_setup(const char *val)
 	if (len == 0 || erasesize == 0 || erasesize > len
 	    || erasesize > UINT_MAX || rem) {
 		parse_err("illegal erasesize or len\n");
+		ret = -EINVAL;
 		goto error;
 	}
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 11:15 ` [PATCH 3/3] mtd: phram: Fix error return code in phram_setup() Yu Kuai
@ 2021-04-08 12:46   ` Miquel Raynal
  2021-04-08 13:26     ` yukuai (C)
  2021-04-08 13:38     ` [PATCH V2] " Yu Kuai
  0 siblings, 2 replies; 11+ messages in thread
From: Miquel Raynal @ 2021-04-08 12:46 UTC (permalink / raw)
  To: Yu Kuai
  Cc: joern, richard, vigneshr, matthias.bgg, linux-mtd, linux-kernel,
	linux-arm-kernel, linux-mediatek, yi.zhang

Hi Yu,

Yu Kuai <yukuai3@huawei.com> wrote on Thu, 8 Apr 2021 19:15:14 +0800:

> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/mtd/devices/phram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
> index 5b04ae6c3057..6ed6c51fac69 100644
> --- a/drivers/mtd/devices/phram.c
> +++ b/drivers/mtd/devices/phram.c
> @@ -270,6 +270,7 @@ static int phram_setup(const char *val)
>  	if (len == 0 || erasesize == 0 || erasesize > len
>  	    || erasesize > UINT_MAX || rem) {
>  		parse_err("illegal erasesize or len\n");
> +		ret = -EINVAL;
>  		goto error;
>  	}
>  

It looks like you're doing the opposite of what you say.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 12:46   ` Miquel Raynal
@ 2021-04-08 13:26     ` yukuai (C)
  2021-04-08 13:38     ` [PATCH V2] " Yu Kuai
  1 sibling, 0 replies; 11+ messages in thread
From: yukuai (C) @ 2021-04-08 13:26 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: joern, richard, vigneshr, matthias.bgg, linux-mtd, linux-kernel,
	linux-arm-kernel, linux-mediatek, yi.zhang

On 2021/04/08 20:46, Miquel Raynal wrote:
> Hi Yu,
> 
> Yu Kuai <yukuai3@huawei.com> wrote on Thu, 8 Apr 2021 19:15:14 +0800:
> 
>> Fix to return a negative error code from the error handling
>> case instead of 0, as done elsewhere in this function.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
>> ---
>>   drivers/mtd/devices/phram.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
>> index 5b04ae6c3057..6ed6c51fac69 100644
>> --- a/drivers/mtd/devices/phram.c
>> +++ b/drivers/mtd/devices/phram.c
>> @@ -270,6 +270,7 @@ static int phram_setup(const char *val)
>>   	if (len == 0 || erasesize == 0 || erasesize > len
>>   	    || erasesize > UINT_MAX || rem) {
>>   		parse_err("illegal erasesize or len\n");
>> +		ret = -EINVAL;
>>   		goto error;
>>   	}
>>   
> 
> It looks like you're doing the opposite of what you say.
> 
Hi,

sorry about that, I misunderstood 'fix to'.

Thanks
Yu Kuai
> Thanks,
> Miquèl
> .
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 13:38     ` [PATCH V2] " Yu Kuai
@ 2021-04-08 13:33       ` Miquel Raynal
  2021-05-10  9:10       ` Miquel Raynal
  1 sibling, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2021-04-08 13:33 UTC (permalink / raw)
  To: Yu Kuai; +Cc: joern, richard, vigneshr, linux-mtd, linux-kernel, yi.zhang

Hi Yu,

Yu Kuai <yukuai3@huawei.com> wrote on Thu, 8 Apr 2021 21:38:12 +0800:

> Return a negative error code from the error handling case instead
> of 0, as done elsewhere in this function.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/mtd/devices/phram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
> index 5b04ae6c3057..6ed6c51fac69 100644
> --- a/drivers/mtd/devices/phram.c
> +++ b/drivers/mtd/devices/phram.c
> @@ -270,6 +270,7 @@ static int phram_setup(const char *val)
>  	if (len == 0 || erasesize == 0 || erasesize > len
>  	    || erasesize > UINT_MAX || rem) {
>  		parse_err("illegal erasesize or len\n");
> +		ret = -EINVAL;
>  		goto error;
>  	}
>  

Actually I don't know why but I overlooked the change. I thought you
were removing the ret = line, sorry about that. Anyway, I prefer
the new wording so I'll apply the v2.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH V2] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 12:46   ` Miquel Raynal
  2021-04-08 13:26     ` yukuai (C)
@ 2021-04-08 13:38     ` Yu Kuai
  2021-04-08 13:33       ` Miquel Raynal
  2021-05-10  9:10       ` Miquel Raynal
  1 sibling, 2 replies; 11+ messages in thread
From: Yu Kuai @ 2021-04-08 13:38 UTC (permalink / raw)
  To: joern, miquel.raynal, richard, vigneshr
  Cc: linux-mtd, linux-kernel, yukuai3, yi.zhang

Return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/mtd/devices/phram.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 5b04ae6c3057..6ed6c51fac69 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -270,6 +270,7 @@ static int phram_setup(const char *val)
 	if (len == 0 || erasesize == 0 || erasesize > len
 	    || erasesize > UINT_MAX || rem) {
 		parse_err("illegal erasesize or len\n");
+		ret = -EINVAL;
 		goto error;
 	}
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH V2] mtd: phram: Fix error return code in phram_setup()
  2021-04-08 13:38     ` [PATCH V2] " Yu Kuai
  2021-04-08 13:33       ` Miquel Raynal
@ 2021-05-10  9:10       ` Miquel Raynal
  1 sibling, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2021-05-10  9:10 UTC (permalink / raw)
  To: Yu Kuai, joern, miquel.raynal, richard, vigneshr
  Cc: linux-mtd, linux-kernel, yi.zhang

On Thu, 2021-04-08 at 13:38:12 UTC, Yu Kuai wrote:
> Return a negative error code from the error handling case instead
> of 0, as done elsewhere in this function.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe()
  2021-04-08 11:15 ` [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe() Yu Kuai
@ 2021-05-10  9:10   ` Miquel Raynal
  0 siblings, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2021-05-10  9:10 UTC (permalink / raw)
  To: Yu Kuai, joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek, yi.zhang

On Thu, 2021-04-08 at 11:15:13 UTC, Yu Kuai wrote:
> There is a error message within devm_ioremap_resource
> already, so remove the dev_err call to avoid redundant
> error message.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe()
  2021-04-08 11:15 ` [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() Yu Kuai
@ 2021-05-10  9:10   ` Miquel Raynal
  0 siblings, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2021-05-10  9:10 UTC (permalink / raw)
  To: Yu Kuai, joern, miquel.raynal, richard, vigneshr, matthias.bgg
  Cc: linux-mtd, linux-kernel, linux-arm-kernel, linux-mediatek, yi.zhang

On Thu, 2021-04-08 at 11:15:12 UTC, Yu Kuai wrote:
> There is a error message within devm_ioremap_resource
> already, so remove the dev_err call to avoid redundant
> error message.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-05-10  9:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 11:15 [PATCH 0/3] code optimization for mtd Yu Kuai
2021-04-08 11:15 ` [PATCH 1/3] mtd: rawnand: mtk: remove redundant dev_err call in mtk_ecc_probe() Yu Kuai
2021-05-10  9:10   ` Miquel Raynal
2021-04-08 11:15 ` [PATCH 2/3] mtd: plat-ram: remove redundant dev_err call in platram_probe() Yu Kuai
2021-05-10  9:10   ` Miquel Raynal
2021-04-08 11:15 ` [PATCH 3/3] mtd: phram: Fix error return code in phram_setup() Yu Kuai
2021-04-08 12:46   ` Miquel Raynal
2021-04-08 13:26     ` yukuai (C)
2021-04-08 13:38     ` [PATCH V2] " Yu Kuai
2021-04-08 13:33       ` Miquel Raynal
2021-05-10  9:10       ` 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).