lkml.org 
[lkml]   [2021]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] cxl: Fix an error message
From
Date
On 6/5/21 5:38 am, Christophe JAILLET wrote:
> 'rc' is known to be 0 here.
> Initialize 'rc' with the expected error code before using it.

I would prefer:

"In cxl_add_chardev(), if the call to device_create() fails, we print
the error message before 'rc' is set correctly, and therefore always
print 0. Move the error message after setting 'rc'."

>
> While at it, avoid the affectation of 'rc' in a 'if' to make things more
> obvious and linux style.

I strongly agree with this, some of the other cxl developers don't but
they are wrong :)

>
> Fixes: f204e0b8ce ("cxl: Driver code for powernv PCIe based cards for userspace access")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Apart from my comment above:

Acked-by: Andrew Donnellan <ajd@linux.ibm.com>

Thanks for catching this!

--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited

\
 
 \ /
  Last update: 2021-05-06 04:30    [W:0.401 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site