From patchwork Thu May 24 12:02:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 17382 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EBD7082796; Thu, 24 May 2018 15:59:16 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.42.25; helo=mail.mail.packetmixer.de; envelope-from=sw@simonwunderlich.de; receiver= Received: from mail.mail.packetmixer.de (packetmixer.de [79.140.42.25]) by open-mesh.org (Postfix) with ESMTPS id 13DF480604 for ; Thu, 24 May 2018 14:03:05 +0200 (CEST) Received: from kero.packetmixer.de (p200300C593E5F600A0617AF7D322DA00.dip0.t-ipconnect.de [IPv6:2003:c5:93e5:f600:a061:7af7:d322:da00]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mail.packetmixer.de (Postfix) with ESMTPSA id B790E62057; Thu, 24 May 2018 14:03:04 +0200 (CEST) From: Simon Wunderlich To: davem@davemloft.net Date: Thu, 24 May 2018 14:02:56 +0200 Message-Id: <20180524120300.15829-5-sw@simonwunderlich.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180524120300.15829-1-sw@simonwunderlich.de> References: <20180524120300.15829-1-sw@simonwunderlich.de> Subject: [B.A.T.M.A.N.] [PATCH 4/8] batman-adv: Avoid bool in structures X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Sven Eckelmann Using the bool type for structure member is considered inappropriate [1] for the kernel. Its size is not well defined (but usually 1 byte but maybe also 4 byte). [1] https://lkml.org/lkml/2017/11/21/384 Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/types.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 0174f79e955a..3b3fc146b30d 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -1160,13 +1160,13 @@ struct batadv_priv_dat { */ struct batadv_mcast_querier_state { /** @exists: whether a querier exists in the mesh */ - bool exists; + unsigned char exists:1; /** * @shadowing: if a querier exists, whether it is potentially shadowing * multicast listeners (i.e. querier is behind our own bridge segment) */ - bool shadowing; + unsigned char shadowing:1; }; /** @@ -1207,10 +1207,10 @@ struct batadv_priv_mcast { u8 flags; /** @enabled: whether the multicast tvlv is currently enabled */ - bool enabled; + unsigned char enabled:1; /** @bridged: whether the soft interface has a bridge on top */ - bool bridged; + unsigned char bridged:1; /** * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP @@ -1389,7 +1389,7 @@ struct batadv_tp_vars { atomic_t dup_acks; /** @fast_recovery: true if in Fast Recovery mode */ - bool fast_recovery; + unsigned char fast_recovery:1; /** @recover: last sent seqno when entering Fast Recovery */ u32 recover; @@ -2046,10 +2046,10 @@ struct batadv_skb_cb { * @decoded: Marks a skb as decoded, which is checked when searching for * coding opportunities in network-coding.c */ - bool decoded; + unsigned char decoded:1; /** @num_bcasts: Counter for broadcast packet retransmissions */ - unsigned int num_bcasts; + unsigned char num_bcasts; }; /**