]> err.no Git - linux-2.6/blobdiff - net/core/wireless.c
[NET]: Move sk_setup_caps() out of line.
[linux-2.6] / net / core / wireless.c
index 8f7f3abdb2248db4b1d254d604be3800bb6ee9b3..86db63d7f7602a7cd746ef3d69f9803670375c31 100644 (file)
@@ -349,8 +349,7 @@ static const struct iw_ioctl_description standard_ioctl[] = {
                .max_tokens     = sizeof(struct iw_pmksa),
        },
 };
-static const unsigned standard_ioctl_num = (sizeof(standard_ioctl) /
-                                           sizeof(struct iw_ioctl_description));
+static const unsigned standard_ioctl_num = ARRAY_SIZE(standard_ioctl);
 
 /*
  * Meta-data about all the additional standard Wireless Extension events
@@ -400,8 +399,7 @@ static const struct iw_ioctl_description standard_event[] = {
                .max_tokens     = sizeof(struct iw_pmkid_cand),
        },
 };
-static const unsigned standard_event_num = (sizeof(standard_event) /
-                                           sizeof(struct iw_ioctl_description));
+static const unsigned standard_event_num = ARRAY_SIZE(standard_event);
 
 /* Size (in bytes) of the various private data types */
 static const char iw_priv_type_size[] = {
@@ -680,7 +678,7 @@ static int wireless_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations wireless_seq_ops = {
+static const struct seq_operations wireless_seq_ops = {
        .start = dev_seq_start,
        .next  = dev_seq_next,
        .stop  = dev_seq_stop,
@@ -1940,7 +1938,7 @@ static inline int rtnetlink_fill_iwinfo(struct sk_buff *  skb,
 {
        struct ifinfomsg *r;
        struct nlmsghdr  *nlh;
-       unsigned char    *b = skb->tail;
+       unsigned char    *b = skb_tail_pointer(skb);
 
        nlh = NLMSG_PUT(skb, 0, 0, type, sizeof(*r));
        r = NLMSG_DATA(nlh);
@@ -1954,12 +1952,12 @@ static inline int rtnetlink_fill_iwinfo(struct sk_buff *        skb,
        /* Add the wireless events in the netlink packet */
        RTA_PUT(skb, IFLA_WIRELESS, event_len, event);
 
-       nlh->nlmsg_len = skb->tail - b;
+       nlh->nlmsg_len = skb_tail_pointer(skb) - b;
        return skb->len;
 
 nlmsg_failure:
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        return -1;
 }