[ofw] [Patch][IPoIB_NDIS6_CM] Spacing, code style and tabulation patch

Alex Naslednikov xalex at mellanox.co.il
Wed Sep 22 02:26:35 PDT 2010


Committed at 2944 ,  without ";" but with "{}"

From: Smith, Stan [mailto:stan.smith at intel.com]
Sent: Tuesday, September 21, 2010 9:56 PM
To: Fab Tillier; Alex Naslednikov; ofw at lists.openfabrics.org
Subject: RE: [ofw] [Patch][IPoIB_NDIS6_CM] Spacing, code style and tabulation patch



________________________________
From: Fab Tillier [mailto:ftillier at microsoft.com]
Sent: Tuesday, September 21, 2010 11:06 AM
To: Smith, Stan; Alex Naslednikov; ofw at lists.openfabrics.org
Subject: RE: [ofw] [Patch][IPoIB_NDIS6_CM] Spacing, code style and tabulation patch
I'd like to see braces around single line conditionals, so that adding code if needed becomes easier.  I would be strongly against disallowing braces around single line conditionals.

It's not a huge issue, although how hard is it to add braces if adding code?
either way I'm OK.

I agree about the semi-colon after the closing brace.

-Fab

From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Smith, Stan
Sent: Tuesday, September 21, 2010 10:54 AM
To: Alex Naslednikov; ofw at lists.openfabrics.org
Subject: Re: [ofw] [Patch][IPoIB_NDIS6_CM] Spacing, code style and tabulation patch

Please see below.

________________________________
From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Alex Naslednikov
Sent: Tuesday, September 21, 2010 5:30 AM
To: ofw at lists.openfabrics.org
Subject: [ofw] [Patch][IPoIB_NDIS6_CM] Spacing, code style and tabulation patch
This patch replaces spaces by tabs and add brackets to "if" case
Index: B:/users/xalex/WoF-trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- B:/users/xalex/WoF-trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp        (revision 2934)
+++ B:/users/xalex/WoF-trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp     (working copy)
@@ -1980,7 +1980,8 @@
 __recv_cb_internal(
                IN                           const     ib_cq_handle_t                                                                h_cq,
                IN                                                           void                                                                                       *cq_context,
-    IN              uint32_t*                    p_recv_cnt );
+             IN                                                           uint32_t                                                                               *p_recv_cnt
+             );


 static void
@@ -5797,8 +5798,9 @@
                cl_obj_unlock( &p_port->obj );

                if (p_port->send_mgr.pending_list.count <= 0)
+             {
                                return;
-
+             };

Braces around a single statement are not needed; some coding standards disallow this.
Additionally the ';' on the trailing brace is not needed.
Otherwise, OK.

                p_item =  cl_qlist_remove_head( &p_port->send_mgr.pending_list );
                while (p_item != cl_qlist_end(&p_port->send_mgr.pending_list))
                {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100922/79379c77/attachment.html>


More information about the ofw mailing list