linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/bootmem.c: remove unused 'limit' variable
@ 2013-11-21 21:43 Luiz Capitulino
  2013-11-21 22:05 ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Capitulino @ 2013-11-21 21:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm, akpm


Signed-off-by: Luiz capitulino <lcapitulino@redhat.com>
---
 mm/bootmem.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/mm/bootmem.c b/mm/bootmem.c
index 90bd350..31d303e 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -655,9 +655,7 @@ restart:
 void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
 					unsigned long goal)
 {
-	unsigned long limit = 0;
-
-	return ___alloc_bootmem_nopanic(size, align, goal, limit);
+	return ___alloc_bootmem_nopanic(size, align, goal, 0);
 }
 
 static void * __init ___alloc_bootmem(unsigned long size, unsigned long align,
@@ -691,9 +689,7 @@ static void * __init ___alloc_bootmem(unsigned long size, unsigned long align,
 void * __init __alloc_bootmem(unsigned long size, unsigned long align,
 			      unsigned long goal)
 {
-	unsigned long limit = 0;
-
-	return ___alloc_bootmem(size, align, goal, limit);
+	return ___alloc_bootmem(size, align, goal, 0);
 }
 
 void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm/bootmem.c: remove unused 'limit' variable
  2013-11-21 21:43 [PATCH] mm/bootmem.c: remove unused 'limit' variable Luiz Capitulino
@ 2013-11-21 22:05 ` Dave Hansen
  2013-11-22  1:37   ` Luiz Capitulino
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2013-11-21 22:05 UTC (permalink / raw)
  To: Luiz Capitulino, linux-kernel; +Cc: linux-mm, akpm

On 11/21/2013 01:43 PM, Luiz Capitulino wrote:
> @@ -655,9 +655,7 @@ restart:
>  void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
>  					unsigned long goal)
>  {
> -	unsigned long limit = 0;
> -
> -	return ___alloc_bootmem_nopanic(size, align, goal, limit);
> +	return ___alloc_bootmem_nopanic(size, align, goal, 0);
>  }

FWIW, I like those.  The way you leave it:

	return ___alloc_bootmem_nopanic(size, align, goal, 0);

the 0 is a magic number that you have to go look up the declaration of
___alloc_bootmem_nopanic() to decipher, or you have to add a comment to
it in some way.

I find it much more readable to have an 'unused' variable like that.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm/bootmem.c: remove unused 'limit' variable
  2013-11-21 22:05 ` Dave Hansen
@ 2013-11-22  1:37   ` Luiz Capitulino
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Capitulino @ 2013-11-22  1:37 UTC (permalink / raw)
  To: Dave Hansen; +Cc: linux-kernel, linux-mm, akpm

On Thu, 21 Nov 2013 14:05:42 -0800
Dave Hansen <dave.hansen@intel.com> wrote:

> On 11/21/2013 01:43 PM, Luiz Capitulino wrote:
> > @@ -655,9 +655,7 @@ restart:
> >  void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
> >  					unsigned long goal)
> >  {
> > -	unsigned long limit = 0;
> > -
> > -	return ___alloc_bootmem_nopanic(size, align, goal, limit);
> > +	return ___alloc_bootmem_nopanic(size, align, goal, 0);
> >  }
> 
> FWIW, I like those.  The way you leave it:
> 
> 	return ___alloc_bootmem_nopanic(size, align, goal, 0);
> 
> the 0 is a magic number that you have to go look up the declaration of
> ___alloc_bootmem_nopanic() to decipher, or you have to add a comment to
> it in some way.
> 
> I find it much more readable to have an 'unused' variable like that.

Got it. I was reading that code and thought 'limit' was a leftover,
so I posted the patch...

Btw, I also have a patch consitfying some zone access functions
parameters that are read-only. Wondering if anyone will object
to such a change? Or maybe I should just stop doing trivial patches :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-11-22  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 21:43 [PATCH] mm/bootmem.c: remove unused 'limit' variable Luiz Capitulino
2013-11-21 22:05 ` Dave Hansen
2013-11-22  1:37   ` Luiz Capitulino

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