From patchwork Wed Jul 9 13:04:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 33309 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53A47208CF for ; Wed, 9 Jul 2014 13:04:50 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id o8sf24904558qcw.11 for ; Wed, 09 Jul 2014 06:04:50 -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=hIMPIQNp5plypS5XZ6jU2hBKYrPyJHkPZYd69T8LXns=; b=YwhQNw/GT5QMdBk1hzssKYtu/EZrfzIMmTZXhYxG69Gm2S3vTLfQZTamCfEoVpUJDW J6ag36zMiMxQ6MlBag8lxtjDgVzoZEyw0e7X0EnujTI4FlVqnzQj8PpxhexJb1S2Elr7 zbGDiDCgSSB7sZMfqbafeTigPEANOIB9H9WTb0289uCrwWlQbJ8q1xNMTL8nWke3tV2X V4N5GjsZhWiYtEMw91BpVhVCWPkFx0bsNCYrs9HaYbm/EXudjNYbiSPWsrsd6rlF2kNs vSb0NSYgYhXq2Pw+t0otlccDUop3r2Fk/OmaCPCmBl3KfoibLfWQIyQZ8MKWAgoasnJ0 uCow== X-Gm-Message-State: ALoCoQmqT3Znjy09FScsf72/HGx1IwVHYpX77c231e/AsuzNbVsI61ZQ6ccgIQzO4q80IrY3pttj X-Received: by 10.236.128.112 with SMTP id e76mr17102100yhi.38.1404911090195; Wed, 09 Jul 2014 06:04:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.132 with SMTP id o4ls1455790qga.40.gmail; Wed, 09 Jul 2014 06:04:50 -0700 (PDT) X-Received: by 10.52.252.4 with SMTP id zo4mr33196870vdc.20.1404911090077; Wed, 09 Jul 2014 06:04:50 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id c3si21480994veo.8.2014.07.09.06.04.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 06:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so214117veb.13 for ; Wed, 09 Jul 2014 06:04:50 -0700 (PDT) X-Received: by 10.221.34.13 with SMTP id sq13mr16155050vcb.16.1404911090016; Wed, 09 Jul 2014 06:04:50 -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 tc5csp46065vcb; Wed, 9 Jul 2014 06:04:49 -0700 (PDT) X-Received: by 10.68.231.7 with SMTP id tc7mr41543882pbc.32.1404911088638; Wed, 09 Jul 2014 06:04:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si7319963pdb.500.2014.07.09.06.04.46; Wed, 09 Jul 2014 06:04:46 -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 S932085AbaGINEX (ORCPT + 28 others); Wed, 9 Jul 2014 09:04:23 -0400 Received: from mail-ig0-f174.google.com ([209.85.213.174]:48589 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754949AbaGINEU (ORCPT ); Wed, 9 Jul 2014 09:04:20 -0400 Received: by mail-ig0-f174.google.com with SMTP id c1so1825943igq.7 for ; Wed, 09 Jul 2014 06:04:19 -0700 (PDT) X-Received: by 10.42.111.135 with SMTP id u7mr3250031icp.80.1404911059661; Wed, 09 Jul 2014 06:04:19 -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 lo3sm15293753igb.22.2014.07.09.06.04.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Jul 2014 06:04:19 -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 3/4] printk: use a clever macro Date: Wed, 9 Jul 2014 08:04:15 -0500 Message-Id: <1404911056-29064-4-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404911056-29064-1-git-send-email-elder@linaro.org> References: <1404911056-29064-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.128.182 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)