* [PATCH] staging: lustre: o2iblnd: fix misleading indentation
@ 2015-10-21 17:40 Luis de Bethencourt
2015-10-22 19:48 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Luis de Bethencourt @ 2015-10-21 17:40 UTC (permalink / raw)
To: linux-kernel
Cc: devel, gregkh, oleg.drokin, andreas.dilger, gulsah.1004, he.huang,
amir.shehata, guillaume.matheron, yejiayily, shuey, lustre-devel,
Luis de Bethencourt
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 <luisbg@osg.samsung.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging: lustre: o2iblnd: fix misleading indentation
2015-10-21 17:40 [PATCH] staging: lustre: o2iblnd: fix misleading indentation Luis de Bethencourt
@ 2015-10-22 19:48 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-10-22 19:48 UTC (permalink / raw)
To: Luis de Bethencourt
Cc: linux-kernel, devel, andreas.dilger, gulsah.1004, gregkh, shuey,
oleg.drokin, yejiayily, guillaume.matheron, lustre-devel,
amir.shehata, he.huang
On Wed, Oct 21, 2015 at 06:40:40PM +0100, Luis de Bethencourt wrote:
> 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 <luisbg@osg.samsung.com>
> ---
>
> 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.
>
You did the right thing. One thing per patch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-22 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 17:40 [PATCH] staging: lustre: o2iblnd: fix misleading indentation Luis de Bethencourt
2015-10-22 19:48 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox