From patchwork Fri Nov 16 06:19:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 151283 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp39585ljp; Thu, 15 Nov 2018 22:20:51 -0800 (PST) X-Google-Smtp-Source: AJdET5dEz179UGyd13XofKAe1raiw4W0SZ2bo1ljaeijtvgrvLwSQbD/BS+sx3Hl5wYMC4PHE/ch X-Received: by 2002:a17:902:108a:: with SMTP id c10-v6mr9276870pla.171.1542349250911; Thu, 15 Nov 2018 22:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542349250; cv=none; d=google.com; s=arc-20160816; b=mgPdKk6Zqsm0rypQEZwMZ5AoTs7rGo+S/qiBBav/RNtXz9qZtUOP768M5RzLfsFtpc o3rQgvvNXqYzCSjq9axkcL1EW2kQ/KrmX637CZ93AFV+JWtZrOa8VMdEUNTlhPjsvpXZ 2K67ctHUPXdCK97xG0xq616M3NplsvC39qCKXSXMB+a27TzdU7PS3sBTLxZ6whp3LMqi yqV9MLHvXT4ZP1S76e1chO3WzlQr1RqzzOwaRPCNCOKJ9h8TqZAwWbMpT6VUoK+Tj4ww MitFZqpYcGQXDjLeYCIZaY1yu/5aytSnXW8KGy1TPfzymb6iJ07t5UynInwQDqHAgKEr JMdA== 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:dkim-signature:dkim-filter; bh=WR2halLsHQdGN9ZbpibG6kScGLBXaoZnZSO1D3qzw/o=; b=MJaMTNsNVMTtfxYuxgsXxA0o1ZLofBssDoO/Rsu+Abxscwpn9CdBsSl4VFMGUMiF1V QM6LOZfJhC2g+1M+cvtUoj73p0WmBRk6tgGS+0OqUXuaZMCHlecq32xWgiMnwTgez253 rTRbTgNIlwc6b++x1CzkQzqnXjPBGgpaCI+ih/P22hNZ+gWdJn0EfwHdLs0SK1E+L2Lm 7gycFi7ET6cB+OzNFOQaVuW/LThfwhLSkhusQqfiidenHgAxxpTpCsMrHqQTBNwI3Iwc uXWlV4QjBKdz3yiGFqzRYM8REoKj26Vy4tIAV2QzCm1rL7SFOiA9/w39+WM2kPWmaY4Y Uegw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XDJqom5z; 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 d12-v6si31622773pla.24.2018.11.15.22.20.50; Thu, 15 Nov 2018 22:20:50 -0800 (PST) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XDJqom5z; 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 S2389336AbeKPQbt (ORCPT + 32 others); Fri, 16 Nov 2018 11:31:49 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:50718 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbeKPQbs (ORCPT ); Fri, 16 Nov 2018 11:31:48 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id wAG6Jp5G005743; Fri, 16 Nov 2018 15:19:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wAG6Jp5G005743 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1542349192; bh=WR2halLsHQdGN9ZbpibG6kScGLBXaoZnZSO1D3qzw/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDJqom5zKTaf2CG18WGGQ2LcpgcBlSSIJLlVwR4pngzqyoq3Ljlz+/7OFckbhYi8S pN5JQg1Lqwdxt1Um/+loQnaIetbNfcyoeDXMXdbAb3YapaMj0StcoQ/ByJJnxvrE3g GRWpPaJRICdhad7MlcnRwoM8RU3axoSfMjwpeULPxFuY1dKzXdBSV+J0DBzNRgsrIX Mn+UOeKapRIWBIjK/5yzPtzzggeELJ6RYXV8EmXQ/7FGf7mHU9qG/6LTxmeP1kedaM JSa9mT4O7noU4khtb2LAiv250KttCdn/O2ARSU6an5O1ZsVyvqPlccko3SFwz4a6fJ kOy2iqtSiOODQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Linus Torvalds , Arnd Bergmann , Kees Cook , Nick Desaulniers , Miguel Ojeda , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] build_bug.h: remove all dummy BUILD_BUG_ON stubs for sparse Date: Fri, 16 Nov 2018 15:19:01 +0900 Message-Id: <1542349141-7229-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542349141-7229-1-git-send-email-yamada.masahiro@socionext.com> References: <1542349141-7229-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The introduction of these dummy BUILD_BUG_ON stubs dates back to commit 903c0c7cdc21 ("sparse: define dummy BUILD_BUG_ON definition for sparse"). At that time, BUILD_BUG_ON() was implemented with the negative array trick, which Sparse complains about even if the condition can be optimized and evaluated to 0 at compile-time. With the previous commit, the leftover negative array trick is gone. Sparse is happy with the current BUILD_BUG_ON(), which is implemented by using the 'error' attribute. There might be a little room for argument about BUILD_BUG_ON_ZERO(). Sparse reports 'invalid bitfield width, -1' for non-zero value, and 'bad integer constant expression' for non-constant value. This is the same criteria as GCC uses. So, if those Sparse errors occurred, they would cause errors for GCC as well. (Hence, such errors would have been detected by the normal compile test process.) Signed-off-by: Masahiro Yamada --- include/linux/build_bug.h | 11 ----------- 1 file changed, 11 deletions(-) -- 2.7.4 diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h index d415c64..b0828f7 100644 --- a/include/linux/build_bug.h +++ b/include/linux/build_bug.h @@ -4,16 +4,6 @@ #include -#ifdef __CHECKER__ -#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) -#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) -#define BUILD_BUG_ON_ZERO(e) (0) -#define BUILD_BUG_ON_INVALID(e) (0) -#define BUILD_BUG_ON_MSG(cond, msg) (0) -#define BUILD_BUG_ON(condition) (0) -#define BUILD_BUG() (0) -#else /* __CHECKER__ */ - /* Force a compilation error if a constant expression is not a power of 2 */ #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \ BUILD_BUG_ON(((n) & ((n) - 1)) != 0) @@ -64,6 +54,5 @@ */ #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") -#endif /* __CHECKER__ */ #endif /* _LINUX_BUILD_BUG_H */