DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: add note into coding style
@ 2018-09-17 15:24 Marko Kovacevic
  2018-09-17 16:31 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Marko Kovacevic @ 2018-09-17 15:24 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, john.mcnamara, Marko Kovacevic

Added a note into the coding style to
highlight the use of a bool within a struct

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
 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 <https://lkml.org/lkml/2017/11/21/384>`_
+
 Queues
 ~~~~~~
 
-- 
2.9.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: add note into coding style
  2018-09-17 15:24 [dpdk-dev] [PATCH] doc: add note into coding style Marko Kovacevic
@ 2018-09-17 16:31 ` Ferruh Yigit
  2018-11-24 20:45   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-09-17 16:31 UTC (permalink / raw)
  To: Marko Kovacevic, dev; +Cc: john.mcnamara

On 9/17/2018 4:24 PM, Marko Kovacevic wrote:
> Added a note into the coding style to
> highlight the use of a bool within a struct
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: add note into coding style
  2018-09-17 16:31 ` Ferruh Yigit
@ 2018-11-24 20:45   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-11-24 20:45 UTC (permalink / raw)
  To: Marko Kovacevic; +Cc: dev, Ferruh Yigit, john.mcnamara

17/09/2018 18:31, Ferruh Yigit:
> On 9/17/2018 4:24 PM, Marko Kovacevic wrote:
> > Added a note into the coding style to
> > highlight the use of a bool within a struct
> > 
> > Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-24 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 15:24 [dpdk-dev] [PATCH] doc: add note into coding style Marko Kovacevic
2018-09-17 16:31 ` Ferruh Yigit
2018-11-24 20:45   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).