[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450905892-31089-13-git-send-email-jsimmons@infradead.org>
Date: Wed, 23 Dec 2015 16:24:51 -0500
From: James Simmons <jsimmons@...radead.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, Oleg Drokin <oleg.drokin@...el.com>,
Andreas Dilger <andreas.dilger@...el.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
lustre-devel@...ts.lustre.org,
James Simmons <jsimmons@...radead.org>
Subject: [PATCH 12/13] staging: lustre: fix all conditional comparison to zero for kernelcomm.c
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects
kernelcomm.c to behavior according to kernel coding standards.
Signed-off-by: James Simmons <jsimmons@...radead.org>
---
.../staging/lustre/lustre/obdclass/kernelcomm.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index 281cfd6..285fee0 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -154,7 +154,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group)
if (!kkuc_groups[group].next)
return 0;
- if (uid == 0) {
+ if (!uid) {
/* Broadcast a shutdown message */
struct kuc_hdr lh;
@@ -167,7 +167,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group)
down_write(&kg_sem);
list_for_each_entry_safe(reg, next, &kkuc_groups[group], kr_chain) {
- if ((uid == 0) || (uid == reg->kr_uid)) {
+ if (!uid || (uid == reg->kr_uid)) {
list_del(®->kr_chain);
CDEBUG(D_KUC, "Removed uid=%d fp=%p from group %d\n",
reg->kr_uid, reg->kr_fp, group);
@@ -192,7 +192,7 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload)
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
if (reg->kr_fp) {
rc = libcfs_kkuc_msg_put(reg->kr_fp, payload);
- if (rc == 0) {
+ if (!rc) {
one_success = 1;
} else if (rc == -EPIPE) {
fput(reg->kr_fp);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists