linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memremap: Remove unused align_* variables
@ 2016-12-08  7:42 Kirtika Ruchandani
  2016-12-08 17:10 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Kirtika Ruchandani @ 2016-12-08  7:42 UTC (permalink / raw)
  To: dan.j.williams; +Cc: Kirtika Ruchandani, arnd, Andrew Morton, linux-kernel

Commit eb7d78c9e7f6 introduced align_start, align_size and align_end
variables in pgmap_radix_release() but did not use them.
Compiling with W=1 gives the following harmless warning, fix it to
reduce the noise with W=1 in the kernel.

kernel/memremap.c: In function ‘pgmap_radix_release’:
kernel/memremap.c:199:48: warning: variable ‘align_end’ set but not used [-Wunused-but-set-variable]

The call to resource_size has no side-effects and is safe to remove.

Fixes: eb7d78c9e7f6 ("devm_memremap_pages: fix vmem_altmap lifetime + alignment handling")
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Kirtika Ruchandani <kirtika@chromium.org>
---
 kernel/memremap.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/memremap.c b/kernel/memremap.c
index b501e39..8dde681 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -196,11 +196,7 @@ EXPORT_SYMBOL(put_zone_device_page);

 static void pgmap_radix_release(struct resource *res)
 {
-	resource_size_t key, align_start, align_size, align_end;
-
-	align_start = res->start & ~(SECTION_SIZE - 1);
-	align_size = ALIGN(resource_size(res), SECTION_SIZE);
-	align_end = align_start + align_size - 1;
+	resource_size_t key;

	mutex_lock(&pgmap_lock);
	for (key = res->start; key <= res->end; key += SECTION_SIZE)
--
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] memremap: Remove unused align_* variables
  2016-12-08  7:42 [PATCH] memremap: Remove unused align_* variables Kirtika Ruchandani
@ 2016-12-08 17:10 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2016-12-08 17:10 UTC (permalink / raw)
  To: Kirtika Ruchandani; +Cc: Arnd Bergmann, Andrew Morton, linux-kernel

On Wed, Dec 7, 2016 at 11:42 PM, Kirtika Ruchandani
<kirtika@chromium.org> wrote:
> Commit eb7d78c9e7f6 introduced align_start, align_size and align_end
> variables in pgmap_radix_release() but did not use them.
> Compiling with W=1 gives the following harmless warning, fix it to
> reduce the noise with W=1 in the kernel.
>
> kernel/memremap.c: In function ‘pgmap_radix_release’:
> kernel/memremap.c:199:48: warning: variable ‘align_end’ set but not used [-Wunused-but-set-variable]
>
> The call to resource_size has no side-effects and is safe to remove.
>
> Fixes: eb7d78c9e7f6 ("devm_memremap_pages: fix vmem_altmap lifetime + alignment handling")
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Kirtika Ruchandani <kirtika@chromium.org>

Thanks for the fix, however I'm already addressing this as a side effect of:

    https://lkml.org/lkml/2016/12/1/726

I'm in the process of posting v2 of that patch.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-08 17:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08  7:42 [PATCH] memremap: Remove unused align_* variables Kirtika Ruchandani
2016-12-08 17:10 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).