From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754973AbbJURkr (ORCPT ); Wed, 21 Oct 2015 13:40:47 -0400 Received: from lists.s-osg.org ([54.187.51.154]:42213 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbbJURkq (ORCPT ); Wed, 21 Oct 2015 13:40:46 -0400 From: Luis de Bethencourt To: linux-kernel@vger.kernel.org Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, oleg.drokin@intel.com, andreas.dilger@intel.com, gulsah.1004@gmail.com, he.huang@intel.com, amir.shehata@intel.com, guillaume.matheron@ens.fr, yejiayily@gmail.com, shuey@purdue.edu, lustre-devel@lists.lustre.org, Luis de Bethencourt Subject: [PATCH] staging: lustre: o2iblnd: fix misleading indentation Date: Wed, 21 Oct 2015 18:40:40 +0100 Message-Id: <1445449240-30305-1-git-send-email-luisbg@osg.samsung.com> X-Mailer: git-send-email 2.5.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code is correct, the indentation is misleading. Only the the return rc is part of the conditional statement if rc != 0. Fix a smatch warning: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:2157 kiblnd_hdev_setup_mrs() warn: curly braces intended? Signed-off-by: Luis de Bethencourt --- Hi, This patch gives a warning in checkpatch.pl for the line: if (hdev->ibh_mrs == NULL) It would be cleaner if this was 'if (!hdev->ibh_mrs)' instead. I didn't fix this as well because the file has 41 instances of comparisons with NULL. I would be happy to do so in a patch in reply to this one if it would be good. Thanks, Luis .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index c2cc4e4..7c730e3 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2154,23 +2154,23 @@ static int kiblnd_hdev_setup_mrs(kib_hca_dev_t *hdev) if (rc != 0) return rc; - LIBCFS_ALLOC(hdev->ibh_mrs, 1 * sizeof(*hdev->ibh_mrs)); - if (hdev->ibh_mrs == NULL) { - CERROR("Failed to allocate MRs table\n"); - return -ENOMEM; - } + LIBCFS_ALLOC(hdev->ibh_mrs, 1 * sizeof(*hdev->ibh_mrs)); + if (hdev->ibh_mrs == NULL) { + CERROR("Failed to allocate MRs table\n"); + return -ENOMEM; + } - hdev->ibh_mrs[0] = NULL; - hdev->ibh_nmrs = 1; + hdev->ibh_mrs[0] = NULL; + hdev->ibh_nmrs = 1; - mr = ib_get_dma_mr(hdev->ibh_pd, acflags); - if (IS_ERR(mr)) { - CERROR("Failed ib_get_dma_mr : %ld\n", PTR_ERR(mr)); - kiblnd_hdev_cleanup_mrs(hdev); - return PTR_ERR(mr); - } + mr = ib_get_dma_mr(hdev->ibh_pd, acflags); + if (IS_ERR(mr)) { + CERROR("Failed ib_get_dma_mr : %ld\n", PTR_ERR(mr)); + kiblnd_hdev_cleanup_mrs(hdev); + return PTR_ERR(mr); + } - hdev->ibh_mrs[0] = mr; + hdev->ibh_mrs[0] = mr; return 0; } -- 2.5.1