Re: [PATCH net-next v2 4/9] net: ipmr: fix code and comment style

2015-11-23 Thread Nikolay Aleksandrov
On 11/23/2015 06:30 AM, Cong Wang wrote:
> On Sat, Nov 21, 2015 at 6:57 AM, Nikolay Aleksandrov
>  wrote:
>> -
>> -/*
>> - * Setup for IP multicast routing
>> - */
>> +/* Setup for IP multicast routing */
>>  static int __net_init ipmr_net_init(struct net *net)
> 
> Comments like this one are never useful so can be just removed.
> 

Will do, this is not the point of the patch thought. There're also
incorrect comments that need to be changed or removed. All in
due time, this is just a small trivial step to abide the style.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2 4/9] net: ipmr: fix code and comment style

2015-11-22 Thread Cong Wang
On Sat, Nov 21, 2015 at 6:57 AM, Nikolay Aleksandrov
 wrote:
> -
> -/*
> - * Setup for IP multicast routing
> - */
> +/* Setup for IP multicast routing */
>  static int __net_init ipmr_net_init(struct net *net)

Comments like this one are never useful so can be just removed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next v2 4/9] net: ipmr: fix code and comment style

2015-11-21 Thread Nikolay Aleksandrov
From: Nikolay Aleksandrov 

Trivial code and comment style fixes, also removed some extra newlines,
spaces and tabs.

Signed-off-by: Nikolay Aleksandrov 
---
 include/uapi/linux/mroute.h |  59 ++
 net/ipv4/ipmr.c | 142 
 2 files changed, 54 insertions(+), 147 deletions(-)

diff --git a/include/uapi/linux/mroute.h b/include/uapi/linux/mroute.h
index a382d2c04a42..cf943016930f 100644
--- a/include/uapi/linux/mroute.h
+++ b/include/uapi/linux/mroute.h
@@ -4,15 +4,13 @@
 #include 
 #include 
 
-/*
- * Based on the MROUTING 3.5 defines primarily to keep
- * source compatibility with BSD.
+/* Based on the MROUTING 3.5 defines primarily to keep
+ * source compatibility with BSD.
  *
- * See the mrouted code for the original history.
- *
- *  Protocol Independent Multicast (PIM) data structures included
- *  Carlos Picoto (c...@di.fc.ul.pt)
+ * See the mrouted code for the original history.
  *
+ * Protocol Independent Multicast (PIM) data structures included
+ * Carlos Picoto (c...@di.fc.ul.pt)
  */
 
 #define MRT_BASE   200
@@ -34,15 +32,13 @@
 #define SIOCGETSGCNT   (SIOCPROTOPRIVATE+1)
 #define SIOCGETRPF (SIOCPROTOPRIVATE+2)
 
-#define MAXVIFS32  
+#define MAXVIFS32
 typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
 typedef unsigned short vifi_t;
 #define ALL_VIFS   ((vifi_t)(-1))
 
-/*
- * Same idea as select
- */
- 
+/* Same idea as select */
+
 #define VIFM_SET(n,m)  ((m)|=(1<<(n)))
 #define VIFM_CLR(n,m)  ((m)&=~(1<<(n)))
 #define VIFM_ISSET(n,m)((m)&(1<<(n)))
@@ -50,11 +46,9 @@ typedef unsigned short vifi_t;
 #define VIFM_COPY(mfrom,mto)   ((mto)=(mfrom))
 #define VIFM_SAME(m1,m2)   ((m1)==(m2))
 
-/*
- * Passed by mrouted for an MRT_ADD_VIF - again we use the
- * mrouted 3.6 structures for compatibility
+/* Passed by mrouted for an MRT_ADD_VIF - again we use the
+ * mrouted 3.6 structures for compatibility
  */
- 
 struct vifctl {
vifi_t  vifc_vifi;  /* Index of VIF */
unsigned char vifc_flags;   /* VIFF_ flags */
@@ -73,10 +67,7 @@ struct vifctl {
 #define VIFF_USE_IFINDEX   0x8 /* use vifc_lcl_ifindex instead of
   vifc_lcl_addr to find an interface */
 
-/*
- * Cache manipulation structures for mrouted and PIMd
- */
- 
+/* Cache manipulation structures for mrouted and PIMd */
 struct mfcctl {
struct in_addr mfcc_origin; /* Origin of mcast  */
struct in_addr mfcc_mcastgrp;   /* Group in question*/
@@ -88,10 +79,7 @@ struct mfcctl {
int  mfcc_expire;
 };
 
-/* 
- * Group count retrieval for mrouted
- */
- 
+/*  Group count retrieval for mrouted */
 struct sioc_sg_req {
struct in_addr src;
struct in_addr grp;
@@ -100,10 +88,7 @@ struct sioc_sg_req {
unsigned long wrong_if;
 };
 
-/*
- * To get vif packet counts
- */
-
+/* To get vif packet counts */
 struct sioc_vif_req {
vifi_t  vifi;   /* Which iface */
unsigned long icount;   /* In packets */
@@ -112,11 +97,9 @@ struct sioc_vif_req {
unsigned long obytes;   /* Out bytes */
 };
 
-/*
- * This is the format the mroute daemon expects to see IGMP control
- * data. Magically happens to be like an IP packet as per the original
+/* This is the format the mroute daemon expects to see IGMP control
+ * data. Magically happens to be like an IP packet as per the original
  */
- 
 struct igmpmsg {
__u32 unused1,unused2;
unsigned char im_msgtype;   /* What is this */
@@ -126,21 +109,13 @@ struct igmpmsg {
struct in_addr im_src,im_dst;
 };
 
-/*
- * That's all usermode folks
- */
-
-
+/* That's all usermode folks */
 
 #define MFC_ASSERT_THRESH (3*HZ)   /* Maximal freq. of asserts */
 
-/*
- * Pseudo messages used by mrouted
- */
-
+/* Pseudo messages used by mrouted */
 #define IGMPMSG_NOCACHE1   /* Kern cache fill 
request to mrouted */
 #define IGMPMSG_WRONGVIF   2   /* For PIM assert processing 
(unused) */
 #define IGMPMSG_WHOLEPKT   3   /* For PIM Register processing 
*/
 
-
 #endif /* _UAPI__LINUX_MROUTE_H */
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index e153ab7b17a1..286ede3716ee 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -102,9 +102,7 @@ static inline bool pimsm_enabled(void)
 
 static DEFINE_RWLOCK(mrt_lock);
 
-/*
- * Multicast router control variables
- */
+/* Multicast router control variables */
 
 #define VIF_EXISTS(_mrt, _idx) ((_mrt)->vif_table[_idx].dev != NULL)
 
@@ -393,8 +391,7 @@ static void ipmr_del_tunnel(struct net_device *dev, struct 
vifctl *v)
}
 }
 
-static
-struct net_device *ipmr_new_tunnel(struct net *net, struct vifctl *v)