lkml.org 
[lkml]   [2022]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] video: fbdev: imxfb: fix return value check in imxfb_probe()
From
Date
Hi,

On 2022/7/31 7:18, Uwe Kleine-König wrote:
> Hello,
>
> On Fri, Jul 29, 2022 at 10:41:34AM +0800, Yang Yingliang wrote:
>> If devm_ioremap_resource() fails, it never return NULL, replace
>> NULL test with IS_ERR().
> Oh, thanks for cleanup up behind me. Did you find this using some static
> analysis tool? I would consider it interesting and fair to mention this
> in the commit log.
I found it by coccicheck like this:

@@
expression ret, E;
@@
ret = \(devm_ioremap_resource\)(...);
... when != ret = E
    when != IS_ERR(ret)
(
 ret == NULL || IS_ERR(ret)
|
 IS_ERR(ret) || ret == NULL
|
 ret != NULL && !IS_ERR(ret)
|
 !IS_ERR(ret) && ret != NULL
|
- ret == NULL
+ IS_ERR(ret)
|
- ret != NULL
+ !IS_ERR(ret)
)

Thanks,
Yang
>
> Best regards
> Uwe
>
>

\
 
 \ /
  Last update: 2022-08-01 04:45    [W:0.066 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site