[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d898a2a-fc3c-a804-ce13-cbfc58565cfb@linux.ibm.com>
Date: Thu, 6 May 2021 12:29:57 +1000
From: Andrew Donnellan <ajd@...ux.ibm.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
fbarrat@...ux.ibm.com, arnd@...db.de, gregkh@...uxfoundation.org,
mpe@...erman.id.au, imunsie@....ibm.com, mikey@...ling.org
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] cxl: Fix an error message
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@...adoo.fr>
Apart from my comment above:
Acked-by: Andrew Donnellan <ajd@...ux.ibm.com>
Thanks for catching this!
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@...ux.ibm.com IBM Australia Limited
Powered by blists - more mailing lists