lkml.org 
[lkml]   [2022]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Re: [PATCH v2] ide: Check for null pointer after calling devm_ioremap
Date
On Fri, Jan 07, 2022 at 05:28:59PM +0800, David Laight wrote:
> That !!alt_base doesn't look right.
> Without looking at the rest of the code maybe:
> if (!base && !alt_base)
> may be correct.

Thanks, that's my fault.
I will correct it.

> It also rather makes me wonder about the actual failure return value.
> If devm_ioport_map() returns a 'port number' for inb()/outb() then
> zero is technically a valid value!

That's not right.
The devm_ioport_map() returns NULL if fails and returns non-NULL
pointer if success.
And also we can find in `drivers/ata/pata_platform.c` that it also
use the same way to check the return value from devm_ioport_map().

I will submit a new version to correct my code.

Sincerely thanks,
Jiang

\
 
 \ /
  Last update: 2022-01-07 12:49    [W:0.027 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site