From patchwork Wed Feb 17 12:57:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 8338521 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C39AC02AA for ; Wed, 17 Feb 2016 12:58:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DAEF20383 for ; Wed, 17 Feb 2016 12:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A54C020376 for ; Wed, 17 Feb 2016 12:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161522AbcBQM6H (ORCPT ); Wed, 17 Feb 2016 07:58:07 -0500 Received: from mail.bmw-carit.de ([62.245.222.98]:46785 "EHLO linuxmail.bmw-carit.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161345AbcBQM6G (ORCPT ); Wed, 17 Feb 2016 07:58:06 -0500 Received: from localhost (handman.bmw-carit.intra [192.168.101.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linuxmail.bmw-carit.de (Postfix) with ESMTPS id 563D25EB09; Wed, 17 Feb 2016 13:40:30 +0100 (CET) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: linux-alpha@vger.kernel.org, linux-fsdevel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexander Viro , Daniel Wagner Subject: [PATCH resend] binfmt_em86: load_em86: Remove unused i_arg variable and constify i_name Date: Wed, 17 Feb 2016 13:57:09 +0100 Message-Id: <1455713829-9856-1-git-send-email-daniel.wagner@bmw-carit.de> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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++;