Skip to contentSkip to conversation

m68knommu: Make empty_zero_page "void *", like on m68k

PATCH In review Geert Uytterhoeven 2 participants 6 messages May 25, 2011 – May 26, 2011

Subsystems (2)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

PATCH 3/4 m68knommu: Make empty_zero_page "void *", like on m68k

This allows to get rid of the casts.

---
 arch/m68k/mm/init_no.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/m68k/mm/init_no.c +3 -3
index 7cbd7bd..fdbe679 100644
@@ -42,7 +42,7 @@
  * ZERO_PAGE is a special page that is used for zero-initialized
  * data and COW.
  */
-unsigned long empty_zero_page;
+void *empty_zero_page;
 
 extern unsigned long memory_start;
 extern unsigned long memory_end;
@@ -62,8 +62,8 @@ void __init paging_init(void)
 	unsigned long end_mem   = memory_end & PAGE_MASK;
 	unsigned long zones_size[MAX_NR_ZONES] = {0, };
 
-	empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
-	memset((void *)empty_zero_page, 0, PAGE_SIZE);
+	empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
+	memset(empty_zero_page, 0, PAGE_SIZE);
 
 	/*
 	 * Set up SFC/DFC registers (user data space).
Signature · 1 line
1.7.0.4
author maintainer
#1 lore raw

PATCH 4/4 m68knommu: Fix printk() format in free_initrd_mem()

arch/m68k/mm/init_no.c:123: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’

And use pr_notice() while we're at it.

---
 arch/m68k/mm/init_no.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/m68k/mm/init_no.c +3 -2
index fdbe679..50cd12c 100644
@@ -120,7 +120,8 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 		totalram_pages++;
 		pages++;
 	}
-	printk (KERN_NOTICE "Freeing initrd memory: %dk freed\n", pages * (PAGE_SIZE / 1024));
+	pr_notice("Freeing initrd memory: %luk freed\n",
+		  pages * (PAGE_SIZE / 1024));
 }
 #endif
 
@@ -141,7 +142,7 @@ void free_initmem(void)
 		free_page(addr);
 		totalram_pages++;
 	}
-	printk(KERN_NOTICE "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
+	pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
 			(addr - PAGE_ALIGN((long) &__init_begin)) >> 10,
 			(int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
 			(int)(addr - PAGE_SIZE));
Signature · 1 line
1.7.0.4
Acked-by on v1 4/4
#2 lore raw

Re: [PATCH 4/4] m68knommu: Fix printk() format in free_initrd_mem()

Hi Geert,

Quoted 5 lines · Geert Uytterhoeven

arch/m68k/mm/init_no.c:123: warning: format æ%dÆ expects type æintÆ, but argument 2 has type ælong unsigned intÆ

And use pr_notice() while we're at it.

Regards
Greg

Quoted 27 lines
---
  arch/m68k/mm/init_no.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)
arch/m68k/mm/init_no.c +3 -2
index fdbe679..50cd12c 100644
@@ -120,7 +120,8 @@ void free_initrd_mem(unsigned long start, unsigned long end)
  		totalram_pages++;
  		pages++;
  	}
-	printk (KERN_NOTICE "Freeing initrd memory: %dk freed\n", pages * (PAGE_SIZE / 1024));
+	pr_notice("Freeing initrd memory: %luk freed\n",
+		  pages * (PAGE_SIZE / 1024));
  }
  #endif
 
@@ -141,7 +142,7 @@ void free_initmem(void)
  		free_page(addr);
  		totalram_pages++;
  	}
-	printk(KERN_NOTICE "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
+	pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
  			(addr - PAGE_ALIGN((long)&__init_begin))>>  10,
  			(int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
  			(int)(addr - PAGE_SIZE));
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
Acked-by on v1 3/4
#3 lore raw
In reply to Geert Uytterhoeven

Hi Geert,

Quoted 3 lines · Geert Uytterhoeven

This allows to get rid of the casts.

Looks good:

Do you want me to add to the m68knommu git tree? Or are these part of a series you intend pushing yourself?

Regards
Greg

Quoted 28 lines
---
  arch/m68k/mm/init_no.c |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
arch/m68k/mm/init_no.c +3 -3
index 7cbd7bd..fdbe679 100644
@@ -42,7 +42,7 @@
   * ZERO_PAGE is a special page that is used for zero-initialized
   * data and COW.
   */
-unsigned long empty_zero_page;
+void *empty_zero_page;
 
  extern unsigned long memory_start;
  extern unsigned long memory_end;
@@ -62,8 +62,8 @@ void __init paging_init(void)
  	unsigned long end_mem   = memory_end&  PAGE_MASK;
  	unsigned long zones_size[MAX_NR_ZONES] = {0, };
 
-	empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
-	memset((void *)empty_zero_page, 0, PAGE_SIZE);
+	empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
+	memset(empty_zero_page, 0, PAGE_SIZE);
 
  	/*
  	 * Set up SFC/DFC registers (user data space).
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
author maintainer
#4 lore raw

Hi Greg,

Quoted 11 lines · Greg Ungerer
Quoted 3 lines · Geert Uytterhoeven

This allows to get rid of the casts.

Looks good:

Do you want me to add to the m68knommu git tree? Or are these part of a series you intend pushing yourself?

Please add it to your tree.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#5 lore raw

Hi Geert,

Quoted 8 lines · Geert Uytterhoeven

Hi Greg,

Quoted 5 lines · Greg Ungerer
Quoted 3 lines · Geert Uytterhoeven

This allows to get rid of the casts.

Quoted 8 lines
Quoted 6 lines

Looks good:

Do you want me to add to the m68knommu git tree? Or are these part of a series you intend pushing yourself?

Please add it to your tree.

Done!

Thanks
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com