lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH linux-next] RDMA: simplify if-if to if-else
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

\
 
 \ /
  Last update: 2022-03-31 11:07    [W:0.062 / U:1.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site