binfmt_flat: Use %u to format u32
Subsystems (3)
Geert Uytterhoeven
maintainerPATCH 1/3 binfmt_flat: Use %u to format u32
Several variables had their types changed from unsigned long to u32, but the printk()-style format to print them wasn't updated, leading to:
fs/binfmt_flat.c: In function ‘load_flat_file’:
fs/binfmt_flat.c:577: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘u32’
--- fs/binfmt_flat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_flat.c +1 -1
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm *bprm, MAX_SHARED_LIBS * sizeof(unsigned long), FLAT_DATA_ALIGN); -pr_debug ("Allocated data+bss+stack (%ld bytes): %lx\n" , +pr_debug ("Allocated data+bss+stack (%u bytes): %lx\n" , data_len + bss_len + stack_len, datapos); fpos =ntohl (hdr->data_start);
Signature · 1 line
2.7.4
Geert Uytterhoeven
maintainerPATCH 2/3 blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes
Several variables had their types changed from unsigned long to u32, but the arch-specific implementations of flat_set_persistent() weren't updated, leading to compiler warnings on blackfin and m68k:
fs/binfmt_flat.c: In function ‘load_flat_file’:
fs/binfmt_flat.c:799: warning: passing argument 2 of ‘flat_set_persistent’ from incompatible pointer type
--- arch/blackfin/include/asm/flat.h | 3 +-- arch/m68k/include/asm/flat.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/blackfin/include/asm/flat.h +1 -2
@@ -44,8 +44,7 @@ flat_get_relocate_addr (unsigned long relval)return relval &0x03ffffff ;/* Mask out top 6 bits */ } -static inline int flat_set_persistent (unsigned long relval, -unsigned long *persistent) +static inline int flat_set_persistent (u32 relval,u32 *persistent) {int type = (relval >>26 ) &7 ;if (type ==3 ) {
arch/m68k/include/asm/flat.h +1 -2
@@ -30,8 +30,7 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel) }#define flat_get_relocate_addr (rel) (rel) -static inline int flat_set_persistent (unsigned long relval, -unsigned long *persistent) +static inline int flat_set_persistent (u32 relval,u32 *persistent) {return 0 ; }
Signature · 1 line
2.7.4
Geert Uytterhoeven
maintainerPATCH 2/3 blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes
In reply to Geert UytterhoevenSeveral variables had their types changed from unsigned long to u32, but the arch-specific implementations of flat_set_persistent() weren't updated, leading to compiler warnings on blackfin and m68k:
fs/binfmt_flat.c: In function ‘load_flat_file’:
fs/binfmt_flat.c:799: warning: passing argument 2 of ‘flat_set_persistent’ from incompatible pointer type
--- arch/blackfin/include/asm/flat.h | 3 +-- arch/m68k/include/asm/flat.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/blackfin/include/asm/flat.h +1 -2
@@ -44,8 +44,7 @@ flat_get_relocate_addr (unsigned long relval)return relval &0x03ffffff ;/* Mask out top 6 bits */ } -static inline int flat_set_persistent (unsigned long relval, -unsigned long *persistent) +static inline int flat_set_persistent (u32 relval,u32 *persistent) {int type = (relval >>26 ) &7 ;if (type ==3 ) {
arch/m68k/include/asm/flat.h +1 -2
@@ -30,8 +30,7 @@ static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel) }#define flat_get_relocate_addr (rel) (rel) -static inline int flat_set_persistent (unsigned long relval, -unsigned long *persistent) +static inline int flat_set_persistent (u32 relval,u32 *persistent) {return 0 ; }
Signature · 1 line
2.7.4
Geert Uytterhoeven
maintainerPATCH 3/3 h8300: Add missing closing parenthesis in flat_get_addr_from_rp()
In reply to Geert UytterhoevenIn file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h: In function 'flat_get_addr_from_rp':arch/h8300/include/asm/flat.h:28:3: error: expected ')' before 'val'
val &= 0x00ffffff;
^arch/h8300/include/asm/flat.h:31:1: error: expected expression before '}' token
}
^
In file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h:26:6: warning: unused variable 'val' [-Wunused-variable]
u32 val = get_unaligned((__force u32 *)rp);
^
In file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:arch/h8300/include/asm/flat.h:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
--- arch/h8300/include/asm/flat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/h8300/include/asm/flat.h +1 -1
@@ -24,7 +24,7 @@ static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, u32 *addr, u32 *persistent) {u32 val =get_unaligned ((__force u32 *)rp); - if (!(flags & FLAT_FLAG_GOTPIC) +if (!(flags &FLAT_FLAG_GOTPIC )) val &=0x00ffffff ; *addr = val;return 0 ;
Signature · 1 line
2.7.4
Geert Uytterhoeven
maintainerPATCH 3/3 h8300: Add missing closing parenthesis in flat_get_addr_from_rp()
In reply to Geert UytterhoevenIn file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h: In function 'flat_get_addr_from_rp':arch/h8300/include/asm/flat.h:28:3: error: expected ')' before 'val'
val &= 0x00ffffff;
^arch/h8300/include/asm/flat.h:31:1: error: expected expression before '}' token
}
^
In file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h:26:6: warning: unused variable 'val' [-Wunused-variable]
u32 val = get_unaligned((__force u32 *)rp);
^
In file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:arch/h8300/include/asm/flat.h:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
--- arch/h8300/include/asm/flat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/h8300/include/asm/flat.h +1 -1
@@ -24,7 +24,7 @@ static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, u32 *addr, u32 *persistent) {u32 val =get_unaligned ((__force u32 *)rp); - if (!(flags & FLAT_FLAG_GOTPIC) +if (!(flags &FLAT_FLAG_GOTPIC )) val &=0x00ffffff ; *addr = val;return 0 ;
Signature · 1 line
2.7.4