* [PATCH 0/2] openrisc: mm/init.c: fix compilation warnings @ 2021-05-09 9:11 Mike Rapoport 2021-05-09 9:11 ` [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() Mike Rapoport 2021-05-09 9:11 ` [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() Mike Rapoport 0 siblings, 2 replies; 5+ messages in thread From: Mike Rapoport @ 2021-05-09 9:11 UTC (permalink / raw) To: Stafford Horne Cc: Jonas Bonn, Stefan Kristiansson, Mike Rapoport, Mike Rapoport, openrisc, linux-kernel From: Mike Rapoport <rppt@linux.ibm.com> Hi, Kbuld test bot reported an unused in map_ram() and while on it I've found another compilation warning about unused variable in paging_init(). Here are the fixes for both. The patches are vs 5.12. Mike Rapoport (2): openrisc: mm/init.c: remove unused memblock_region variable in map_ram() openrisc: mm/init.c: remove unused variable 'end' in paging_init() arch/openrisc/mm/init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) base-commit: 9f4ad9e425a1d3b6a34617b8ea226d56a119a717 -- 2.28.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() 2021-05-09 9:11 [PATCH 0/2] openrisc: mm/init.c: fix compilation warnings Mike Rapoport @ 2021-05-09 9:11 ` Mike Rapoport 2021-05-09 21:17 ` Stafford Horne 2021-05-09 9:11 ` [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() Mike Rapoport 1 sibling, 1 reply; 5+ messages in thread From: Mike Rapoport @ 2021-05-09 9:11 UTC (permalink / raw) To: Stafford Horne Cc: Jonas Bonn, Stefan Kristiansson, Mike Rapoport, Mike Rapoport, openrisc, linux-kernel, kernel test robot From: Mike Rapoport <rppt@linux.ibm.com> Kernel test robot reports: cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> arch/openrisc/mm/init.c:125:10: warning: Uninitialized variable: region [uninitvar] region->base, region->base + region->size); ^ Replace usage of memblock_region fields with 'start' and 'end' variables that are initialized in for_each_mem_range() and remove the declaration of region. Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> --- arch/openrisc/mm/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index bf9b2310fc93..f3fa02b8838a 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -75,7 +75,6 @@ static void __init map_ram(void) /* These mark extents of read-only kernel pages... * ...from vmlinux.lds.S */ - struct memblock_region *region; v = PAGE_OFFSET; @@ -121,7 +120,7 @@ static void __init map_ram(void) } printk(KERN_INFO "%s: Memory: 0x%x-0x%x\n", __func__, - region->base, region->base + region->size); + start, end); } } -- 2.28.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() 2021-05-09 9:11 ` [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() Mike Rapoport @ 2021-05-09 21:17 ` Stafford Horne 0 siblings, 0 replies; 5+ messages in thread From: Stafford Horne @ 2021-05-09 21:17 UTC (permalink / raw) To: Mike Rapoport Cc: Jonas Bonn, Stefan Kristiansson, Mike Rapoport, openrisc, linux-kernel, kernel test robot On Sun, May 09, 2021 at 12:11:02PM +0300, Mike Rapoport wrote: > From: Mike Rapoport <rppt@linux.ibm.com> > > Kernel test robot reports: > > cppcheck possible warnings: (new ones prefixed by >>, may not real problems) > > >> arch/openrisc/mm/init.c:125:10: warning: Uninitialized variable: region [uninitvar] > region->base, region->base + region->size); > ^ > > Replace usage of memblock_region fields with 'start' and 'end' variables > that are initialized in for_each_mem_range() and remove the declaration of > region. > > Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()") > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> > --- > arch/openrisc/mm/init.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c > index bf9b2310fc93..f3fa02b8838a 100644 > --- a/arch/openrisc/mm/init.c > +++ b/arch/openrisc/mm/init.c > @@ -75,7 +75,6 @@ static void __init map_ram(void) > /* These mark extents of read-only kernel pages... > * ...from vmlinux.lds.S > */ > - struct memblock_region *region; > > v = PAGE_OFFSET; > > @@ -121,7 +120,7 @@ static void __init map_ram(void) > } > > printk(KERN_INFO "%s: Memory: 0x%x-0x%x\n", __func__, > - region->base, region->base + region->size); > + start, end); > } > } Thanks I will queue this. -Stafford ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() 2021-05-09 9:11 [PATCH 0/2] openrisc: mm/init.c: fix compilation warnings Mike Rapoport 2021-05-09 9:11 ` [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() Mike Rapoport @ 2021-05-09 9:11 ` Mike Rapoport 2021-05-09 21:18 ` Stafford Horne 1 sibling, 1 reply; 5+ messages in thread From: Mike Rapoport @ 2021-05-09 9:11 UTC (permalink / raw) To: Stafford Horne Cc: Jonas Bonn, Stefan Kristiansson, Mike Rapoport, Mike Rapoport, openrisc, linux-kernel From: Mike Rapoport <rppt@linux.ibm.com> A build with W=1 enabled produces the following warning: CC arch/openrisc/mm/init.o arch/openrisc/mm/init.c: In function 'paging_init': arch/openrisc/mm/init.c:131:16: warning: variable 'end' set but not used [-Wunused-but-set-variable] 131 | unsigned long end; | ^~~ Remove the unused variable 'end'. Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> --- arch/openrisc/mm/init.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index f3fa02b8838a..6e38ec96cab8 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -128,7 +128,6 @@ void __init paging_init(void) { extern void tlb_init(void); - unsigned long end; int i; printk(KERN_INFO "Setting up paging and PTEs.\n"); @@ -144,8 +143,6 @@ void __init paging_init(void) */ current_pgd[smp_processor_id()] = init_mm.pgd; - end = (unsigned long)__va(max_low_pfn * PAGE_SIZE); - map_ram(); zone_sizes_init(); -- 2.28.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() 2021-05-09 9:11 ` [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() Mike Rapoport @ 2021-05-09 21:18 ` Stafford Horne 0 siblings, 0 replies; 5+ messages in thread From: Stafford Horne @ 2021-05-09 21:18 UTC (permalink / raw) To: Mike Rapoport Cc: Jonas Bonn, Stefan Kristiansson, Mike Rapoport, openrisc, linux-kernel On Sun, May 09, 2021 at 12:11:03PM +0300, Mike Rapoport wrote: > From: Mike Rapoport <rppt@linux.ibm.com> > > A build with W=1 enabled produces the following warning: > > CC arch/openrisc/mm/init.o > arch/openrisc/mm/init.c: In function 'paging_init': > arch/openrisc/mm/init.c:131:16: warning: variable 'end' set but not used [-Wunused-but-set-variable] > 131 | unsigned long end; > | ^~~ > > Remove the unused variable 'end'. > > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> > --- > arch/openrisc/mm/init.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c > index f3fa02b8838a..6e38ec96cab8 100644 > --- a/arch/openrisc/mm/init.c > +++ b/arch/openrisc/mm/init.c > @@ -128,7 +128,6 @@ void __init paging_init(void) > { > extern void tlb_init(void); > > - unsigned long end; > int i; > > printk(KERN_INFO "Setting up paging and PTEs.\n"); > @@ -144,8 +143,6 @@ void __init paging_init(void) > */ > current_pgd[smp_processor_id()] = init_mm.pgd; > > - end = (unsigned long)__va(max_low_pfn * PAGE_SIZE); > - > map_ram(); > > zone_sizes_init(); Thanks, I will queue this in the openrisc fixes queue. -Stafford ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-09 21:18 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-05-09 9:11 [PATCH 0/2] openrisc: mm/init.c: fix compilation warnings Mike Rapoport 2021-05-09 9:11 ` [PATCH 1/2] openrisc: mm/init.c: remove unused memblock_region variable in map_ram() Mike Rapoport 2021-05-09 21:17 ` Stafford Horne 2021-05-09 9:11 ` [PATCH 2/2] openrisc: mm/init.c: remove unused variable 'end' in paging_init() Mike Rapoport 2021-05-09 21:18 ` Stafford Horne
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox