Commit 0e647c04 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

binfmt_flat: warning fixes

Fix this lot:

fs/binfmt_flat.c: In function `decompress_exec':
fs/binfmt_flat.c:293: warning: label `out' defined but not used
fs/binfmt_flat.c: In function `load_flat_file':
fs/binfmt_flat.c:462: warning: unsigned int format, long int arg (arg 3)
fs/binfmt_flat.c:462: warning: unsigned int format, long int arg (arg 4)
fs/binfmt_flat.c:518: warning: comparison of distinct pointer types lacks a cast
fs/binfmt_flat.c:549: warning: passing arg 1 of `ksize' makes pointer from integer without a cast
fs/binfmt_flat.c:601: warning: passing arg 1 of `ksize' makes pointer from integer without a cast
fs/binfmt_flat.c: In function `load_flat_binary':
fs/binfmt_flat.c:116: warning: 'dummy' might be used uninitialized in this function
Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1e9535a5
...@@ -113,7 +113,7 @@ static unsigned long create_flat_tables( ...@@ -113,7 +113,7 @@ static unsigned long create_flat_tables(
char * p = (char*)pp; char * p = (char*)pp;
int argc = bprm->argc; int argc = bprm->argc;
int envc = bprm->envc; int envc = bprm->envc;
char dummy; char uninitialized_var(dummy);
sp = (unsigned long *) ((-(unsigned long)sizeof(char *))&(unsigned long) p); sp = (unsigned long *) ((-(unsigned long)sizeof(char *))&(unsigned long) p);
...@@ -290,7 +290,6 @@ static int decompress_exec( ...@@ -290,7 +290,6 @@ static int decompress_exec(
kfree(buf); kfree(buf);
out_free: out_free:
kfree(strm.workspace); kfree(strm.workspace);
out:
return retval; return retval;
} }
...@@ -459,7 +458,9 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -459,7 +458,9 @@ static int load_flat_file(struct linux_binprm * bprm,
printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename); printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename);
if (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION) { if (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION) {
printk("BINFMT_FLAT: bad flat file version 0x%x (supported 0x%x and 0x%x)\n", rev, FLAT_VERSION, OLD_FLAT_VERSION); printk("BINFMT_FLAT: bad flat file version 0x%x (supported "
"0x%lx and 0x%lx)\n",
rev, FLAT_VERSION, OLD_FLAT_VERSION);
ret = -ENOEXEC; ret = -ENOEXEC;
goto err; goto err;
} }
...@@ -515,7 +516,8 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -515,7 +516,8 @@ static int load_flat_file(struct linux_binprm * bprm,
/* /*
* calculate the extra space we need to map in * calculate the extra space we need to map in
*/ */
extra = max(bss_len + stack_len, relocs * sizeof(unsigned long)); extra = max_t(unsigned long, bss_len + stack_len,
relocs * sizeof(unsigned long));
/* /*
* there are a couple of cases here, the separate code/data * there are a couple of cases here, the separate code/data
...@@ -546,7 +548,7 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -546,7 +548,7 @@ static int load_flat_file(struct linux_binprm * bprm,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0); PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
/* Remap to use all availabe slack region space */ /* Remap to use all availabe slack region space */
if (realdatastart && (realdatastart < (unsigned long)-4096)) { if (realdatastart && (realdatastart < (unsigned long)-4096)) {
reallen = ksize(realdatastart); reallen = ksize((void *)realdatastart);
if (reallen > len) { if (reallen > len) {
realdatastart = do_mremap(realdatastart, len, realdatastart = do_mremap(realdatastart, len,
reallen, MREMAP_FIXED, realdatastart); reallen, MREMAP_FIXED, realdatastart);
...@@ -598,7 +600,7 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -598,7 +600,7 @@ static int load_flat_file(struct linux_binprm * bprm,
PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0); PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
/* Remap to use all availabe slack region space */ /* Remap to use all availabe slack region space */
if (textpos && (textpos < (unsigned long) -4096)) { if (textpos && (textpos < (unsigned long) -4096)) {
reallen = ksize(textpos); reallen = ksize((void *)textpos);
if (reallen > len) { if (reallen > len) {
textpos = do_mremap(textpos, len, reallen, textpos = do_mremap(textpos, len, reallen,
MREMAP_FIXED, textpos); MREMAP_FIXED, textpos);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment