From patchwork Thu Jul 10 13:01:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 33420 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B830621140 for ; Thu, 10 Jul 2014 13:01:37 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id va2sf48063331obc.2 for ; Thu, 10 Jul 2014 06:01:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=kJuuFhsGOb3L43QX4kmcJAQc35GZi3WLlbDnh+Up1LM=; b=WZuY+tbNmTVXuZBrRSFzOXtBaxDo4fQe4aPsT9zD67P9tL6DLJeDfoA0EMZo0mmP4v iLI+F2TclBdsaixC7FqKw69/k9BS7P7qqX+C98BcM+Vaz6526y5g1xL/lcPRwx7vIICp BksJNAImuP6qZPD4sKDwnGw0BEW6KmEbb7Mh1VDMJIEUuq6llNRjjQmXXI35DZkzybdA cye7ZF8/oM5W19nsn44iLBWL1PyNGPDUqoyOifrpfrPCzk/5QWmFd1VHQlbYB0ysm2gJ ci3HvfWtUvCJ5JBswVzrZ+QDQWkjKFRLmiLJadE7M2B0n6hcj97npz9YickXGCVfwEIp AREw== X-Gm-Message-State: ALoCoQm7NBHCBgPHv14I3h8DY1SEy3aspM6oIB6Uai0umUoK5kO9G2US6Rr5eVbmYYsGtfxYUBdT X-Received: by 10.182.197.204 with SMTP id iw12mr9368872obc.17.1404997297056; Thu, 10 Jul 2014 06:01:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.241 with SMTP id 104ls53729qgv.21.gmail; Thu, 10 Jul 2014 06:01:37 -0700 (PDT) X-Received: by 10.220.252.198 with SMTP id mx6mr28101692vcb.15.1404997296951; Thu, 10 Jul 2014 06:01:36 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id zl10si12815807vdb.43.2014.07.10.06.01.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 06:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so10275959vcb.7 for ; Thu, 10 Jul 2014 06:01:36 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr426252vcb.35.1404997296842; Thu, 10 Jul 2014 06:01:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp130797vcb; Thu, 10 Jul 2014 06:01:36 -0700 (PDT) X-Received: by 10.68.250.3 with SMTP id yy3mr39609518pbc.56.1404997296040; Thu, 10 Jul 2014 06:01:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t15si8558554pdi.193.2014.07.10.06.01.35; Thu, 10 Jul 2014 06:01:35 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753592AbaGJNBc (ORCPT + 28 others); Thu, 10 Jul 2014 09:01:32 -0400 Received: from mail-ig0-f178.google.com ([209.85.213.178]:56694 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753025AbaGJNB3 (ORCPT ); Thu, 10 Jul 2014 09:01:29 -0400 Received: by mail-ig0-f178.google.com with SMTP id hn18so3022008igb.11 for ; Thu, 10 Jul 2014 06:01:28 -0700 (PDT) X-Received: by 10.42.239.196 with SMTP id kx4mr23545283icb.71.1404997288269; Thu, 10 Jul 2014 06:01:28 -0700 (PDT) Received: from localhost.localdomain (c-24-245-18-91.hsd1.mn.comcast.net. [24.245.18.91]) by mx.google.com with ESMTPSA id d4sm24960026igc.5.2014.07.10.06.01.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 06:01:27 -0700 (PDT) From: Alex Elder To: akpm@linux-foundation.org Cc: ak@linux.intel.com, bp@suse.de, jack@suse.cz, john.stultz@linaro.org, pmladek@suse.cz, rostedt@goodmis.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] printk: use a clever macro Date: Thu, 10 Jul 2014 08:01:23 -0500 Message-Id: <1404997284-20844-4-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404997284-20844-1-git-send-email-elder@linaro.org> References: <1404997284-20844-1-git-send-email-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use the IS_ENABLED() macro rather than #ifdef blocks to set certain global values. Signed-off-by: Alex Elder Acked-by: Borislav Petkov Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 646146c..6f75e8a 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -453,11 +453,7 @@ static int log_store(int facility, int level, return msg->text_len; } -#ifdef CONFIG_SECURITY_DMESG_RESTRICT -int dmesg_restrict = 1; -#else -int dmesg_restrict; -#endif +int dmesg_restrict = IS_ENABLED(CONFIG_SECURITY_DMESG_RESTRICT); static int syslog_action_restricted(int type) { @@ -947,11 +943,7 @@ static inline void boot_delay_msec(int level) } #endif -#if defined(CONFIG_PRINTK_TIME) -static bool printk_time = 1; -#else -static bool printk_time; -#endif +static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME); module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); static size_t print_time(u64 ts, char *buf)