From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marko Kovacevic Subject: [PATCH] doc: add note into coding style Date: Mon, 17 Sep 2018 16:24:29 +0100 Message-ID: <20180917152429.30518-1-marko.kovacevic@intel.com> Cc: ferruh.yigit@intel.com, john.mcnamara@intel.com, Marko Kovacevic To: dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6E1195F2E for ; Mon, 17 Sep 2018 17:26:28 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added a note into the coding style to highlight the use of a bool within a struct Signed-off-by: Marko Kovacevic --- doc/guides/contributing/coding_style.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst index b1bf0d1..8b1febe 100644 --- a/doc/guides/contributing/coding_style.rst +++ b/doc/guides/contributing/coding_style.rst @@ -247,6 +247,15 @@ Structure Declarations * Use of the structures should be by separate variable declarations and those declarations must be extern if they are declared in a header file. * Externally visible structure definitions should have the structure name prefixed by ``rte_`` to avoid namespace collisions. +.. note:: + + Uses of ``bool`` in structures are not preferred as is wastes space and + it's also not clear as to what type size the bool is. A preferred use of + ``bool`` is mainly as a return type from functions that return true/false, + and maybe local variable functions. + + Ref: `LKML `_ + Queues ~~~~~~ -- 2.9.5