public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	fbarrat@linux.ibm.com, arnd@arndb.de, gregkh@linuxfoundation.org,
	mpe@ellerman.id.au, imunsie@au1.ibm.com, mikey@neuling.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] cxl: Fix an error message
Date: Thu, 6 May 2021 12:29:57 +1000	[thread overview]
Message-ID: <2d898a2a-fc3c-a804-ce13-cbfc58565cfb@linux.ibm.com> (raw)
In-Reply-To: <fa2b2c9c72335ab4c3d5e6a33415e7f020b1d51b.1620243401.git.christophe.jaillet@wanadoo.fr>

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

  reply	other threads:[~2021-05-06  2:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 19:38 [PATCH] cxl: Fix an error message Christophe JAILLET
2021-05-06  2:29 ` Andrew Donnellan [this message]
2021-05-14 11:43 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d898a2a-fc3c-a804-ce13-cbfc58565cfb@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=fbarrat@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=imunsie@au1.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox