Received: by 10.213.65.68 with SMTP id h4csp428775imn; Tue, 13 Mar 2018 08:46:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELuSmKkSCL3/TF4dT2+tUkZWMf/C9UOTvui+2aifNKXQqYGN864AQgtBnfqHz5Qu8zJXFfnR X-Received: by 10.98.76.26 with SMTP id z26mr1071174pfa.220.1520955986016; Tue, 13 Mar 2018 08:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520955985; cv=none; d=google.com; s=arc-20160816; b=tCiLkYeRADSfZ5GCP1ytNzuDSO1SyTDwnN2D5aXKstG92THWkvfXJQmcgWxEK0ynq2 NE3u9qIjbfgoPbvttq80p1aNNuiNA80Ji8ImUuoRNpigpQV6Jh9IcnDz44g7IF6B3Gin OWdBlOwhoJg3Lrs9sO7q3bVX6rn7nFsE+ZkpQN+BoQwMk2XrzyZ8+y64D8/fUrVLVIiq xtE7vCnliRfIL3PIlz/L8DJZZhb86Muc00+tEWl2alkaV+3OrqtMYkGc7SoKckUnQilQ 3mXZfXpXH8xqBUbY5Wh34el/g4HFFHUGpho74EQezEybAFKSUJE/WKIZ7NCSsiV+O29k uhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=o3zv9hpt4s/bGOyCOb7IZHaUdGghaWoRpCyDt92jLsg=; b=DAO7yDoo9rU8bqi0hRymX8OzfkLlNRmDRAyKROhXu34TjDlvn/H5Lpr9YzAPI046dM /skkJgfcMhH/JoHYhBn3svhidBTIVa8YhcWJb7Se8OSpuiAp8tHMkqABLS14lQm/E5T7 9BOQZgUcD/pucpT/YfIOy7YD+U157Za+l45DC9FGLXLnZe0NJzcXnwzZnYJcUuupd6RP B1N/wMCPRv1ppo0VfFfBrm6U6fHXBR2gK4NLSCMQbvnOh8b0CsN4qzFq5lpOkFLoQkDF GJBP8UweU9wXObhk+qSoLmsYIeiibXpAqcy1gpOxFsTWOapFPOOaT60RKI6QrNPQiJ/J W2DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si257000pga.503.2018.03.13.08.46.11; Tue, 13 Mar 2018 08:46:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964881AbeCMPoh (ORCPT + 99 others); Tue, 13 Mar 2018 11:44:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37004 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935005AbeCMPle (ORCPT ); Tue, 13 Mar 2018 11:41:34 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B37B1218; Tue, 13 Mar 2018 15:41:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Thomas Gleixner , Josh Poimboeuf , Andy Lutomirski , Arjan van de Ven , Borislav Petkov , Dan Williams , Dave Hansen , David Woodhouse , Linus Torvalds , Ingo Molnar Subject: [PATCH 4.14 131/140] objtool: Use existing global variables for options Date: Tue, 13 Mar 2018 16:25:34 +0100 Message-Id: <20180313152506.977582248@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Zijlstra commit 43a4525f80534530077683f6472d8971646b0ace upstream. Use the existing global variables instead of passing them around and creating duplicate global variables. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Thomas Gleixner Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Dan Williams Cc: Dave Hansen Cc: David Woodhouse Cc: Greg Kroah-Hartman Cc: Linus Torvalds Cc: Peter Zijlstra Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/objtool/builtin-check.c | 2 +- tools/objtool/builtin-orc.c | 6 +----- tools/objtool/builtin.h | 5 +++++ tools/objtool/check.c | 5 ++--- tools/objtool/check.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -53,5 +53,5 @@ int cmd_check(int argc, const char **arg objname = argv[0]; - return check(objname, no_fp, no_unreachable, false); + return check(objname, false); } --- a/tools/objtool/builtin-orc.c +++ b/tools/objtool/builtin-orc.c @@ -25,7 +25,6 @@ */ #include -#include #include "builtin.h" #include "check.h" @@ -36,9 +35,6 @@ static const char *orc_usage[] = { NULL, }; -extern const struct option check_options[]; -extern bool no_fp, no_unreachable; - int cmd_orc(int argc, const char **argv) { const char *objname; @@ -54,7 +50,7 @@ int cmd_orc(int argc, const char **argv) objname = argv[0]; - return check(objname, no_fp, no_unreachable, true); + return check(objname, true); } if (!strcmp(argv[0], "dump")) { --- a/tools/objtool/builtin.h +++ b/tools/objtool/builtin.h @@ -17,6 +17,11 @@ #ifndef _BUILTIN_H #define _BUILTIN_H +#include + +extern const struct option check_options[]; +extern bool no_fp, no_unreachable; + extern int cmd_check(int argc, const char **argv); extern int cmd_orc(int argc, const char **argv); --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -18,6 +18,7 @@ #include #include +#include "builtin.h" #include "check.h" #include "elf.h" #include "special.h" @@ -33,7 +34,6 @@ struct alternative { }; const char *objname; -static bool no_fp; struct cfi_state initial_func_cfi; struct instruction *find_insn(struct objtool_file *file, @@ -2021,13 +2021,12 @@ static void cleanup(struct objtool_file elf_close(file->elf); } -int check(const char *_objname, bool _no_fp, bool no_unreachable, bool orc) +int check(const char *_objname, bool orc) { struct objtool_file file; int ret, warnings = 0; objname = _objname; - no_fp = _no_fp; file.elf = elf_open(objname, orc ? O_RDWR : O_RDONLY); if (!file.elf) --- a/tools/objtool/check.h +++ b/tools/objtool/check.h @@ -63,7 +63,7 @@ struct objtool_file { bool ignore_unreachables, c_file, hints; }; -int check(const char *objname, bool no_fp, bool no_unreachable, bool orc); +int check(const char *objname, bool orc); struct instruction *find_insn(struct objtool_file *file, struct section *sec, unsigned long offset);