All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH -next v3] arm64: mm: Fix unused variable warning in zone_sizes_init
Date: Wed, 16 Oct 2019 07:47:14 -0700	[thread overview]
Message-ID: <20191016144713.23792-1-natechancellor@gmail.com> (raw)
In-Reply-To: <20191016031107.30045-1-natechancellor@gmail.com>

When building arm64 allnoconfig, CONFIG_ZONE_DMA and CONFIG_ZONE_DMA32
get disabled so there is a warning about max_dma being unused.

../arch/arm64/mm/init.c:215:16: warning: unused variable 'max_dma'
[-Wunused-variable]
        unsigned long max_dma = min;
                      ^
1 warning generated.

Add __maybe_unused to make this clear to the compiler.

Fixes: 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

v1 -> v2:

* Fix check for CONFIG_ZONE_DMA32 as pointed out by Will.

v2 -> v3:

* Use __maybe_unused attribute instead of preprocessor ifdefs
  to conform to section 21 of the coding style as pointed out by
  Catalin.

 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 44f07fdf7a59..71b45c58218b 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -212,7 +212,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 	struct memblock_region *reg;
 	unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
 	unsigned long max_dma32 = min;
-	unsigned long max_dma = min;
+	unsigned long __maybe_unused max_dma = min;
 
 	memset(zone_size, 0, sizeof(zone_size));
 
-- 
2.23.0


WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <natechancellor@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH -next v3] arm64: mm: Fix unused variable warning in zone_sizes_init
Date: Wed, 16 Oct 2019 07:47:14 -0700	[thread overview]
Message-ID: <20191016144713.23792-1-natechancellor@gmail.com> (raw)
In-Reply-To: <20191016031107.30045-1-natechancellor@gmail.com>

When building arm64 allnoconfig, CONFIG_ZONE_DMA and CONFIG_ZONE_DMA32
get disabled so there is a warning about max_dma being unused.

../arch/arm64/mm/init.c:215:16: warning: unused variable 'max_dma'
[-Wunused-variable]
        unsigned long max_dma = min;
                      ^
1 warning generated.

Add __maybe_unused to make this clear to the compiler.

Fixes: 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

v1 -> v2:

* Fix check for CONFIG_ZONE_DMA32 as pointed out by Will.

v2 -> v3:

* Use __maybe_unused attribute instead of preprocessor ifdefs
  to conform to section 21 of the coding style as pointed out by
  Catalin.

 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 44f07fdf7a59..71b45c58218b 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -212,7 +212,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 	struct memblock_region *reg;
 	unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
 	unsigned long max_dma32 = min;
-	unsigned long max_dma = min;
+	unsigned long __maybe_unused max_dma = min;
 
 	memset(zone_size, 0, sizeof(zone_size));
 
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-10-16 14:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 22:43 [PATCH -next] arm64: mm: Fix unused variable warning in zone_sizes_init Nathan Chancellor
2019-10-15 22:43 ` Nathan Chancellor
2019-10-16  3:00 ` Will Deacon
2019-10-16  3:00   ` Will Deacon
2019-10-16  3:08   ` Nathan Chancellor
2019-10-16  3:08     ` Nathan Chancellor
2019-10-16  3:11 ` [PATCH -next v2] " Nathan Chancellor
2019-10-16  3:11   ` Nathan Chancellor
2019-10-16  8:54   ` Nicolas Saenz Julienne
2019-10-16  8:54     ` Nicolas Saenz Julienne
2019-10-16 14:40   ` Catalin Marinas
2019-10-16 14:40     ` Catalin Marinas
2019-10-16 14:47   ` Nathan Chancellor [this message]
2019-10-16 14:47     ` [PATCH -next v3] " Nathan Chancellor
2019-10-16 15:08     ` Catalin Marinas
2019-10-16 15:08       ` Catalin Marinas
2019-10-16 15:09       ` Nicolas Saenz Julienne
2019-10-16 15:09         ` Nicolas Saenz Julienne
2019-10-16 15:51         ` Nathan Chancellor
2019-10-16 15:51           ` Nathan Chancellor

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=20191016144713.23792-1-natechancellor@gmail.com \
    --to=natechancellor@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.