Received: by 10.192.165.148 with SMTP id m20csp4914675imm; Tue, 1 May 2018 06:11:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqL/vUDqAu+hJl70Q7u6T+TzBVKxYCNw672GONnb8EH0X+gwaLcxrHnmTB8IjMIQ/QtzrDB X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr12338755plo.357.1525180297040; Tue, 01 May 2018 06:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525180297; cv=none; d=google.com; s=arc-20160816; b=YM2rDzsCSmUgHVAOeuxQuReSqIZww8Jnw/vZ3MlNq/uQAEfsdEuIaITOUVgYQTgxKG wNvPtSADLc7RnWE1nwL1jJ/W9df4GnPbMheZrT5bmvr289/yYDkqV9dEeYTOcbvg/kY2 WPkhmK+6W0p9XI+S7wi5WRVhDs3QdlQsnT5nFpHXrrUvp6uBoXD/uTNOMFAIQSI9QG0Z TuoHRKwSOrNJh4cTmV2sZKTsQxFywfq0AIgzync8beYccxpG4nBtlgexDT384E1VpmgG HslxMgggzzoP+MfVuw/Sj0KA5K+8Zjgfo2jKESj6lNTFrZhWDIZCbYZPzDT5yaAUWI+5 peFQ== 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=ldZFfEpL11X7qYEe1XEDrmulHtam6OG3l4ldAXHm3cEw8yQoOx5KZ6Cq7IGjSDdXT1 wlLeSDREDZ32R9LPUVr2lkqY0Q0ixZyQ4X+1uh5Fk5NSfEHlNSyrA8LAlnjSlfGb+9j8 pW3Ueq5cAUVigKSVGZOxrN9GE2npN0vuETXQRHmfHczybStqEfvHxspA19jKQijzJijI 8veyHGWg4KMoA07qhdP7c/5/MnNNoj9Sf8Q+kY+rTGEA4QkSoFh9BktGUS1VD8R/Wuy9 jq4yJC9Pm3GKufUianWLzz+O3JMQ5SN2mS0mHpx6ehS3saZ3qYOXd13OydmCZZlClnJM 7+9w== 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 a5-v6si8974817plp.196.2018.05.01.06.11.21; Tue, 01 May 2018 06:11:36 -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 S1755534AbeEANLH (ORCPT + 99 others); Tue, 1 May 2018 09:11:07 -0400 Received: from mga06.intel.com ([134.134.136.31]:65261 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755345AbeEANLD (ORCPT ); Tue, 1 May 2018 09:11:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 May 2018 06:11:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,351,1520924400"; d="scan'208";a="38382590" Received: from gvt-dell.bj.intel.com (HELO gvt-dell-host.bj.intel.com) ([10.238.154.59]) by orsmga006.jf.intel.com with ESMTP; 01 May 2018 06:10:59 -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: 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 5/5] asm-generic: fix build error in fix_to_virt with CONFIG_DEBUG_EXPERIENCE Date: Tue, 1 May 2018 21:00:14 +0800 Message-Id: <1525179614-14571-6-git-send-email-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525179614-14571-1-git-send-email-changbin.du@intel.com> References: <1525179614-14571-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