[ovs-dev,RFC] coding-style: Remove caveats about mixing statements and declarations.

Message ID 20171129004254.27293-1-blp@ovn.org
State Accepted
Headers show
Series
  • [ovs-dev,RFC] coding-style: Remove caveats about mixing statements and declarations.
Related show

Commit Message

Ben Pfaff Nov. 29, 2017, 12:42 a.m.
OVS practice has evolved over time to mix code and data more freely.

See also:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341032.html

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 Documentation/internals/contributing/coding-style.rst | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Justin Pettit Dec. 20, 2017, 11:04 p.m. | #1
> On Nov 28, 2017, at 4:42 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> OVS practice has evolved over time to mix code and data more freely.
> 
> See also:
> https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341032.html
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
Ben Pfaff Dec. 22, 2017, 10:08 p.m. | #2
On Wed, Dec 20, 2017 at 03:04:48PM -0800, Justin Pettit wrote:
> 
> 
> > On Nov 28, 2017, at 4:42 PM, Ben Pfaff <blp@ovn.org> wrote:
> > 
> > OVS practice has evolved over time to mix code and data more freely.
> > 
> > See also:
> > https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341032.html
> > 
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks, applied to master.

Patch

diff --git a/Documentation/internals/contributing/coding-style.rst b/Documentation/internals/contributing/coding-style.rst
index bcc169af305b..e7992e2be8fa 100644
--- a/Documentation/internals/contributing/coding-style.rst
+++ b/Documentation/internals/contributing/coding-style.rst
@@ -627,9 +627,8 @@  Most C99 features are OK because they are widely implemented:
 - Designated initializers (e.g. ``struct foo foo = {.a = 1};`` and ``int
   a[] = {[2] = 5};``).
 
-- Mixing of declarations and code within a block. Please use this
-  judiciously; keep declarations nicely grouped together in the
-  beginning of a block if possible.
+- Mixing of declarations and code within a block.  Favor positioning that
+  allows variables to be initialized at their point of declaration.
 
 - Use of declarations in iteration statements (e.g. ``for (int i = 0; i
   < 10; i++)``).