From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A1E1C433F5 for ; Thu, 31 Mar 2022 09:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233583AbiCaJHb (ORCPT ); Thu, 31 Mar 2022 05:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbiCaJH3 (ORCPT ); Thu, 31 Mar 2022 05:07:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23298C1E; Thu, 31 Mar 2022 02:05:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A577B6199D; Thu, 31 Mar 2022 09:05:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B9DDC340EE; Thu, 31 Mar 2022 09:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648717542; bh=O9mbqJV3/2zhXLz1A++FCmBwPUA6tFJLaXZiovQ4JXY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WXCEVL+6+yKs1Zpypor4ip+GLvHnIJ+ifBVaCT8mlroDbv0hrI9ei/XyQ0BqEGK/d PgJ2dduYgYovBlHn2DbOX8k22xPW/AZ5VEydxBQEwpwg8PISd6fR1XLxdFeFPJnOIq JTt3qfQuPt7cSwa4+7eGS/mfEg+dgDB+ZQ4NunedczqUifYdmvSjkpewwx6F2BJhuj 4NjcuX2DzVXERGzgqZpgV/xq2eE3bcUlfDI1UBqHhN/wFvMd93M5M6lC0r1E1BwfqS SnXT8uaBJN8+eLp1+tlse+A2WWvTH5+9vAYVbX7rjdl/VffAzIrNmHrDLQMORUvm0+ XS1OH0sjygmpw== Date: Thu, 31 Mar 2022 12:05:34 +0300 From: Leon Romanovsky To: Guo Zhengkui Cc: Haakon Bugge , Mustafa Ismail , Shiraz Saleem , Jason Gunthorpe , Yishai Hadas , OFED mailing list , open list , "zhengkui_guo@outlook.com" Subject: Re: [PATCH linux-next] RDMA: simplify if-if to if-else Message-ID: References: <20220328130900.8539-1-guozhengkui@vivo.com> <76AE36BF-01F9-420B-B7BF-A7C9F523A45C@oracle.com> <93D39EC2-6C71-45D8-883A-F8DAA6ECFEDF@oracle.com> <38d43b49-9999-af2d-e3cd-3917c481651b@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <38d43b49-9999-af2d-e3cd-3917c481651b@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrote: > > > > > > > > On Wed, Mar 30, 2022 at 11:06:03AM +0000, Haakon Bugge wrote: > > > > > > > > > > > > > > > > On 30 Mar 2022, at 13:02, Leon Romanovsky 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 > > > > > > > --- > > > > > > > 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 > > > > > > > > > > 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