Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-20 Thread Philipp Hachtmann
Am Fri, 17 Jan 2014 13:38:31 -0800 schrieb Andrew Morton : > Yes, that is a bit of an eyesore. We often approach the problem this > way, which is nicer: > [ ... ] > #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK > { > phys_addr_t size; > > [ ... ] > } > #endif

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-20 Thread Philipp Hachtmann
Am Fri, 17 Jan 2014 13:38:31 -0800 schrieb Andrew Morton a...@linux-foundation.org: Yes, that is a bit of an eyesore. We often approach the problem this way, which is nicer: [ ... ] #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK { phys_addr_t size; [ ... ]

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-17 Thread Andrew Morton
On Thu, 16 Jan 2014 14:33:06 +0100 Philipp Hachtmann wrote: > This fixes an unused variable warning in nobootmem.c > > ... > > --- a/mm/nobootmem.c > +++ b/mm/nobootmem.c > @@ -116,9 +116,13 @@ static unsigned long __init > __free_memory_core(phys_addr_t start, > static unsigned long __init

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-17 Thread Andrew Morton
On Thu, 16 Jan 2014 14:33:06 +0100 Philipp Hachtmann pha...@linux.vnet.ibm.com wrote: This fixes an unused variable warning in nobootmem.c ... --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -116,9 +116,13 @@ static unsigned long __init __free_memory_core(phys_addr_t start, static

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread David Rientjes
On Thu, 16 Jan 2014, Philipp Hachtmann wrote: > diff --git a/mm/nobootmem.c b/mm/nobootmem.c > index e2906a5..12cbb04 100644 > --- a/mm/nobootmem.c > +++ b/mm/nobootmem.c > @@ -116,9 +116,13 @@ static unsigned long __init > __free_memory_core(phys_addr_t start, > static unsigned long __init

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
If the definition of the get_allocated_memblock_reserved_regions_info() function when CONFIG_ARCH_DISCARD_MEMBLOCK simply returns 0, the compiler will see that size is defined, the optimizer will see that it is always 0 and that the if(0) is always false. The net result will be no code will be

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
> I would think you would be better off making > get_allocated_memblock_reserved_regions_info() and > get_allocated_memblock_memory_regions_info be static inline functions > when #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK. Possible, of course. But the size variable has still to be #ifdef'd. And that's

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
Argh. Thought I had changed that to plain text mode before sending. Sorry for the noise, Robin On Thu, Jan 16, 2014 at 9:45 AM, Robin Holt wrote: > > I can not see how this works. How is the return from > get_allocated_memblock_reserved_regions_info() stored and used without being >

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
Since your patch set is the _ONLY_ thing that introduces #ifdef's inside functions within this file, I would think you would be better off making get_allocated_memblock_reserved_regions_info() and get_allocated_memblock_memory_regions_info be static inline functions when #ifdef

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
Hi Robin, > Maybe you are working off a different repo than > Linus' latest? Your line 116 is my 114. Maybe the message needs to > be a bit more descriptive Ah, yes. This fits Andrew's linux-next. Regards Philipp -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

[PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
This fixes an unused variable warning in nobootmem.c Signed-off-by: Philipp Hachtmann --- mm/nobootmem.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/nobootmem.c b/mm/nobootmem.c index e2906a5..12cbb04 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -116,9

[PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
This fixes an unused variable warning in nobootmem.c Signed-off-by: Philipp Hachtmann pha...@linux.vnet.ibm.com --- mm/nobootmem.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/nobootmem.c b/mm/nobootmem.c index e2906a5..12cbb04 100644 --- a/mm/nobootmem.c +++

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
Hi Robin, Maybe you are working off a different repo than Linus' latest? Your line 116 is my 114. Maybe the message needs to be a bit more descriptive Ah, yes. This fits Andrew's linux-next. Regards Philipp -- To unsubscribe from this list: send the line unsubscribe linux-kernel in

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
Since your patch set is the _ONLY_ thing that introduces #ifdef's inside functions within this file, I would think you would be better off making get_allocated_memblock_reserved_regions_info() and get_allocated_memblock_memory_regions_info be static inline functions when #ifdef

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
Argh. Thought I had changed that to plain text mode before sending. Sorry for the noise, Robin On Thu, Jan 16, 2014 at 9:45 AM, Robin Holt robinmh...@gmail.com wrote: I can not see how this works. How is the return from get_allocated_memblock_reserved_regions_info() stored and used without

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Philipp Hachtmann
I would think you would be better off making get_allocated_memblock_reserved_regions_info() and get_allocated_memblock_memory_regions_info be static inline functions when #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK. Possible, of course. But the size variable has still to be #ifdef'd. And that's what

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread Robin Holt
If the definition of the get_allocated_memblock_reserved_regions_info() function when CONFIG_ARCH_DISCARD_MEMBLOCK simply returns 0, the compiler will see that size is defined, the optimizer will see that it is always 0 and that the if(0) is always false. The net result will be no code will be

Re: [PATCH] mm/nobootmem: Fix unused variable

2014-01-16 Thread David Rientjes
On Thu, 16 Jan 2014, Philipp Hachtmann wrote: diff --git a/mm/nobootmem.c b/mm/nobootmem.c index e2906a5..12cbb04 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -116,9 +116,13 @@ static unsigned long __init __free_memory_core(phys_addr_t start, static unsigned long __init