Received: by 10.192.165.148 with SMTP id m20csp692554imm; Wed, 2 May 2018 07:20:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrdyZ6rciGn3q+yaPiYxuuDCQZqkoQ3f41FTch0HbcL+wAC+SIDcz1p+f6mvs0xYU9qVuWS X-Received: by 10.98.180.25 with SMTP id h25mr7572963pfn.225.1525270807727; Wed, 02 May 2018 07:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525270807; cv=none; d=google.com; s=arc-20160816; b=l0q3YM6WZdUY8wA1xQpPISXk5gdkehcksLUXf4bVNv79okWPJrvQjJY+1365IBioVt Fi1oMqE2CrBqUFKE+hShSxL4LZwbkqLu37o3Too7FQPYZGGC1zrtLpMFJTF4eWgQag+c pqlX+wDyGZPmOYLR+BuE4xvhEwHR2dFZDXbABFaZ0dMsFOVJm9pRCFTlnnpxV8Bo/W1W 2mXGm/klbPKLbxRZmd/i/YO+3fgnZNpA9zNLi79v5imjkiff/YluQ5ZoouvnA9ZhiZv1 VKARx9OsrGVnY6GTDcJElCfI7r3dDjYV+ElMz+v4LSApuBveSYVSQkB5U84TKsJ0xRjb 190A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=UfZkJSUPf/WE0pVkXnT20wjyjwDOB+gzVIO5CBaPjRU=; b=dNWSCfEkR+TaxNlyCV8a3Fg92KwR7cRZqv15RPcM6ptNxWLoyWw8RvEi8fVwFpZI+8 VLjvlL/oJKyNMgIaWngfI8lsN3AlzjxJB8qj0G0Anlvk8JxCTSiu5NWa7VC4f+TPtHWN WUMKbYyD8zf0dxj2O3LNBjn3xmn2LIU/hCyzB/O0lbV7HOWlHS1+FIHgdOfo+/kbFTWB aNHCfJTBqm12wCCd0TBlD8kyZVSEQaW5gAfmkObcKvmLmPKVlac8zNpt9frgD1t7nID5 TvGzxeaoCDUmt7RBycV/+OIsxXrZ7fVdT0ZgO/xVTY+QaKwHdupVlrqHGVD02WUdj1Qu 0/xA== 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 188-v6si9559297pgg.546.2018.05.02.07.19.53; Wed, 02 May 2018 07:20:07 -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 S1751704AbeEBOTl (ORCPT + 99 others); Wed, 2 May 2018 10:19:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbeEBOTd (ORCPT ); Wed, 2 May 2018 10:19:33 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9327E22D73; Wed, 2 May 2018 14:19:31 +0000 (UTC) Date: Wed, 2 May 2018 10:19:30 -0400 From: Steven Rostedt To: changbin.du@intel.com Cc: yamada.masahiro@socionext.com, michal.lkml@markovi.net, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, rdunlap@infradead.org, x86@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, arnd@arndb.de, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v2 5/5] asm-generic: fix build error in fix_to_virt with CONFIG_DEBUG_EXPERIENCE Message-ID: <20180502101930.25a5437d@gandalf.local.home> In-Reply-To: <1525268700-10631-6-git-send-email-changbin.du@intel.com> References: <1525268700-10631-1-git-send-email-changbin.du@intel.com> <1525268700-10631-6-git-send-email-changbin.du@intel.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 May 2018 21:45:00 +0800 changbin.du@intel.com wrote: > From: Changbin Du > > With '-Og' optimization level, GCC would not optimize a count for a loop > as a constant value. But BUILD_BUG_ON() only accept compile-time constant > values. > > arch/arm/mm/mmu.o: In function `fix_to_virt': > /home/changbin/work/linux/./include/asm-generic/fixmap.h:31: undefined reference to `__compiletime_assert_31' > Makefile:1051: recipe for target 'vmlinux' failed > make: *** [vmlinux] Error 1 > > Signed-off-by: Changbin Du > --- > include/asm-generic/fixmap.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h > index 827e4d3..a6576d4 100644 > --- a/include/asm-generic/fixmap.h > +++ b/include/asm-generic/fixmap.h > @@ -28,7 +28,8 @@ > */ > static __always_inline unsigned long fix_to_virt(const unsigned int idx) > { > - BUILD_BUG_ON(idx >= __end_of_fixed_addresses); > + BUILD_BUG_ON(__builtin_constant_p(idx) && > + idx >= __end_of_fixed_addresses); Hmm, this changes the check slightly. Perhaps we should only do this when your config is active: { BUILD_BUG_ON( /* CONFIG_DEBUG_OPTIMIZE may cause idx not to be constant */ #ifdef CONFIG_DEBUG_OPTIMIZE __builtin_constant_p(idx) && #endif idx >= __end_of_fixed_addresses); } -- Steve > return __fix_to_virt(idx); > } >