lkml.org 
[lkml]   [2016]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] s390/pci: Remove unnecessary if condition
On Fri, 29 Jul 2016, Amitoj Kaur Chawla wrote:
> Remove unnecessary error handling because the only failure value that
> can be returned is NULL and so the test can never be true.
>
> The Coccinelle semantic patch used to make this change is as follows:
> @@
> expression e;
> @@
>
> e = debugfs_create_file(...);
> - if(IS_ERR(e)) { e = NULL; }

Nope. For !CONFIG_DEBUG_FS debugfs_create_file returns an ERR_PTR.

Regards,
Sebastian

\
 
 \ /
  Last update: 2016-07-29 11:21    [W:0.073 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site