浏览代码

[MIPS] Fix compiler warnings (field width, unused variable)

Fix following warnings:
linux/arch/mips/kernel/setup.c:432: warning: field width is not type int (arg 2)
linux/arch/mips/kernel/setup.c:432: warning: field width is not type int (arg 4)
linux/arch/mips/kernel/syscall.c:279: warning: unused variable `len'
linux/arch/mips/kernel/syscall.c:280: warning: unused variable `name'
linux/arch/mips/math-emu/dp_fint.c:32: warning: unused variable `xc'
linux/arch/mips/math-emu/dp_flong.c:32: warning: unused variable `xc'
linux/arch/mips/math-emu/sp_fint.c:32: warning: unused variable `xc'
linux/arch/mips/math-emu/sp_flong.c:32: warning: unused variable `xc'

(original patch by Atsushi, slight changes to the setup.c part by me.)

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Atsushi Nemoto 19 年之前
父节点
当前提交
ecf52d3c89

+ 8 - 5
arch/mips/kernel/setup.c

@@ -419,17 +419,20 @@ static inline void bootmem_init(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 #ifdef CONFIG_BLK_DEV_INITRD
 	initrd_below_start_ok = 1;
 	initrd_below_start_ok = 1;
 	if (initrd_start) {
 	if (initrd_start) {
-		unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start);
+		unsigned long initrd_size = ((unsigned char *)initrd_end) -
+			((unsigned char *)initrd_start);
+		const int width = sizeof(long) * 2;
+
 		printk("Initial ramdisk at: 0x%p (%lu bytes)\n",
 		printk("Initial ramdisk at: 0x%p (%lu bytes)\n",
 		       (void *)initrd_start, initrd_size);
 		       (void *)initrd_start, initrd_size);
 
 
 		if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) {
 		if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) {
 			printk("initrd extends beyond end of memory "
 			printk("initrd extends beyond end of memory "
 			       "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n",
 			       "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n",
-			       sizeof(long) * 2,
-			       (unsigned long long)CPHYSADDR(initrd_end),
-			       sizeof(long) * 2,
-			       (unsigned long long)PFN_PHYS(max_low_pfn));
+			       width,
+			       (unsigned long long) CPHYSADDR(initrd_end),
+			       width,
+			       (unsigned long long) PFN_PHYS(max_low_pfn));
 			initrd_start = initrd_end = 0;
 			initrd_start = initrd_end = 0;
 			initrd_reserve_bootmem = 0;
 			initrd_reserve_bootmem = 0;
 		}
 		}

+ 1 - 2
arch/mips/kernel/syscall.c

@@ -276,8 +276,7 @@ void sys_set_thread_area(unsigned long addr)
 
 
 asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
 asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
 {
 {
-	int	tmp, len;
-	char	__user *name;
+	int	tmp;
 
 
 	switch(cmd) {
 	switch(cmd) {
 	case MIPS_ATOMIC_SET:
 	case MIPS_ATOMIC_SET:

+ 3 - 1
arch/mips/math-emu/dp_fint.c

@@ -29,7 +29,9 @@
 
 
 ieee754dp ieee754dp_fint(int x)
 ieee754dp ieee754dp_fint(int x)
 {
 {
-	COMPXDP;
+	u64 xm;
+	int xe;
+	int xs;
 
 
 	CLEARCX;
 	CLEARCX;
 
 

+ 3 - 1
arch/mips/math-emu/dp_flong.c

@@ -29,7 +29,9 @@
 
 
 ieee754dp ieee754dp_flong(s64 x)
 ieee754dp ieee754dp_flong(s64 x)
 {
 {
-	COMPXDP;
+	u64 xm;
+	int xe;
+	int xs;
 
 
 	CLEARCX;
 	CLEARCX;
 
 

+ 3 - 1
arch/mips/math-emu/sp_fint.c

@@ -29,7 +29,9 @@
 
 
 ieee754sp ieee754sp_fint(int x)
 ieee754sp ieee754sp_fint(int x)
 {
 {
-	COMPXSP;
+	unsigned xm;
+	int xe;
+	int xs;
 
 
 	CLEARCX;
 	CLEARCX;
 
 

+ 3 - 1
arch/mips/math-emu/sp_flong.c

@@ -29,7 +29,9 @@
 
 
 ieee754sp ieee754sp_flong(s64 x)
 ieee754sp ieee754sp_flong(s64 x)
 {
 {
-	COMPXDP;		/* <--- need 64-bit mantissa temp */
+	u64 xm;		/* <--- need 64-bit mantissa temp */
+	int xe;
+	int xs;
 
 
 	CLEARCX;
 	CLEARCX;