All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
@ 2022-04-24  9:34 Yang Yingliang
  2022-04-24 16:55 ` Sergey Shtylyov
  2022-04-25  0:44 ` Damien Le Moal
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Yingliang @ 2022-04-24  9:34 UTC (permalink / raw)
  To: linux-kernel, linux-ide; +Cc: damien.lemoal, arnd, b.zolnierkie, robert.jarzmik

If devm_platform_ioremap_resource() fails, it never return
NULL pointer, replace the check with IS_ERR().

Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/ata/pata_palmld.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c
index 400e65190904..51caa2a427dd 100644
--- a/drivers/ata/pata_palmld.c
+++ b/drivers/ata/pata_palmld.c
@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)
 
 	/* remap drive's physical memory address */
 	mem = devm_platform_ioremap_resource(pdev, 0);
-	if (!mem)
-		return -ENOMEM;
+	if (IS_ERR(mem))
+		return PTR_ERR(mem);
 
 	/* request and activate power and reset GPIOs */
 	lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
-- 
2.25.1


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

* Re: [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
  2022-04-24  9:34 [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe() Yang Yingliang
@ 2022-04-24 16:55 ` Sergey Shtylyov
  2022-04-25  6:00   ` Yang Yingliang
  2022-04-25  0:44 ` Damien Le Moal
  1 sibling, 1 reply; 5+ messages in thread
From: Sergey Shtylyov @ 2022-04-24 16:55 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, linux-ide
  Cc: damien.lemoal, arnd, b.zolnierkie, robert.jarzmik

Hello!

   You should CC: me on the PATA driver patches, not Bart -- he no longer maintains
the PATA drivers.

On 4/24/22 12:34 PM, Yang Yingliang wrote:

> If devm_platform_ioremap_resource() fails, it never return
> NULL pointer, replace the check with IS_ERR().
> 
> Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
[...]

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

MBR, Sergey

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

* Re: [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
  2022-04-24  9:34 [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe() Yang Yingliang
  2022-04-24 16:55 ` Sergey Shtylyov
@ 2022-04-25  0:44 ` Damien Le Moal
  2022-04-25  0:45   ` Damien Le Moal
  1 sibling, 1 reply; 5+ messages in thread
From: Damien Le Moal @ 2022-04-25  0:44 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, linux-ide
  Cc: arnd, b.zolnierkie, robert.jarzmik

On 4/24/22 18:34, Yang Yingliang wrote:
> If devm_platform_ioremap_resource() fails, it never return
> NULL pointer, replace the check with IS_ERR().
> 
> Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")

This commit ID does not exist in Linus tree. Is this a commit in the ARM
tree ? If yes, then Arnd, can you take this patch ?


> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/ata/pata_palmld.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c
> index 400e65190904..51caa2a427dd 100644
> --- a/drivers/ata/pata_palmld.c
> +++ b/drivers/ata/pata_palmld.c
> @@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)
>  
>  	/* remap drive's physical memory address */
>  	mem = devm_platform_ioremap_resource(pdev, 0);
> -	if (!mem)
> -		return -ENOMEM;
> +	if (IS_ERR(mem))
> +		return PTR_ERR(mem);
>  
>  	/* request and activate power and reset GPIOs */
>  	lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
  2022-04-25  0:44 ` Damien Le Moal
@ 2022-04-25  0:45   ` Damien Le Moal
  0 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2022-04-25  0:45 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, linux-ide
  Cc: arnd, b.zolnierkie, robert.jarzmik

On 4/25/22 09:44, Damien Le Moal wrote:
> On 4/24/22 18:34, Yang Yingliang wrote:
>> If devm_platform_ioremap_resource() fails, it never return
>> NULL pointer, replace the check with IS_ERR().
>>
>> Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
> 
> This commit ID does not exist in Linus tree. Is this a commit in the ARM
> tree ? If yes, then Arnd, can you take this patch ?

Forgot:

Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

> 
> 
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>  drivers/ata/pata_palmld.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c
>> index 400e65190904..51caa2a427dd 100644
>> --- a/drivers/ata/pata_palmld.c
>> +++ b/drivers/ata/pata_palmld.c
>> @@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)
>>  
>>  	/* remap drive's physical memory address */
>>  	mem = devm_platform_ioremap_resource(pdev, 0);
>> -	if (!mem)
>> -		return -ENOMEM;
>> +	if (IS_ERR(mem))
>> +		return PTR_ERR(mem);
>>  
>>  	/* request and activate power and reset GPIOs */
>>  	lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
> 
> 


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
  2022-04-24 16:55 ` Sergey Shtylyov
@ 2022-04-25  6:00   ` Yang Yingliang
  0 siblings, 0 replies; 5+ messages in thread
From: Yang Yingliang @ 2022-04-25  6:00 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-kernel, linux-ide
  Cc: damien.lemoal, arnd, b.zolnierkie, robert.jarzmik


On 2022/4/25 0:55, Sergey Shtylyov wrote:
> Hello!
>
>     You should CC: me on the PATA driver patches, not Bart -- he no longer maintains
> the PATA drivers.
OK.

Thanks,
Yang
>
> On 4/24/22 12:34 PM, Yang Yingliang wrote:
>
>> If devm_platform_ioremap_resource() fails, it never return
>> NULL pointer, replace the check with IS_ERR().
>>
>> Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> [...]
>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
> MBR, Sergey
> .

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

end of thread, other threads:[~2022-04-25  6:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  9:34 [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe() Yang Yingliang
2022-04-24 16:55 ` Sergey Shtylyov
2022-04-25  6:00   ` Yang Yingliang
2022-04-25  0:44 ` Damien Le Moal
2022-04-25  0:45   ` Damien Le Moal

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.