linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Johan Hovold <johan@hovoldconsulting.com>
Cc: devel@driverdev.osuosl.org,
	Janani Sankara Babu <jananis37@gmail.com>,
	linux-kernel@vger.kernel.org, greybus-dev@lists.linaro.org
Subject: Re: [greybus-dev] [PATCH] Staging:greybus Fix comparison to NULL
Date: Tue, 5 Jun 2018 07:36:56 -0500	[thread overview]
Message-ID: <bbc826bc-2c86-3ff4-ad96-a4f0c33f9e88@linaro.org> (raw)
In-Reply-To: <20180605090051.fngwzwpzr37ynatf@mwanda>

On 06/05/2018 04:00 AM, Dan Carpenter wrote:
> On Tue, Jun 05, 2018 at 11:02:36AM +0530, Viresh Kumar wrote:
>> On 03-06-18, 08:52, Janani Sankara Babu wrote:
>>> This patch replaces comparison of var to NULL with !var
>>>
>>> Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>

Wow, such deep discussion for such a trivial patch!

I say we take it, mostly because I personally prefer being
permissive if there's nothing technically wrong with a patch,
but also because I'm swayed by the other comments.

That being said, I agree with Johan--the patch would be
improved with a little better comment about what motivated
the submission.  So I'll wait for v2.

					-Alex

>>> ---
>>>  drivers/staging/greybus/core.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
>>> index dafa430..5d14a4e 100644
>>> --- a/drivers/staging/greybus/core.c
>>> +++ b/drivers/staging/greybus/core.c
>>> @@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,
>>>  static const struct greybus_bundle_id *
>>>  greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id)
>>>  {
>>> -	if (id == NULL)
>>> +	if (!id)
>>
>> It is pretty much personal preference and there is no good reason to accept this
>> patch really.
> 
> Checkpatch complains, so it's Official Kernel Style now.
> 
> The != NULL comparison is a double negative which makes it not less
> annoying than official kernel style.
> 
> regards,
> dan carpenter
> 
> _______________________________________________
> greybus-dev mailing list
> greybus-dev@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/greybus-dev
> 

      reply	other threads:[~2018-06-05 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 12:52 [PATCH] Staging:greybus Fix comparison to NULL Janani Sankara Babu
2018-06-05  5:32 ` [greybus-dev] " Viresh Kumar
2018-06-05  6:10   ` Johan Hovold
2018-06-05  9:00   ` Dan Carpenter
2018-06-05 12:36     ` Alex Elder [this message]

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=bbc826bc-2c86-3ff4-ad96-a4f0c33f9e88@linaro.org \
    --to=elder@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=jananis37@gmail.com \
    --cc=johan@hovoldconsulting.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).