[PATCH resend] binfmt_em86: load_em86: Remove unused i_arg variable and constify i_name
From: Daniel Wagner <hidden>
Date: 2016-02-17 12:57:09
Also in:
linux-fsdevel, lkml
Subsystem:
exec & binfmt api, elf, filesystems (vfs and infrastructure), the rest · Maintainers:
Kees Cook, Alexander Viro, Christian Brauner, Linus Torvalds
i_arg is not used at all therefore remove it. This also prevents a warning with gcc 5.2 when -Wincompatible-pointer-types is enabled: fs/binfmt_em86.c:73:35: warning: passing argument 2 of ‘copy_strings_kernel’ from incompatible pointer type [-Werror=incompatible-pointer-types] retval = copy_strings_kernel(1, &i_arg, bprm); The second error would come from i_name which is defined as char pointer without the const attribute. fs/binfmt_em86.c:71:34: warning: passing argument 2 of ‘copy_strings_kernel’ from incompatible pointer type [-Werror=incompatible-pointer-types] retval = copy_strings_kernel(1, &i_name, bprm); While at it, check the remove_arg_zero return value too. fs/binfmt_em86.c:68:2: warning: ignoring return value of ‘remove_arg_zero’, declared with attribute warn_unused_result [-Wunused-result] remove_arg_zero(bprm); ^ Signed-off-by: Daniel Wagner <redacted> --- I forgot to Cc the linux-alpha list and Cc also the alpha arch maintainers... 2nd try. fs/binfmt_em86.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/binfmt_em86.c b/fs/binfmt_em86.c
index 4905385..bc8fff2 100644
--- a/fs/binfmt_em86.c
+++ b/fs/binfmt_em86.c@@ -24,7 +24,8 @@ static int load_em86(struct linux_binprm *bprm) { - char *interp, *i_name, *i_arg; + const char *i_name; + char *interp; struct file * file; int retval; struct elfhdr elf_ex;
@@ -55,7 +56,6 @@ static int load_em86(struct linux_binprm *bprm) */ interp = EM86_INTERP; i_name = EM86_I_NAME; - i_arg = NULL; /* We reserve the right to add an arg later */ /* * Splice in (1) the interpreter's name for argv[0]
@@ -65,15 +65,11 @@ static int load_em86(struct linux_binprm *bprm) * This is done in reverse order, because of how the * user environment and arguments are stored. */ - remove_arg_zero(bprm); + retval = remove_arg_zero(bprm); + if (retval < 0) return retval; retval = copy_strings_kernel(1, &bprm->filename, bprm); if (retval < 0) return retval; bprm->argc++; - if (i_arg) { - retval = copy_strings_kernel(1, &i_arg, bprm); - if (retval < 0) return retval; - bprm->argc++; - } retval = copy_strings_kernel(1, &i_name, bprm); if (retval < 0) return retval; bprm->argc++;
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html