Commit e431b8c0 authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by David S. Miller

[NETLINK]: Explicit typing

This patch converts "unsigned flags" to use more explict types like u16
instead and incrementally introduces NLMSG_NEW().
Signed-off-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58b82150
...@@ -131,7 +131,7 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); ...@@ -131,7 +131,7 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp);
static int addrconf_ifdown(struct net_device *dev, int how); 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_timer(unsigned long data);
static void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_dad_completed(struct inet6_ifaddr *ifp);
static void addrconf_rs_timer(unsigned long data); static void addrconf_rs_timer(unsigned long data);
...@@ -492,7 +492,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) ...@@ -492,7 +492,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
static struct inet6_ifaddr * static struct inet6_ifaddr *
ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen, 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 inet6_ifaddr *ifa = NULL;
struct rt6_info *rt; struct rt6_info *rt;
...@@ -1320,7 +1320,7 @@ static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpad ...@@ -1320,7 +1320,7 @@ static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpad
static void static void
addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev, 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; struct in6_rtmsg rtmsg;
...@@ -2229,7 +2229,7 @@ static void addrconf_rs_timer(unsigned long data) ...@@ -2229,7 +2229,7 @@ static void addrconf_rs_timer(unsigned long data)
/* /*
* Duplicate Address Detection * 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 inet6_dev *idev = ifp->idev;
struct net_device *dev = idev->dev; struct net_device *dev = idev->dev;
...@@ -2671,7 +2671,7 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa, ...@@ -2671,7 +2671,7 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
} }
static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, 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 ifaddrmsg *ifm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
......
...@@ -428,15 +428,15 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a, ...@@ -428,15 +428,15 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
static int static int
tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, 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 tcamsg *t;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
struct rtattr *x; struct rtattr *x;
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*t)); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*t), flags);
nlh->nlmsg_flags = flags;
t = NLMSG_DATA(nlh); t = NLMSG_DATA(nlh);
t->tca_family = AF_UNSPEC; t->tca_family = AF_UNSPEC;
...@@ -669,7 +669,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) ...@@ -669,7 +669,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event)
} }
static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
unsigned flags) u16 flags)
{ {
struct tcamsg *t; struct tcamsg *t;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
...@@ -684,8 +684,7 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, ...@@ -684,8 +684,7 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
b = (unsigned char *)skb->tail; b = (unsigned char *)skb->tail;
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*t)); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*t), flags);
nlh->nlmsg_flags = flags;
t = NLMSG_DATA(nlh); t = NLMSG_DATA(nlh);
t->tca_family = AF_UNSPEC; t->tca_family = AF_UNSPEC;
......
...@@ -322,14 +322,13 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) ...@@ -322,14 +322,13 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
static int static int
tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh, 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 tcmsg *tcm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm)); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
nlh->nlmsg_flags = flags;
tcm = NLMSG_DATA(nlh); tcm = NLMSG_DATA(nlh);
tcm->tcm_family = AF_UNSPEC; tcm->tcm_family = AF_UNSPEC;
tcm->tcm_ifindex = tp->q->dev->ifindex; tcm->tcm_ifindex = tp->q->dev->ifindex;
......
...@@ -760,15 +760,14 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) ...@@ -760,15 +760,14 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
} }
static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, 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 tcmsg *tcm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
struct gnet_dump d; struct gnet_dump d;
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm)); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
nlh->nlmsg_flags = flags;
tcm = NLMSG_DATA(nlh); tcm = NLMSG_DATA(nlh);
tcm->tcm_family = AF_UNSPEC; tcm->tcm_family = AF_UNSPEC;
tcm->tcm_ifindex = q->dev->ifindex; tcm->tcm_ifindex = q->dev->ifindex;
...@@ -997,7 +996,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg) ...@@ -997,7 +996,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
unsigned long cl, unsigned long cl,
u32 pid, u32 seq, unsigned flags, int event) u32 pid, u32 seq, u16 flags, int event)
{ {
struct tcmsg *tcm; struct tcmsg *tcm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
...@@ -1005,8 +1004,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, ...@@ -1005,8 +1004,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
struct gnet_dump d; struct gnet_dump d;
struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; struct Qdisc_class_ops *cl_ops = q->ops->cl_ops;
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm)); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
nlh->nlmsg_flags = flags;
tcm = NLMSG_DATA(nlh); tcm = NLMSG_DATA(nlh);
tcm->tcm_family = AF_UNSPEC; tcm->tcm_family = AF_UNSPEC;
tcm->tcm_ifindex = q->dev->ifindex; tcm->tcm_ifindex = q->dev->ifindex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment