linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Guo Zhengkui <guozhengkui@vivo.com>
Cc: Haakon Bugge <haakon.bugge@oracle.com>,
	Mustafa Ismail <mustafa.ismail@intel.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
	OFED mailing list <linux-rdma@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"zhengkui_guo@outlook.com" <zhengkui_guo@outlook.com>
Subject: Re: [PATCH linux-next] RDMA: simplify if-if to if-else
Date: Thu, 31 Mar 2022 12:05:34 +0300	[thread overview]
Message-ID: <YkVu3vqjIPFRSGtM@unreal> (raw)
In-Reply-To: <38d43b49-9999-af2d-e3cd-3917c481651b@vivo.com>

On Thu, Mar 31, 2022 at 11:03:30AM +0800, Guo Zhengkui wrote:
> On 2022/3/30 20:56, Leon Romanovsky wrote:
> > On Wed, Mar 30, 2022 at 12:26:51PM +0000, Haakon Bugge wrote:
> > > 
> > > 
> > > > On 30 Mar 2022, at 13:32, Leon Romanovsky <leon@kernel.org> wrote:
> > > > 
> > > > On Wed, Mar 30, 2022 at 11:06:03AM +0000, Haakon Bugge wrote:
> > > > > 
> > > > > 
> > > > > > On 30 Mar 2022, at 13:02, Leon Romanovsky <leon@kernel.org> wrote:
> > > > > > 
> > > > > > On Mon, Mar 28, 2022 at 09:08:59PM +0800, Guo Zhengkui wrote:
> > > > > > > `if (!ret)` can be replaced with `else` for simplification.
> > > > > > > 
> > > > > > > Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> > > > > > > ---
> > > > > > > drivers/infiniband/hw/irdma/puda.c | 4 ++--
> > > > > > > drivers/infiniband/hw/mlx4/mcg.c   | 3 +--
> > > > > > > 2 files changed, 3 insertions(+), 4 deletions(-)
> > > > > > > 
> > > > > > 
> > > > > > Thanks,
> > > > > > Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> > > > > 
> > > > > Fix the unbalanced curly brackets at the same time?
> > > > 
> > > > I think that it is ok to have if () ... else { ... } code.
> > > 
> > > 
> > > Hmm, doesn't the kernel coding style say:
> > > 
> > > "Do not unnecessarily use braces where a single statement will do."
> > > 
> > > [snip]
> > > 
> > > "This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches"
> > 
> > ok, if it is written in documentation, let's follow it.
> > 
> > Thanks for pointing that out.
> 
> Should I resubmit the patch including unbalanced curly brackets fixing? If
> not, I can submit another patch to fix this problem.

Your patch wasn't merged yet, so new version should be sent.

Thanks 
> 
> > 
> > > 
> > > 
> > > Thxs, Håkon
> > > 
> > > 
> > > > 
> > > > There is one place that needs an indentation fix, in mlx4, but it is
> > > > faster to fix when applying the patch instead of asking to resubmit.
> > > > 
> > > > thanks
> > > > 
> > > > > 
> > > > > 
> > > > > Thxs, Håkon
> > > 
> 
> Thanks,
> 
> Zhengkui

  reply	other threads:[~2022-03-31  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 13:08 [PATCH linux-next] RDMA: simplify if-if to if-else Guo Zhengkui
2022-03-30 11:02 ` Leon Romanovsky
2022-03-30 11:06   ` Haakon Bugge
2022-03-30 11:32     ` Leon Romanovsky
2022-03-30 12:26       ` Haakon Bugge
2022-03-30 12:56         ` Leon Romanovsky
2022-03-31  3:03           ` Guo Zhengkui
2022-03-31  9:05             ` Leon Romanovsky [this message]
2022-03-31 13:05               ` [PATCH linux-next v2] " Guo Zhengkui
2022-03-31 13:58                 ` Saleem, Shiraz
2022-04-04 13:56                 ` Jason Gunthorpe

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=YkVu3vqjIPFRSGtM@unreal \
    --to=leon@kernel.org \
    --cc=guozhengkui@vivo.com \
    --cc=haakon.bugge@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=shiraz.saleem@intel.com \
    --cc=yishaih@nvidia.com \
    --cc=zhengkui_guo@outlook.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;
as well as URLs for NNTP newsgroup(s).