lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 27 Jun 2015 06:36:05 +0100
From:	Vasiliy Korchagin <vasiliy.korchagin@...il.com>
To:	oleg.drokin@...el.com, andreas.dilger@...el.com, joe@...ches.com
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Vasiliy Korchagin <vasiliy.korchagin@...il.com>
Subject: [PATCH] staging: lustre: obdclass: fix macro coding style issue in uuid.c

This patch fixes the checkpatch.pl error:

ERROR: Macros with complex values should be enclosed in parentheses
+#define CONSUME(val, ptr) (val) = consume(sizeof(val), (ptr))

by expanding it as this macro is used only once.

Signed-off-by: Vasiliy Korchagin <vasiliy.korchagin@...il.com>
---

Notes:
    Here is another version with macro expansion. Inline function expansion doesn't
    seem like a good idea to me as it would make things overcomplicated.

 drivers/staging/lustre/lustre/obdclass/uuid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/uuid.c b/drivers/staging/lustre/lustre/obdclass/uuid.c
index ff0a01b..d121c5c 100644
--- a/drivers/staging/lustre/lustre/obdclass/uuid.c
+++ b/drivers/staging/lustre/lustre/obdclass/uuid.c
@@ -55,8 +55,6 @@ static inline __u32 consume(int nob, __u8 **ptr)
 	return value;
 }
 
-#define CONSUME(val, ptr) (val) = consume(sizeof(val), (ptr))
-
 static void uuid_unpack(class_uuid_t in, __u16 *uu, int nr)
 {
 	__u8 *ptr = in;
@@ -64,7 +62,7 @@ static void uuid_unpack(class_uuid_t in, __u16 *uu, int nr)
 	LASSERT(nr * sizeof(*uu) == sizeof(class_uuid_t));
 
 	while (nr-- > 0)
-		CONSUME(uu[nr], &ptr);
+		uu[nr] = consume(sizeof(uu[nr]), &ptr);
 }
 
 void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out)
-- 
2.4.4

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ