mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@aol.com>
To: "Kristaps Čivkulis" <kristaps.civkulis@gmail.com>,
	gaoxiang25@huawei.com, yuchao0@huawei.com,
	gregkh@linuxfoundation.org, linux-erofs@lists.ozlabs.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: erofs: fix if assignment style issue
Date: Mon, 6 Aug 2018 00:05:16 +0800	[thread overview]
Message-ID: <78215373-c086-28bc-e35c-27f93d4e7dce@aol.com> (raw)
In-Reply-To: <20180805152101.11657-1-kristaps.civkulis@gmail.com>

Hi Kristaps,

On 2018/8/5 23:21, Kristaps Čivkulis wrote:
> Fix coding style issue "do not use assignment in if condition"
> detected by checkpatch.pl.
>
> Signed-off-by: Kristaps Čivkulis <kristaps.civkulis@gmail.com>

I don't know whether this rule is mandatory or not for the current linux
kernel
when I checked the original patchset with checkpatch.pl.

Sometime I prefer to use assignment in if condition since the whole
statement
is more meaningful than separate to several statements...  although it
can lead to
some potential bugs.

Another case is use (!ptr) to replace (ptr == NULL) and use (ptr) to replace
(ptr != NULL) for pointers. Actually these expressions are equivalent in C,
but I personally like the nullptr concept... I also have no idea if it
is mandatory to fix
as the checkpatch.pl suggested or not...

Thanks for your patch :) if it is actually mandatory or strongly
recommend, you can add:

Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>

Thanks,
Gao Xiang

  reply	other threads:[~2018-08-05 16:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-05 15:21 Kristaps Čivkulis
2018-08-05 16:05 ` Gao Xiang [this message]
2018-08-06  1:43 ` Chao Yu

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=78215373-c086-28bc-e35c-27f93d4e7dce@aol.com \
    --to=hsiangkao@aol.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gaoxiang25@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kristaps.civkulis@gmail.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /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

all inboxes | Powered by JetHome®