Received: by 10.192.165.148 with SMTP id m20csp665770imm; Wed, 2 May 2018 06:56:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTHOmET6076vU9It283FZGmcXTwLK0DZYyTJvw6vN3iZVdIoQstsq3i606Ehl5b4QpmJ45 X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr16340040pgc.268.1525269413655; Wed, 02 May 2018 06:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525269413; cv=none; d=google.com; s=arc-20160816; b=hFUoxCKMSc1uFPW+Rt/Kn0U4Z+O9n8IRY39r7bHLuVBj+yyW+bo/v/UkgM4n9HuSMS l8/34iV4MDHHkszAG7nUARP7Ryrr5aaBoN997eeqZhBAZCxqs6Es+jyl6D94Vs4UY1UA qkbWJuxWl9drrkg1mipyiKmh+sG8uY9EOUCw//La3aGHlc2am9aIP5naOmgDmT5x2kfk 86aU8x7gMhNiDt2SOwfUysDUxYfn/AP9KehfmSLIIuOrvYCFRHSHfREcM5SZNZgBn2gc xVuWPxkdvlWrylglHBzSICbfDuKCzibwBf7dTRpkn9CLoyJzuULqDx0bgQyjoGcJD6xw pRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iGkfejQvwUVCIe0R0CPkTMGh1M7mdXVh9PA5hPC51Ns=; b=yvmMsSyoZm6Zi9JVIn1qT2gWRruGUHUqB4tmFVO119r8AK2Sm76ka6VCxuCqtcG92X 3sf3wicu06XfUAqDFlYx8fu9n7F84S1dMgdQ4V0dh2mPhAwUi5vy/mLS8NDCnfErU/zH 2+NhQIKIECWZfgeJk4NjEIpquiM4uDeecdfGpfeb41VhxjhnGT8bTRnxKv9nAJzoZqcp B516hZTfcFKWGPKC0NGycMJ0N5vlR/j0cwYI/aJUIItsDvnv/IIl2NrPUR/hIhJn7Zb6 Cg3UIrI0xoW4OaUSLDNYJYEjFZRHe6m7WwPVQzrtH2MeYj0vDAd2yQE26jnmEVBTuzgN J9uw== 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 w24-v6si3649901plq.254.2018.05.02.06.56.39; Wed, 02 May 2018 06:56:53 -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 S1751572AbeEBNzt (ORCPT + 99 others); Wed, 2 May 2018 09:55:49 -0400 Received: from mga01.intel.com ([192.55.52.88]:58147 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbeEBNzp (ORCPT ); Wed, 2 May 2018 09:55:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 06:55:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,354,1520924400"; d="scan'208";a="225150788" Received: from gvt-dell.bj.intel.com (HELO gvt-dell-host.bj.intel.com) ([10.238.154.59]) by fmsmga005.fm.intel.com with ESMTP; 02 May 2018 06:55:42 -0700 From: changbin.du@intel.com To: yamada.masahiro@socionext.com, michal.lkml@markovi.net, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org Cc: rostedt@goodmis.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, Changbin Du Subject: [PATCH v2 5/5] asm-generic: fix build error in fix_to_virt with CONFIG_DEBUG_EXPERIENCE Date: Wed, 2 May 2018 21:45:00 +0800 Message-Id: <1525268700-10631-6-git-send-email-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525268700-10631-1-git-send-email-changbin.du@intel.com> References: <1525268700-10631-1-git-send-email-changbin.du@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); return __fix_to_virt(idx); } -- 2.7.4