Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbbKPIBW (ORCPT ); Mon, 16 Nov 2015 03:01:22 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:36642 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbbKPIBS (ORCPT ); Mon, 16 Nov 2015 03:01:18 -0500 Subject: using IS_ENABLED(CONFIG_xyz) effectively To: Rasmus Villemoes , Paul Gortmaker , Ingo Molnar , Andrew Morton , Thomas Gleixner , "H. Peter Anvin" , Michal Marek References: <5613F3DE.4010406@suse.cz> <1444165543-2209-1-git-send-email-linux@rasmusvillemoes.dk> CC: "linux-arch@vger.kernel.org" , , arcml From: Vineet Gupta Message-ID: <56498D0A.3070000@synopsys.com> Date: Mon, 16 Nov 2015 13:30:10 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444165543-2209-1-git-send-email-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.197.182] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 35 Hi, I've been using IS_ENABLED for some time and once in a while run into an issue which prevents seamless use. Hence posing this question to experts in the area. C macro processor evaluates the ensuing control block even if IS_ENABLED evaluates to false. This requires dummy #defines or worse still removing usage of IS_ENABLED altogether. e.g. In example below even for ARCOMPACT builds, we need the ARCV2 specific define ARCV2_IRQ_DEF_PRIO. void arch_cpu_idle(void) { if (is_isa_arcompact()) { <---- IS_ENABLED(CONFIG_ISA_ARCOMPACT) __asm__("sleep 0x3"); } else { const int arg = 0x10 | ARCV2_IRQ_DEF_PRIO; __asm__("sleep 0x10"); } } One could argue that the interface needs to be cleanly defined to not have such specific #defines in common code in first place. However sometime that becomes just too tedious. Is there a way to get around by this ? Thx, -Vineet -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/