mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Philipp Reisner <philipp.reisner@linbit.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Jens Axboe <axboe@kernel.dk>,
	drbd-dev@lists.linbit.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drbd: Rename LEVEL to VLI_LEVEL to avoid name clash
Date: Mon, 6 May 2019 00:23:27 +0200	[thread overview]
Message-ID: <20190505222327.GA32268@ls3530.dellerweb.de> (raw)

Using a generic word like LEVEL is bad idea - it can easily clash with another
LEVEL defined somewhere else.
In this case, it clashed with the LEVEL defined in arch/parisc/include/asm/assembly.h
when the header file got included via jump_level.h.

This patch replaces the LEVEL defined in drbd_vli.h by VLI_LEVEL.
Another patch renames the LEVEL defined in arch/parisc/include/asm/assembly.h.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/drivers/block/drbd/drbd_vli.h b/drivers/block/drbd/drbd_vli.h
index 8cb1532a3816..d7ced8626035 100644
--- a/drivers/block/drbd/drbd_vli.h
+++ b/drivers/block/drbd/drbd_vli.h
@@ -121,22 +121,22 @@ prefix    data bits                                    max val  Nº data bits
  1             16              32                              64
 */

-/* LEVEL: (total bits, prefix bits, prefix value),
+/* VLI_LEVEL: (total bits, prefix bits, prefix value),
  * sorted ascending by number of total bits.
  * The rest of the code table is calculated at compiletime from this. */

 /* fibonacci data 1, 1, ... */
 #define VLI_L_1_1() do { \
-	LEVEL( 2, 1, 0x00); \
-	LEVEL( 3, 2, 0x01); \
-	LEVEL( 5, 3, 0x03); \
-	LEVEL( 7, 4, 0x07); \
-	LEVEL(10, 5, 0x0f); \
-	LEVEL(14, 6, 0x1f); \
-	LEVEL(21, 8, 0x3f); \
-	LEVEL(29, 8, 0x7f); \
-	LEVEL(42, 8, 0xbf); \
-	LEVEL(64, 8, 0xff); \
+	VLI_LEVEL( 2, 1, 0x00); \
+	VLI_LEVEL( 3, 2, 0x01); \
+	VLI_LEVEL( 5, 3, 0x03); \
+	VLI_LEVEL( 7, 4, 0x07); \
+	VLI_LEVEL(10, 5, 0x0f); \
+	VLI_LEVEL(14, 6, 0x1f); \
+	VLI_LEVEL(21, 8, 0x3f); \
+	VLI_LEVEL(29, 8, 0x7f); \
+	VLI_LEVEL(42, 8, 0xbf); \
+	VLI_LEVEL(64, 8, 0xff); \
 	} while (0)

 /* finds a suitable level to decode the least significant part of in.
@@ -147,7 +147,7 @@ static inline int vli_decode_bits(u64 *out, const u64 in)
 {
 	u64 adj = 1;

-#define LEVEL(t,b,v)					\
+#define VLI_LEVEL(t,b,v)				\
 	do {						\
 		if ((in & ((1 << b) -1)) == v) {	\
 			*out = ((in & ((~0ULL) >> (64-t))) >> b) + adj;	\
@@ -160,7 +160,7 @@ static inline int vli_decode_bits(u64 *out, const u64 in)

 	/* NOT REACHED, if VLI_LEVELS code table is defined properly */
 	BUG();
-#undef LEVEL
+#undef VLI_LEVEL
 }

 /* return number of code bits needed,
@@ -173,7 +173,7 @@ static inline int __vli_encode_bits(u64 *out, const u64 in)
 	if (in == 0)
 		return -EINVAL;

-#define LEVEL(t,b,v) do {		\
+#define VLI_LEVEL(t,b,v) do {		\
 		max += 1ULL << (t - b);	\
 		if (in <= max) {	\
 			if (out)	\
@@ -186,7 +186,7 @@ static inline int __vli_encode_bits(u64 *out, const u64 in)
 	VLI_L_1_1();

 	return -EOVERFLOW;
-#undef LEVEL
+#undef VLI_LEVEL
 }

 #undef VLI_L_1_1

                 reply	other threads:[~2019-05-05 22:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190505222327.GA32268@ls3530.dellerweb.de \
    --to=deller@gmx.de \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®