From patchwork Fri Jan 5 03:10:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 855904 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="auWXuat1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zCVDV0F0Yz9ryr for ; Fri, 5 Jan 2018 14:15:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbeAEDPv (ORCPT ); Thu, 4 Jan 2018 22:15:51 -0500 Received: from condef-02.nifty.com ([202.248.20.67]:36910 "EHLO condef-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbeAEDPu (ORCPT ); Thu, 4 Jan 2018 22:15:50 -0500 Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-02.nifty.com with ESMTP id w053CCbL030461 for ; Fri, 5 Jan 2018 12:12:12 +0900 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 w053B8wA007744; Fri, 5 Jan 2018 12:11:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w053B8wA007744 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1515121870; bh=jLfUO4nKJSi7wTDgNzlZMy9qEpvb6ONeHDerJNpEP+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=auWXuat1+t/YhdX6G7m+3V2SdmoqfpVmHq8H6B9PE/B0rqNFc5Y/s+31INWnAz2H2 I74Fp3RpcjRpBxosRLMx2VOP+dw1DuJT0k5Aay/Od/TJCXTAaXHIRguDLhQ4IoWD12 wi2OO55R3uTapW6mCDJZuLelAx7bCGv4O55YJ9A1PVG/LkBhNEK8s4Wfzzdkp/tuoZ fG+JOeC8mMx6oPF1EUenzkIo/7dLc/HonooMB4JV86OKXZSVqF057XNegMQZKyv1Hc 5x2bv4Xvp3b7gEUNdkB2rnStARJokdXPhZcOXLLSdTBDU9N48EZWaMFrs/3DgAi/1q kcg6m1xL1ugew== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Ian Abbott , Masahiro Yamada , Hideaki YOSHIFUJI , netdev@vger.kernel.org, Alexey Kuznetsov , linux-kernel@vger.kernel.org, "David S. Miller" Subject: [PATCH 2/2] build_bug.h: remove BUILD_BUG_ON_NULL() Date: Fri, 5 Jan 2018 12:10:33 +0900 Message-Id: <1515121833-3174-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515121833-3174-1-git-send-email-yamada.masahiro@socionext.com> References: <1515121833-3174-1-git-send-email-yamada.masahiro@socionext.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This macro is only used by net/ipv6/mcast.c, but there is no reason why it must be BUILD_BUG_ON_NULL(). Replace it with BUILD_BUG_ON_ZERO(), and remove BUILD_BUG_ON_NULL() definition from . Signed-off-by: Masahiro Yamada --- include/linux/build_bug.h | 2 -- net/ipv6/mcast.c | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h index 3efed0d..43d1fd5 100644 --- a/include/linux/build_bug.h +++ b/include/linux/build_bug.h @@ -8,7 +8,6 @@ #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_NULL(e) ((void *)0) #define BUILD_BUG_ON_INVALID(e) (0) #define BUILD_BUG_ON_MSG(cond, msg) (0) #define BUILD_BUG_ON(condition) (0) @@ -28,7 +27,6 @@ * aren't permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); })) -#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); })) /* * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 8446426..b28d4aa 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -65,10 +65,10 @@ #include /* Ensure that we have struct in6_addr aligned on 32bit word. */ -static void *__mld2_query_bugs[] __attribute__((__unused__)) = { - BUILD_BUG_ON_NULL(offsetof(struct mld2_query, mld2q_srcs) % 4), - BUILD_BUG_ON_NULL(offsetof(struct mld2_report, mld2r_grec) % 4), - BUILD_BUG_ON_NULL(offsetof(struct mld2_grec, grec_mca) % 4) +static int __mld2_query_bugs[] __attribute__((__unused__)) = { + BUILD_BUG_ON_ZERO(offsetof(struct mld2_query, mld2q_srcs) % 4), + BUILD_BUG_ON_ZERO(offsetof(struct mld2_report, mld2r_grec) % 4), + BUILD_BUG_ON_ZERO(offsetof(struct mld2_grec, grec_mca) % 4) }; static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT;