netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: "David S. Miller" <davem@davemloft.net>
Cc: tgraf@suug.ch, netdev@oss.sgi.com
Subject: PATCH: explicit typing WAS(Re: PATCH: rtnetlink explicit flags setting
Date: Thu, 02 Jun 2005 09:04:52 -0400	[thread overview]
Message-ID: <1117717493.6050.29.camel@localhost.localdomain> (raw)
In-Reply-To: <20050531.153125.95894437.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On Tue, 2005-31-05 at 15:31 -0700, David S. Miller wrote:
> From: Thomas Graf <tgraf@suug.ch>
> Date: Wed, 1 Jun 2005 00:26:46 +0200
> 
> > > Please use explicit "unsigned int flags" instead of "unsigned flags".
> > 
> > I converted this already in the two patches later in the thread.
> 
> I see, thanks for pointing this out.
> 

If you want to do it right, it should be a u16 actually ;->

In any case since we are being gracious - lets fix where i cutnpasted it
from using TheLinuxWay ;->


-------------
This patch converts "unsigned flags" to use more explict types like u16
instead and incrementally introduces NLMSG_NEW().
 
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> 


cheers,
jamal

[-- Attachment #2: expl_p --]
[-- Type: text/plain, Size: 5145 bytes --]

net/ipv6/addrconf.c: needs update
net/sched/act_api.c: needs update
net/sched/cls_api.c: needs update
net/sched/sch_api.c: needs update
Index: net/ipv6/addrconf.c
===================================================================
--- faa2ccd541211d62ece040534da95da9476d4f14/net/ipv6/addrconf.c  (mode:100644)
+++ uncommitted/net/ipv6/addrconf.c  (mode:100644)
@@ -131,7 +131,7 @@
 
 static int addrconf_ifdown(struct net_device *dev, int how);
 
-static void addrconf_dad_start(struct inet6_ifaddr *ifp, int flags);
+static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags);
 static void addrconf_dad_timer(unsigned long data);
 static void addrconf_dad_completed(struct inet6_ifaddr *ifp);
 static void addrconf_rs_timer(unsigned long data);
@@ -491,7 +491,7 @@
 
 static struct inet6_ifaddr *
 ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
-	      int scope, unsigned flags)
+	      int scope, u32 flags)
 {
 	struct inet6_ifaddr *ifa = NULL;
 	struct rt6_info *rt;
@@ -1319,7 +1319,7 @@
 
 static void
 addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
-		      unsigned long expires, unsigned flags)
+		      unsigned long expires, u32 flags)
 {
 	struct in6_rtmsg rtmsg;
 
@@ -2228,7 +2228,7 @@
 /*
  *	Duplicate Address Detection
  */
-static void addrconf_dad_start(struct inet6_ifaddr *ifp, int flags)
+static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
 {
 	struct inet6_dev *idev = ifp->idev;
 	struct net_device *dev = idev->dev;
@@ -2670,7 +2670,7 @@
 }
 
 static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca,
-				u32 pid, u32 seq, int event, unsigned flags)
+				u32 pid, u32 seq, int event, u16 flags)
 {
 	struct ifaddrmsg *ifm;
 	struct nlmsghdr  *nlh;
Index: net/sched/act_api.c
===================================================================
--- faa2ccd541211d62ece040534da95da9476d4f14/net/sched/act_api.c  (mode:100644)
+++ uncommitted/net/sched/act_api.c  (mode:100644)
@@ -428,15 +428,15 @@
 
 static int
 tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq,
-             unsigned flags, int event, int bind, int ref)
+             u16 flags, int event, int bind, int ref)
 {
 	struct tcamsg *t;
 	struct nlmsghdr *nlh;
 	unsigned char *b = skb->tail;
 	struct rtattr *x;
 
-	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*t));
-	nlh->nlmsg_flags = flags;
+	nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*t), flags);
+
 	t = NLMSG_DATA(nlh);
 	t->tca_family = AF_UNSPEC;
 	
@@ -669,7 +669,7 @@
 }
 
 static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
-                          unsigned flags)
+                          u16 flags)
 {
 	struct tcamsg *t;
 	struct nlmsghdr *nlh;
@@ -684,8 +684,7 @@
 
 	b = (unsigned char *)skb->tail;
 
-	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*t));
-	nlh->nlmsg_flags = flags;
+	nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*t), flags);
 	t = NLMSG_DATA(nlh);
 	t->tca_family = AF_UNSPEC;
 	
Index: net/sched/cls_api.c
===================================================================
--- faa2ccd541211d62ece040534da95da9476d4f14/net/sched/cls_api.c  (mode:100644)
+++ uncommitted/net/sched/cls_api.c  (mode:100644)
@@ -322,14 +322,13 @@
 
 static int
 tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh,
-	      u32 pid, u32 seq, unsigned flags, int event)
+	      u32 pid, u32 seq, u16 flags, int event)
 {
 	struct tcmsg *tcm;
 	struct nlmsghdr  *nlh;
 	unsigned char	 *b = skb->tail;
 
-	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm));
-	nlh->nlmsg_flags = flags;
+	nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
 	tcm->tcm_ifindex = tp->q->dev->ifindex;
Index: net/sched/sch_api.c
===================================================================
--- faa2ccd541211d62ece040534da95da9476d4f14/net/sched/sch_api.c  (mode:100644)
+++ uncommitted/net/sched/sch_api.c  (mode:100644)
@@ -760,15 +760,14 @@
 }
 
 static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
-			 u32 pid, u32 seq, unsigned flags, int event)
+			 u32 pid, u32 seq, u16 flags, int event)
 {
 	struct tcmsg *tcm;
 	struct nlmsghdr  *nlh;
 	unsigned char	 *b = skb->tail;
 	struct gnet_dump d;
 
-	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm));
-	nlh->nlmsg_flags = flags;
+	nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
 	tcm->tcm_ifindex = q->dev->ifindex;
@@ -997,7 +996,7 @@
 
 static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
 			  unsigned long cl,
-			  u32 pid, u32 seq, unsigned flags, int event)
+			  u32 pid, u32 seq, u16 flags, int event)
 {
 	struct tcmsg *tcm;
 	struct nlmsghdr  *nlh;
@@ -1005,8 +1004,7 @@
 	struct gnet_dump d;
 	struct Qdisc_class_ops *cl_ops = q->ops->cl_ops;
 
-	nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm));
-	nlh->nlmsg_flags = flags;
+	nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
 	tcm->tcm_ifindex = q->dev->ifindex;

  reply	other threads:[~2005-06-02 13:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-27 12:32 PATCH: rtnetlink explicit flags setting jamal
2005-05-27 12:50 ` Thomas Graf
2005-05-27 13:58   ` jamal
2005-05-27 14:13     ` Thomas Graf
2005-05-27 15:01       ` jamal
2005-05-27 15:19         ` Thomas Graf
2005-05-27 15:57           ` jamal
2005-05-27 16:59             ` Thomas Graf
2005-05-27 17:00               ` [PATCH 1/2] [NETLINK] Introduce NLMSG_NEW macro to better handle netlink flags Thomas Graf
2005-05-27 17:01               ` [PATCH 2/2] [NETLINK] Correctly set NLM_F_MULTI without checking the pid Thomas Graf
2005-05-28  1:06                 ` jamal
2005-05-31 22:37                 ` David S. Miller
2005-05-28  1:12               ` PATCH: rtnetlink explicit flags setting jamal
2005-05-28  1:28                 ` Thomas Graf
2005-05-28  1:48                   ` jamal
2005-05-28 12:18                     ` Thomas Graf
2005-05-28 16:00                       ` jamal
2005-05-28 16:16                         ` Thomas Graf
2005-05-31  9:39                           ` jamal
2005-05-31  9:41                             ` who 王海
2005-05-31 21:43 ` PATCH: rtnetlink explicit flags setting David S. Miller
2005-05-31 22:26   ` Thomas Graf
2005-05-31 22:31     ` David S. Miller
2005-06-02 13:04       ` jamal [this message]
2005-06-02 13:30         ` PATCH: explicit typing WAS(Re: " jamal
2005-06-03  5:08         ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1117717493.6050.29.camel@localhost.localdomain \
    --to=hadi@cyberus.ca \
    --cc=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).