From patchwork Mon Jul 11 19:50:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 9224041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E98460760 for ; Mon, 11 Jul 2016 19:51:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B6127D29 for ; Mon, 11 Jul 2016 19:51:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0564727E5A; Mon, 11 Jul 2016 19:51:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8DF527D29 for ; Mon, 11 Jul 2016 19:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbcGKTvT (ORCPT ); Mon, 11 Jul 2016 15:51:19 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:56797 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbcGKTvR (ORCPT ); Mon, 11 Jul 2016 15:51:17 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=omega.localdomain) by metis.ext.pengutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1bMhEa-00038F-3d; Mon, 11 Jul 2016 21:51:16 +0200 From: Alexander Aring To: linux-wpan@vger.kernel.org Cc: kernel@pengutronix.de, luiz.dentz@gmail.com, kaspar@schleiser.de, jukka.rissanen@linux.intel.com, linux-bluetooth@vger.kernel.org, Patrik.Flykt@linux.intel.com, Alexander Aring Subject: [RFC bluetooth-next 04/20] ieee802154: 6lowpan: move skb cb BUILD_BUG_ON check Date: Mon, 11 Jul 2016 21:50:28 +0200 Message-Id: <20160711195044.25343-5-aar@pengutronix.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160711195044.25343-1-aar@pengutronix.de> References: <20160711195044.25343-1-aar@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: aar@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wpan@vger.kernel.org Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch moves the control block information BUILD_BUG_ON to the init of module. All compile timed BUILD_BUG_ON macros should be placed there. Signed-off-by: Alexander Aring --- include/net/6lowpan.h | 1 - net/ieee802154/6lowpan/core.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index 5ab4c99..6d56be7 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h @@ -178,7 +178,6 @@ struct lowpan_802154_cb { static inline struct lowpan_802154_cb *lowpan_802154_cb(const struct sk_buff *skb) { - BUILD_BUG_ON(sizeof(struct lowpan_802154_cb) > sizeof(skb->cb)); return (struct lowpan_802154_cb *)skb->cb; } diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c index d7efbf0..6afb8cd 100644 --- a/net/ieee802154/6lowpan/core.c +++ b/net/ieee802154/6lowpan/core.c @@ -233,6 +233,9 @@ static int __init lowpan_init_module(void) { int err = 0; + BUILD_BUG_ON(sizeof(struct lowpan_802154_cb) > + FIELD_SIZEOF(struct sk_buff, cb)); + err = lowpan_net_frag_init(); if (err < 0) goto out;