From patchwork Fri Jun 16 01:46:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 105692 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1080327qgd; Thu, 15 Jun 2017 18:47:31 -0700 (PDT) X-Received: by 10.84.217.138 with SMTP id p10mr4886874pli.66.1497577651072; Thu, 15 Jun 2017 18:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497577651; cv=none; d=google.com; s=arc-20160816; b=PkOFwAivMPepwUuHU1Hm6hKUE+pKb+rjEGhDQj7xQUbNOtc2JpuaQuMugeKOkR7WTI a4SHIuKrS7FUVyXj1+Z1YXcZhBrvexo9PmusMTdYNE+seaIf3LDSSg8vFmADxvT9b9qF /vLkI5cZCrpseVskb9Wq9PlhZeGsWcVvqFEmJ6Gss1mW4zatVoVIRjLEE+V3ZYLUurZV h6F0LBsiOyBSleJWIsvJ96Uf+JZreNSQY/JkQQDryCE30SddeVNF75vRH8YrFZSVixwv 7Sv0YiQVjpjfKDMQtA+ul6Lm6Y8Lllyv2jyvOssuvnD45FeC/PIWXbxHYeNEXFcSvuFN Tlxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=4nTmgAYHXziRRQl4ZQkQHpB7GaYHjf2w2pyIKaqKH4Q=; b=azyEbXPMfsSRHeu97JlUFanCUyqUWXJMQjBDcv2P+nApV2o0nB/g3VLaQNNY3f+xr+ Gej8z7iRqOvUZDeEeXQBAIovty+WKyevkGgRsBdA0nREux9nXKl1AjQQDs06lAA1NGAi jpIyWWevk9mdZ3oeP+rx5zOTMA2runhKUSmny8X0mZw2DRWIxG9PT1UYbIVzYkwIAFF0 9RFguXtAg0c+jSO8uOyCewWmU/ZhoMR3Sc5wYN8bwzJzYj+PWC4HQxH5hgSfCSLFNYH/ cSelG8xQdoW9cnw4NoKE4bwgeUuIiNoRr1xno375wSKsvXwU2hW7f/1/xJ1ISjEtuw2a 7vzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.b=TXvFQPeb; 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 l190si654899pfc.460.2017.06.15.18.47.30; Thu, 15 Jun 2017 18:47:31 -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; dkim=pass header.i=@nifty.com header.b=TXvFQPeb; 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 S1751906AbdFPBrO (ORCPT + 25 others); Thu, 15 Jun 2017 21:47:14 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:29935 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578AbdFPBrN (ORCPT ); Thu, 15 Jun 2017 21:47:13 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v5G1kb4K028763; Fri, 16 Jun 2017 10:46:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v5G1kb4K028763 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1497577598; bh=4nTmgAYHXziRRQl4ZQkQHpB7GaYHjf2w2pyIKaqKH4Q=; h=From:To:Cc:Subject:Date:From; b=TXvFQPebxPlsjEMwQxmoOkWNmFa47fVIUncHmX+3gOoGS7Xyt7Zk/6f8PudS1l1gB JugOmfxxsQwgeWvIBUjmvBSus3iM6Rc9dHKRSkGnh8WkXXws6xXnMuG3tvRfd4sGEE n1/HB3r6gGF/AK2s83VtUkiDU5AbsCvEqQpy7Yw0Mhyz2Qnu+XZ24jVM4c5xZeVeRg z5/w0Jpd7OSQU+19ltLC6m2ZQ0ByYdV8ImUAV/g9EdkvnNuxhWgmvyFJ/1MgUvoOCZ xa5pvf4+3l7vSkg/K07S5cJX7mBWdP/He86vkdVnTz33ouifrQZmeWHxiLWkjarhRM dNS17KLrmBkcQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Masahiro Yamada , Alexei Starovoitov , linux-kernel@vger.kernel.org, Daniel Borkmann , "David S. Miller" Subject: [PATCH] kernel/kallsyms: replace all_var with IS_ENABLED(CONFIG_KALLSYMS_ALL) Date: Fri, 16 Jun 2017 10:46:31 +0900 Message-Id: <1497577591-3434-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "all_var" looks like a variable, but is actually a macro. Use IS_ENABLED(CONFIG_KALLSYMS_ALL) for clarification. Signed-off-by: Masahiro Yamada --- kernel/kallsyms.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 6a3b249a2ae1..127e7cfafa55 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -28,12 +28,6 @@ #include -#ifdef CONFIG_KALLSYMS_ALL -#define all_var 1 -#else -#define all_var 0 -#endif - /* * These will be re-linked against their real values * during the second link stage. @@ -82,7 +76,7 @@ static inline int is_kernel(unsigned long addr) static int is_ksym_addr(unsigned long addr) { - if (all_var) + if (IS_ENABLED(CONFIG_KALLSYMS_ALL)) return is_kernel(addr); return is_kernel_text(addr) || is_kernel_inittext(addr); @@ -280,7 +274,7 @@ static unsigned long get_symbol_pos(unsigned long addr, if (!symbol_end) { if (is_kernel_inittext(addr)) symbol_end = (unsigned long)_einittext; - else if (all_var) + else if (IS_ENABLED(CONFIG_KALLSYMS_ALL)) symbol_end = (unsigned long)_end; else symbol_end = (unsigned long)_etext;