diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2017-06-16 08:29:23 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-06-16 11:48:40 -0400 |
| commit | d58ff35122847a83ba55394e2ae3a1527b6febf5 (patch) | |
| tree | e1ecf758e86519922c403f1aa88f19ef25a554ad | |
| parent | af72868b9070d1b843c829f0d0d0b22c04a20815 (diff) | |
networking: make skb_push & __skb_push return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
126 files changed, 204 insertions, 234 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 4fc99ae1c534..c8f2ca6d8b29 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
| @@ -1174,7 +1174,7 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb) | |||
| 1174 | } | 1174 | } |
| 1175 | } | 1175 | } |
| 1176 | 1176 | ||
| 1177 | header = (void *)skb_push(skb, sizeof(*header)); | 1177 | header = skb_push(skb, sizeof(*header)); |
| 1178 | 1178 | ||
| 1179 | /* This does _not_ include the size of the header */ | 1179 | /* This does _not_ include the size of the header */ |
| 1180 | header->size = cpu_to_le16(pktlen); | 1180 | header->size = cpu_to_le16(pktlen); |
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index a9932fe57d92..48d10cb5c9a1 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
| @@ -297,7 +297,7 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 297 | return -ENOMEM; | 297 | return -ENOMEM; |
| 298 | 298 | ||
| 299 | /* Prepend skb with frame type */ | 299 | /* Prepend skb with frame type */ |
| 300 | *skb_push(skb, 1) = hci_skb_pkt_type(skb); | 300 | *(u8 *)skb_push(skb, 1) = hci_skb_pkt_type(skb); |
| 301 | 301 | ||
| 302 | switch (hci_skb_pkt_type(skb)) { | 302 | switch (hci_skb_pkt_type(skb)) { |
| 303 | case HCI_COMMAND_PKT: | 303 | case HCI_COMMAND_PKT: |
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index d5040bbd34e8..242359c2d1f1 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
| @@ -219,7 +219,7 @@ static int fwnet_header_create(struct sk_buff *skb, struct net_device *net, | |||
| 219 | { | 219 | { |
| 220 | struct fwnet_header *h; | 220 | struct fwnet_header *h; |
| 221 | 221 | ||
| 222 | h = (struct fwnet_header *)skb_push(skb, sizeof(*h)); | 222 | h = skb_push(skb, sizeof(*h)); |
| 223 | put_unaligned_be16(type, &h->h_proto); | 223 | put_unaligned_be16(type, &h->h_proto); |
| 224 | 224 | ||
| 225 | if (net->flags & (IFF_LOOPBACK | IFF_NOARP)) { | 225 | if (net->flags & (IFF_LOOPBACK | IFF_NOARP)) { |
| @@ -961,16 +961,14 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) | |||
| 961 | tx_len = ptask->max_payload; | 961 | tx_len = ptask->max_payload; |
| 962 | switch (fwnet_get_hdr_lf(&ptask->hdr)) { | 962 | switch (fwnet_get_hdr_lf(&ptask->hdr)) { |
| 963 | case RFC2374_HDR_UNFRAG: | 963 | case RFC2374_HDR_UNFRAG: |
| 964 | bufhdr = (struct rfc2734_header *) | 964 | bufhdr = skb_push(ptask->skb, RFC2374_UNFRAG_HDR_SIZE); |
| 965 | skb_push(ptask->skb, RFC2374_UNFRAG_HDR_SIZE); | ||
| 966 | put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); | 965 | put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); |
| 967 | break; | 966 | break; |
| 968 | 967 | ||
| 969 | case RFC2374_HDR_FIRSTFRAG: | 968 | case RFC2374_HDR_FIRSTFRAG: |
| 970 | case RFC2374_HDR_INTFRAG: | 969 | case RFC2374_HDR_INTFRAG: |
| 971 | case RFC2374_HDR_LASTFRAG: | 970 | case RFC2374_HDR_LASTFRAG: |
| 972 | bufhdr = (struct rfc2734_header *) | 971 | bufhdr = skb_push(ptask->skb, RFC2374_FRAG_HDR_SIZE); |
| 973 | skb_push(ptask->skb, RFC2374_FRAG_HDR_SIZE); | ||
| 974 | put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); | 972 | put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); |
| 975 | put_unaligned_be32(ptask->hdr.w1, &bufhdr->w1); | 973 | put_unaligned_be32(ptask->hdr.w1, &bufhdr->w1); |
| 976 | break; | 974 | break; |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 9ae518c01bc2..86975370a4c0 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
| @@ -513,7 +513,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb) | |||
| 513 | set_arp_failure_handler(skb, arp_failure_discard); | 513 | set_arp_failure_handler(skb, arp_failure_discard); |
| 514 | skb_reset_transport_header(skb); | 514 | skb_reset_transport_header(skb); |
| 515 | len = skb->len; | 515 | len = skb->len; |
| 516 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 516 | req = skb_push(skb, sizeof(*req)); |
| 517 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); | 517 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); |
| 518 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); | 518 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); |
| 519 | req->len = htonl(len); | 519 | req->len = htonl(len); |
| @@ -564,7 +564,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen) | |||
| 564 | skb->priority = CPL_PRIORITY_DATA; | 564 | skb->priority = CPL_PRIORITY_DATA; |
| 565 | set_arp_failure_handler(skb, arp_failure_discard); | 565 | set_arp_failure_handler(skb, arp_failure_discard); |
| 566 | skb_reset_transport_header(skb); | 566 | skb_reset_transport_header(skb); |
| 567 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 567 | req = skb_push(skb, sizeof(*req)); |
| 568 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); | 568 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); |
| 569 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); | 569 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); |
| 570 | req->len = htonl(mpalen); | 570 | req->len = htonl(mpalen); |
| @@ -615,7 +615,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen) | |||
| 615 | set_arp_failure_handler(skb, arp_failure_discard); | 615 | set_arp_failure_handler(skb, arp_failure_discard); |
| 616 | skb_reset_transport_header(skb); | 616 | skb_reset_transport_header(skb); |
| 617 | len = skb->len; | 617 | len = skb->len; |
| 618 | req = (struct tx_data_wr *) skb_push(skb, sizeof(*req)); | 618 | req = skb_push(skb, sizeof(*req)); |
| 619 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); | 619 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)|F_WR_COMPL); |
| 620 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); | 620 | req->wr_lo = htonl(V_WR_TID(ep->hwtid)); |
| 621 | req->len = htonl(len); | 621 | req->len = htonl(len); |
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 36ae3023e703..76fb39415e18 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
| @@ -3751,7 +3751,7 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos) | |||
| 3751 | tcp_clear_options(&tmp_opt); | 3751 | tcp_clear_options(&tmp_opt); |
| 3752 | tcp_parse_options(&init_net, skb, &tmp_opt, 0, NULL); | 3752 | tcp_parse_options(&init_net, skb, &tmp_opt, 0, NULL); |
| 3753 | 3753 | ||
| 3754 | req = (struct cpl_pass_accept_req *)__skb_push(skb, sizeof(*req)); | 3754 | req = __skb_push(skb, sizeof(*req)); |
| 3755 | memset(req, 0, sizeof(*req)); | 3755 | memset(req, 0, sizeof(*req)); |
| 3756 | req->l2info = cpu_to_be16(SYN_INTF_V(intf) | | 3756 | req->l2info = cpu_to_be16(SYN_INTF_V(intf) | |
| 3757 | SYN_MAC_IDX_V(RX_MACIDX_G( | 3757 | SYN_MAC_IDX_V(RX_MACIDX_G( |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index a115c0b7a310..5da6f2e9f22e 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -681,7 +681,7 @@ static void push_pseudo_header(struct sk_buff *skb, const char *daddr) | |||
| 681 | { | 681 | { |
| 682 | struct ipoib_pseudo_header *phdr; | 682 | struct ipoib_pseudo_header *phdr; |
| 683 | 683 | ||
| 684 | phdr = (struct ipoib_pseudo_header *)skb_push(skb, sizeof(*phdr)); | 684 | phdr = skb_push(skb, sizeof(*phdr)); |
| 685 | memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); | 685 | memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); |
| 686 | } | 686 | } |
| 687 | 687 | ||
| @@ -1129,7 +1129,7 @@ static int ipoib_hard_header(struct sk_buff *skb, | |||
| 1129 | { | 1129 | { |
| 1130 | struct ipoib_header *header; | 1130 | struct ipoib_header *header; |
| 1131 | 1131 | ||
| 1132 | header = (struct ipoib_header *) skb_push(skb, sizeof *header); | 1132 | header = skb_push(skb, sizeof *header); |
| 1133 | 1133 | ||
| 1134 | header->proto = htons(type); | 1134 | header->proto = htons(type); |
| 1135 | header->reserved = 0; | 1135 | header->reserved = 0; |
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c index 2e8fee982436..afa938bd26d6 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.c | |||
| @@ -460,7 +460,7 @@ void opa_vnic_encap_skb(struct opa_vnic_adapter *adapter, struct sk_buff *skb) | |||
| 460 | sc = opa_vnic_get_sc(info, skb); | 460 | sc = opa_vnic_get_sc(info, skb); |
| 461 | l4_hdr = info->vesw.vesw_id; | 461 | l4_hdr = info->vesw.vesw_id; |
| 462 | 462 | ||
| 463 | mdata = (struct opa_vnic_skb_mdata *)skb_push(skb, sizeof(*mdata)); | 463 | mdata = skb_push(skb, sizeof(*mdata)); |
| 464 | mdata->vl = opa_vnic_get_vl(adapter, skb); | 464 | mdata->vl = opa_vnic_get_vl(adapter, skb); |
| 465 | mdata->entropy = entropy; | 465 | mdata->entropy = entropy; |
| 466 | mdata->flags = 0; | 466 | mdata->flags = 0; |
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c index 905f39dda5aa..fcf75323d62a 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c | |||
| @@ -103,7 +103,7 @@ static u16 opa_vnic_select_queue(struct net_device *netdev, struct sk_buff *skb, | |||
| 103 | int rc; | 103 | int rc; |
| 104 | 104 | ||
| 105 | /* pass entropy and vl as metadata in skb */ | 105 | /* pass entropy and vl as metadata in skb */ |
| 106 | mdata = (struct opa_vnic_skb_mdata *)skb_push(skb, sizeof(*mdata)); | 106 | mdata = skb_push(skb, sizeof(*mdata)); |
| 107 | mdata->entropy = opa_vnic_calc_entropy(adapter, skb); | 107 | mdata->entropy = opa_vnic_calc_entropy(adapter, skb); |
| 108 | mdata->vl = opa_vnic_get_vl(adapter, skb); | 108 | mdata->vl = opa_vnic_get_vl(adapter, skb); |
| 109 | rc = adapter->rn_ops->ndo_select_queue(netdev, skb, | 109 | rc = adapter->rn_ops->ndo_select_queue(netdev, skb, |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index e26cae9baf17..b7e3f1cde683 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
| @@ -1312,7 +1312,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
| 1312 | /* check if we should pass this packet | 1312 | /* check if we should pass this packet |
| 1313 | * the filter instructions are constructed assuming | 1313 | * the filter instructions are constructed assuming |
| 1314 | * a four-byte PPP header on each packet */ | 1314 | * a four-byte PPP header on each packet */ |
| 1315 | *skb_push(skb, 4) = 1; /* indicate outbound */ | 1315 | *(u8 *)skb_push(skb, 4) = 1; /* indicate outbound */ |
| 1316 | 1316 | ||
| 1317 | { | 1317 | { |
| 1318 | __be16 *p = (__be16 *)skb->data; | 1318 | __be16 *p = (__be16 *)skb->data; |
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index d78f30186642..8c651fdee039 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
| @@ -85,7 +85,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
| 85 | unsigned short type, uint8_t daddr) | 85 | unsigned short type, uint8_t daddr) |
| 86 | { | 86 | { |
| 87 | int hdr_size = ARC_HDR_SIZE; | 87 | int hdr_size = ARC_HDR_SIZE; |
| 88 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 88 | struct archdr *pkt = skb_push(skb, hdr_size); |
| 89 | 89 | ||
| 90 | /* Set the source hardware address. | 90 | /* Set the source hardware address. |
| 91 | * | 91 | * |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 2056878fb087..a80f4eb9262d 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
| @@ -101,7 +101,7 @@ static int build_header(struct sk_buff *skb, | |||
| 101 | uint8_t daddr) | 101 | uint8_t daddr) |
| 102 | { | 102 | { |
| 103 | int hdr_size = ARC_HDR_SIZE; | 103 | int hdr_size = ARC_HDR_SIZE; |
| 104 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 104 | struct archdr *pkt = skb_push(skb, hdr_size); |
| 105 | 105 | ||
| 106 | arc_printk(D_PROTO, dev, "Preparing header for cap packet %x.\n", | 106 | arc_printk(D_PROTO, dev, "Preparing header for cap packet %x.\n", |
| 107 | *((int *)&pkt->soft.cap.cookie[0])); | 107 | *((int *)&pkt->soft.cap.cookie[0])); |
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index 4b1a75469cb1..a7752a5b647f 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c | |||
| @@ -162,7 +162,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
| 162 | unsigned short type, uint8_t daddr) | 162 | unsigned short type, uint8_t daddr) |
| 163 | { | 163 | { |
| 164 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; | 164 | int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; |
| 165 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 165 | struct archdr *pkt = skb_push(skb, hdr_size); |
| 166 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; | 166 | struct arc_rfc1051 *soft = &pkt->soft.rfc1051; |
| 167 | 167 | ||
| 168 | /* set the protocol ID according to RFC1051 */ | 168 | /* set the protocol ID according to RFC1051 */ |
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index 566da5ecdc9d..a4c856282674 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c | |||
| @@ -379,7 +379,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
| 379 | { | 379 | { |
| 380 | struct arcnet_local *lp = netdev_priv(dev); | 380 | struct arcnet_local *lp = netdev_priv(dev); |
| 381 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; | 381 | int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; |
| 382 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 382 | struct archdr *pkt = skb_push(skb, hdr_size); |
| 383 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; | 383 | struct arc_rfc1201 *soft = &pkt->soft.rfc1201; |
| 384 | 384 | ||
| 385 | /* set the protocol ID according to RFC1201 */ | 385 | /* set the protocol ID according to RFC1201 */ |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 5274501428e4..5333601f855f 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
| @@ -1099,7 +1099,7 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb, | |||
| 1099 | skb = nskb; | 1099 | skb = nskb; |
| 1100 | } | 1100 | } |
| 1101 | 1101 | ||
| 1102 | tsb = (struct bcm_tsb *)skb_push(skb, sizeof(*tsb)); | 1102 | tsb = skb_push(skb, sizeof(*tsb)); |
| 1103 | /* Zero-out TSB by default */ | 1103 | /* Zero-out TSB by default */ |
| 1104 | memset(tsb, 0, sizeof(*tsb)); | 1104 | memset(tsb, 0, sizeof(*tsb)); |
| 1105 | 1105 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index d56142b98534..0f13a7f7c1d3 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c | |||
| @@ -1801,7 +1801,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1801 | eth_type = skb_network_offset(skb) == ETH_HLEN ? | 1801 | eth_type = skb_network_offset(skb) == ETH_HLEN ? |
| 1802 | CPL_ETH_II : CPL_ETH_II_VLAN; | 1802 | CPL_ETH_II : CPL_ETH_II_VLAN; |
| 1803 | 1803 | ||
| 1804 | hdr = (struct cpl_tx_pkt_lso *)skb_push(skb, sizeof(*hdr)); | 1804 | hdr = skb_push(skb, sizeof(*hdr)); |
| 1805 | hdr->opcode = CPL_TX_PKT_LSO; | 1805 | hdr->opcode = CPL_TX_PKT_LSO; |
| 1806 | hdr->ip_csum_dis = hdr->l4_csum_dis = 0; | 1806 | hdr->ip_csum_dis = hdr->l4_csum_dis = 0; |
| 1807 | hdr->ip_hdr_words = ip_hdr(skb)->ihl; | 1807 | hdr->ip_hdr_words = ip_hdr(skb)->ihl; |
| @@ -1849,7 +1849,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1849 | } | 1849 | } |
| 1850 | } | 1850 | } |
| 1851 | 1851 | ||
| 1852 | cpl = (struct cpl_tx_pkt *)__skb_push(skb, sizeof(*cpl)); | 1852 | cpl = __skb_push(skb, sizeof(*cpl)); |
| 1853 | cpl->opcode = CPL_TX_PKT; | 1853 | cpl->opcode = CPL_TX_PKT; |
| 1854 | cpl->ip_csum_dis = 1; /* SW calculates IP csum */ | 1854 | cpl->ip_csum_dis = 1; /* SW calculates IP csum */ |
| 1855 | cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_PARTIAL ? 0 : 1; | 1855 | cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_PARTIAL ? 0 : 1; |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 0ff166ec3e7e..a79e257bc338 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
| @@ -2250,7 +2250,7 @@ static int gfar_enet_open(struct net_device *dev) | |||
| 2250 | 2250 | ||
| 2251 | static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb) | 2251 | static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb) |
| 2252 | { | 2252 | { |
| 2253 | struct txfcb *fcb = (struct txfcb *)skb_push(skb, GMAC_FCB_LEN); | 2253 | struct txfcb *fcb = skb_push(skb, GMAC_FCB_LEN); |
| 2254 | 2254 | ||
| 2255 | memset(fcb, 0, GMAC_FCB_LEN); | 2255 | memset(fcb, 0, GMAC_FCB_LEN); |
| 2256 | 2256 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c index c456ca07b562..898759fcf9ec 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c | |||
| @@ -132,7 +132,7 @@ static struct sk_buff *mlx5e_test_get_udp_skb(struct mlx5e_priv *priv) | |||
| 132 | skb_reserve(skb, NET_IP_ALIGN); | 132 | skb_reserve(skb, NET_IP_ALIGN); |
| 133 | 133 | ||
| 134 | /* Reserve for ethernet and IP header */ | 134 | /* Reserve for ethernet and IP header */ |
| 135 | ethh = (struct ethhdr *)skb_push(skb, ETH_HLEN); | 135 | ethh = skb_push(skb, ETH_HLEN); |
| 136 | skb_reset_mac_header(skb); | 136 | skb_reset_mac_header(skb); |
| 137 | 137 | ||
| 138 | skb_set_network_header(skb, skb->len); | 138 | skb_set_network_header(skb, skb->len); |
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 2dcca249eb9c..46cb7f8955a2 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
| @@ -6667,7 +6667,7 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb, | |||
| 6667 | headroom = align + sizeof(struct tx_pkt_hdr); | 6667 | headroom = align + sizeof(struct tx_pkt_hdr); |
| 6668 | 6668 | ||
| 6669 | ehdr = (struct ethhdr *) skb->data; | 6669 | ehdr = (struct ethhdr *) skb->data; |
| 6670 | tp = (struct tx_pkt_hdr *) skb_push(skb, headroom); | 6670 | tp = skb_push(skb, headroom); |
| 6671 | 6671 | ||
| 6672 | len = skb->len - sizeof(struct tx_pkt_hdr); | 6672 | len = skb->len - sizeof(struct tx_pkt_hdr); |
| 6673 | tp->flags = cpu_to_le64(niu_compute_tx_flags(skb, ehdr, align, len)); | 6673 | tp->flags = cpu_to_le64(niu_compute_tx_flags(skb, ehdr, align, len)); |
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c index fa6a06571187..88d74aef218a 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c | |||
| @@ -754,7 +754,7 @@ static struct sk_buff *gelic_put_vlan_tag(struct sk_buff *skb, | |||
| 754 | return NULL; | 754 | return NULL; |
| 755 | dev_kfree_skb_any(sk_tmp); | 755 | dev_kfree_skb_any(sk_tmp); |
| 756 | } | 756 | } |
| 757 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); | 757 | veth = skb_push(skb, VLAN_HLEN); |
| 758 | 758 | ||
| 759 | /* Move the mac addresses to the top of buffer */ | 759 | /* Move the mac addresses to the top of buffer */ |
| 760 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); | 760 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); |
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 7bcf1b52020e..d586ad93aaff 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c | |||
| @@ -687,8 +687,7 @@ static int geneve_build_skb(struct dst_entry *dst, struct sk_buff *skb, | |||
| 687 | if (err) | 687 | if (err) |
| 688 | goto free_dst; | 688 | goto free_dst; |
| 689 | 689 | ||
| 690 | gnvh = (struct genevehdr *)__skb_push(skb, sizeof(*gnvh) + | 690 | gnvh = __skb_push(skb, sizeof(*gnvh) + info->options_len); |
| 691 | info->options_len); | ||
| 692 | geneve_build_header(gnvh, info); | 691 | geneve_build_header(gnvh, info); |
| 693 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); | 692 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); |
| 694 | return 0; | 693 | return 0; |
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index ca110cd2a4e4..8e333a8a2295 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c | |||
| @@ -398,7 +398,7 @@ static inline void gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) | |||
| 398 | int payload_len = skb->len; | 398 | int payload_len = skb->len; |
| 399 | struct gtp0_header *gtp0; | 399 | struct gtp0_header *gtp0; |
| 400 | 400 | ||
| 401 | gtp0 = (struct gtp0_header *) skb_push(skb, sizeof(*gtp0)); | 401 | gtp0 = skb_push(skb, sizeof(*gtp0)); |
| 402 | 402 | ||
| 403 | gtp0->flags = 0x1e; /* v0, GTP-non-prime. */ | 403 | gtp0->flags = 0x1e; /* v0, GTP-non-prime. */ |
| 404 | gtp0->type = GTP_TPDU; | 404 | gtp0->type = GTP_TPDU; |
| @@ -415,7 +415,7 @@ static inline void gtp1_push_header(struct sk_buff *skb, struct pdp_ctx *pctx) | |||
| 415 | int payload_len = skb->len; | 415 | int payload_len = skb->len; |
| 416 | struct gtp1_header *gtp1; | 416 | struct gtp1_header *gtp1; |
| 417 | 417 | ||
| 418 | gtp1 = (struct gtp1_header *) skb_push(skb, sizeof(*gtp1)); | 418 | gtp1 = skb_push(skb, sizeof(*gtp1)); |
| 419 | 419 | ||
| 420 | /* Bits 8 7 6 5 4 3 2 1 | 420 | /* Bits 8 7 6 5 4 3 2 1 |
| 421 | * +--+--+--+--+--+--+--+--+ | 421 | * +--+--+--+--+--+--+--+--+ |
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c index 7683fd544344..71ddadbf2368 100644 --- a/drivers/net/hippi/rrunner.c +++ b/drivers/net/hippi/rrunner.c | |||
| @@ -1422,7 +1422,7 @@ static netdev_tx_t rr_start_xmit(struct sk_buff *skb, | |||
| 1422 | skb = new_skb; | 1422 | skb = new_skb; |
| 1423 | } | 1423 | } |
| 1424 | 1424 | ||
| 1425 | ifield = (u32 *)skb_push(skb, 8); | 1425 | ifield = skb_push(skb, 8); |
| 1426 | 1426 | ||
| 1427 | ifield[0] = 0; | 1427 | ifield[0] = 0; |
| 1428 | ifield[1] = hcb->ifield; | 1428 | ifield[1] = hcb->ifield; |
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 2067dcc71535..e370d7c894cb 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c | |||
| @@ -697,7 +697,7 @@ static struct sk_buff *macsec_encrypt(struct sk_buff *skb, | |||
| 697 | unprotected_len = skb->len; | 697 | unprotected_len = skb->len; |
| 698 | eth = eth_hdr(skb); | 698 | eth = eth_hdr(skb); |
| 699 | sci_present = send_sci(secy); | 699 | sci_present = send_sci(secy); |
| 700 | hh = (struct macsec_eth_header *)skb_push(skb, macsec_extra_len(sci_present)); | 700 | hh = skb_push(skb, macsec_extra_len(sci_present)); |
| 701 | memmove(hh, eth, 2 * ETH_ALEN); | 701 | memmove(hh, eth, 2 * ETH_ALEN); |
| 702 | 702 | ||
| 703 | pn = tx_sa_update_pn(tx_sa, secy); | 703 | pn = tx_sa_update_pn(tx_sa, secy); |
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c index 32c72db654e2..814fd8fae67d 100644 --- a/drivers/net/ppp/ppp_async.c +++ b/drivers/net/ppp/ppp_async.c | |||
| @@ -802,7 +802,7 @@ process_input_packet(struct asyncppp *ap) | |||
| 802 | proto = p[0]; | 802 | proto = p[0]; |
| 803 | if (proto & 1) { | 803 | if (proto & 1) { |
| 804 | /* protocol is compressed */ | 804 | /* protocol is compressed */ |
| 805 | skb_push(skb, 1)[0] = 0; | 805 | *(u8 *)skb_push(skb, 1) = 0; |
| 806 | } else { | 806 | } else { |
| 807 | if (skb->len < 2) | 807 | if (skb->len < 2) |
| 808 | goto err; | 808 | goto err; |
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index bbded33120fe..d42091f11eb8 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
| @@ -1490,7 +1490,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb) | |||
| 1490 | /* check if we should pass this packet */ | 1490 | /* check if we should pass this packet */ |
| 1491 | /* the filter instructions are constructed assuming | 1491 | /* the filter instructions are constructed assuming |
| 1492 | a four-byte PPP header on each packet */ | 1492 | a four-byte PPP header on each packet */ |
| 1493 | *skb_push(skb, 2) = 1; | 1493 | *(u8 *)skb_push(skb, 2) = 1; |
| 1494 | if (ppp->pass_filter && | 1494 | if (ppp->pass_filter && |
| 1495 | BPF_PROG_RUN(ppp->pass_filter, skb) == 0) { | 1495 | BPF_PROG_RUN(ppp->pass_filter, skb) == 0) { |
| 1496 | if (ppp->debug & 1) | 1496 | if (ppp->debug & 1) |
| @@ -2133,7 +2133,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb) | |||
| 2133 | if (skb_unclone(skb, GFP_ATOMIC)) | 2133 | if (skb_unclone(skb, GFP_ATOMIC)) |
| 2134 | goto err; | 2134 | goto err; |
| 2135 | 2135 | ||
| 2136 | *skb_push(skb, 2) = 0; | 2136 | *(u8 *)skb_push(skb, 2) = 0; |
| 2137 | if (ppp->pass_filter && | 2137 | if (ppp->pass_filter && |
| 2138 | BPF_PROG_RUN(ppp->pass_filter, skb) == 0) { | 2138 | BPF_PROG_RUN(ppp->pass_filter, skb) == 0) { |
| 2139 | if (ppp->debug & 1) | 2139 | if (ppp->debug & 1) |
| @@ -2267,7 +2267,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
| 2267 | * Do protocol ID decompression on the first fragment of each packet. | 2267 | * Do protocol ID decompression on the first fragment of each packet. |
| 2268 | */ | 2268 | */ |
| 2269 | if ((PPP_MP_CB(skb)->BEbits & B) && (skb->data[0] & 1)) | 2269 | if ((PPP_MP_CB(skb)->BEbits & B) && (skb->data[0] & 1)) |
| 2270 | *skb_push(skb, 1) = 0; | 2270 | *(u8 *)skb_push(skb, 1) = 0; |
| 2271 | 2271 | ||
| 2272 | /* | 2272 | /* |
| 2273 | * Expand sequence number to 32 bits, making it as close | 2273 | * Expand sequence number to 32 bits, making it as close |
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c index ce2300c0bcbf..ef08590db873 100644 --- a/drivers/net/ppp/ppp_synctty.c +++ b/drivers/net/ppp/ppp_synctty.c | |||
| @@ -711,7 +711,7 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf, | |||
| 711 | /* decompress protocol field if compressed */ | 711 | /* decompress protocol field if compressed */ |
| 712 | if (p[0] & 1) { | 712 | if (p[0] & 1) { |
| 713 | /* protocol is compressed */ | 713 | /* protocol is compressed */ |
| 714 | skb_push(skb, 1)[0] = 0; | 714 | *(u8 *)skb_push(skb, 1) = 0; |
| 715 | } else if (skb->len < 2) | 715 | } else if (skb->len < 2) |
| 716 | goto err; | 716 | goto err; |
| 717 | 717 | ||
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c index 1951b1085cb8..2f22e318a67f 100644 --- a/drivers/net/ppp/pptp.c +++ b/drivers/net/ppp/pptp.c | |||
| @@ -328,7 +328,7 @@ allow_packet: | |||
| 328 | 328 | ||
| 329 | if ((*skb->data) & 1) { | 329 | if ((*skb->data) & 1) { |
| 330 | /* protocol is compressed */ | 330 | /* protocol is compressed */ |
| 331 | skb_push(skb, 1)[0] = 0; | 331 | *(u8 *)skb_push(skb, 1) = 0; |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | skb->ip_summed = CHECKSUM_NONE; | 334 | skb->ip_summed = CHECKSUM_NONE; |
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c index 29276e54bb8b..ba1ce1006c4f 100644 --- a/drivers/net/usb/gl620a.c +++ b/drivers/net/usb/gl620a.c | |||
| @@ -174,7 +174,7 @@ genelink_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | // attach the packet count to the header | 176 | // attach the packet count to the header |
| 177 | packet_count = (__le32 *) skb_push(skb, (4 + 4*1)); | 177 | packet_count = skb_push(skb, (4 + 4 * 1)); |
| 178 | packet_len = packet_count + 1; | 178 | packet_len = packet_count + 1; |
| 179 | 179 | ||
| 180 | *packet_count = cpu_to_le32(1); | 180 | *packet_count = cpu_to_le32(1); |
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c index 5a43b77a6b9c..be63a829b8fe 100644 --- a/drivers/net/usb/int51x1.c +++ b/drivers/net/usb/int51x1.c | |||
| @@ -106,7 +106,7 @@ static struct sk_buff *int51x1_tx_fixup(struct usbnet *dev, | |||
| 106 | pack_len += need_tail; | 106 | pack_len += need_tail; |
| 107 | pack_len &= 0x07ff; | 107 | pack_len &= 0x07ff; |
| 108 | 108 | ||
| 109 | len = (__le16 *) __skb_push(skb, INT51X1_HEADER_SIZE); | 109 | len = __skb_push(skb, INT51X1_HEADER_SIZE); |
| 110 | *len = cpu_to_le16(pack_len); | 110 | *len = cpu_to_le16(pack_len); |
| 111 | 111 | ||
| 112 | if(need_tail) | 112 | if(need_tail) |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 37fb621fde86..92e4fd29ae44 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
| @@ -809,7 +809,7 @@ static netdev_tx_t kaweth_start_xmit(struct sk_buff *skb, | |||
| 809 | return NETDEV_TX_OK; | 809 | return NETDEV_TX_OK; |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | private_header = (__le16 *)__skb_push(skb, 2); | 812 | private_header = __skb_push(skb, 2); |
| 813 | *private_header = cpu_to_le16(skb->len-2); | 813 | *private_header = cpu_to_le16(skb->len-2); |
| 814 | kaweth->tx_skb = skb; | 814 | kaweth->tx_skb = skb; |
| 815 | 815 | ||
diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c index d633492bf9eb..dbabd7ca5268 100644 --- a/drivers/net/usb/lg-vl600.c +++ b/drivers/net/usb/lg-vl600.c | |||
| @@ -304,7 +304,7 @@ encapsulate: | |||
| 304 | memset(&packet->dummy, 0, sizeof(packet->dummy)); | 304 | memset(&packet->dummy, 0, sizeof(packet->dummy)); |
| 305 | packet->len = cpu_to_le32(orig_len); | 305 | packet->len = cpu_to_le32(orig_len); |
| 306 | 306 | ||
| 307 | frame = (struct vl600_frame_hdr *) skb_push(skb, sizeof(*frame)); | 307 | frame = skb_push(skb, sizeof(*frame)); |
| 308 | memset(frame, 0, sizeof(*frame)); | 308 | memset(frame, 0, sizeof(*frame)); |
| 309 | frame->len = cpu_to_le32(full_len); | 309 | frame->len = cpu_to_le32(full_len); |
| 310 | frame->serial = cpu_to_le32(serial++); | 310 | frame->serial = cpu_to_le32(serial++); |
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index 861ff45f0b09..be53ff30b7b5 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
| @@ -466,7 +466,7 @@ net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
| 466 | 466 | ||
| 467 | encapsulate: | 467 | encapsulate: |
| 468 | /* header first */ | 468 | /* header first */ |
| 469 | header = (struct nc_header *) skb_push(skb, sizeof *header); | 469 | header = skb_push(skb, sizeof *header); |
| 470 | header->hdr_len = cpu_to_le16(sizeof (*header)); | 470 | header->hdr_len = cpu_to_le16(sizeof (*header)); |
| 471 | header->packet_len = cpu_to_le16(len); | 471 | header->packet_len = cpu_to_le16(len); |
| 472 | header->packet_id = cpu_to_le16((u16)dev->xid++); | 472 | header->packet_id = cpu_to_le16((u16)dev->xid++); |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index ffd229ec8352..5894e3c9468f 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -101,7 +101,7 @@ static netdev_tx_t qmimux_start_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 101 | unsigned int len = skb->len; | 101 | unsigned int len = skb->len; |
| 102 | struct qmimux_hdr *hdr; | 102 | struct qmimux_hdr *hdr; |
| 103 | 103 | ||
| 104 | hdr = (struct qmimux_hdr *)skb_push(skb, sizeof(struct qmimux_hdr)); | 104 | hdr = skb_push(skb, sizeof(struct qmimux_hdr)); |
| 105 | hdr->pad = 0; | 105 | hdr->pad = 0; |
| 106 | hdr->mux_id = priv->mux_id; | 106 | hdr->mux_id = priv->mux_id; |
| 107 | hdr->pkt_len = cpu_to_be16(len); | 107 | hdr->pkt_len = cpu_to_be16(len); |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index e96e2e5673d7..a151f267aebb 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
| @@ -578,7 +578,7 @@ rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
| 578 | * packets; Linux minimizes wasted bandwidth through tx queues. | 578 | * packets; Linux minimizes wasted bandwidth through tx queues. |
| 579 | */ | 579 | */ |
| 580 | fill: | 580 | fill: |
| 581 | hdr = (void *) __skb_push(skb, sizeof *hdr); | 581 | hdr = __skb_push(skb, sizeof *hdr); |
| 582 | memset(hdr, 0, sizeof *hdr); | 582 | memset(hdr, 0, sizeof *hdr); |
| 583 | hdr->msg_type = cpu_to_le32(RNDIS_MSG_PACKET); | 583 | hdr->msg_type = cpu_to_le32(RNDIS_MSG_PACKET); |
| 584 | hdr->msg_len = cpu_to_le32(skb->len); | 584 | hdr->msg_len = cpu_to_le32(skb->len); |
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 022c0b5f9844..c6c0595d267b 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c | |||
| @@ -383,7 +383,7 @@ static int vrf_finish_direct(struct net *net, struct sock *sk, | |||
| 383 | 383 | ||
| 384 | if (!list_empty(&vrf_dev->ptype_all) && | 384 | if (!list_empty(&vrf_dev->ptype_all) && |
| 385 | likely(skb_headroom(skb) >= ETH_HLEN)) { | 385 | likely(skb_headroom(skb) >= ETH_HLEN)) { |
| 386 | struct ethhdr *eth = (struct ethhdr *)skb_push(skb, ETH_HLEN); | 386 | struct ethhdr *eth = skb_push(skb, ETH_HLEN); |
| 387 | 387 | ||
| 388 | ether_addr_copy(eth->h_source, vrf_dev->dev_addr); | 388 | ether_addr_copy(eth->h_source, vrf_dev->dev_addr); |
| 389 | eth_zero_addr(eth->h_dest); | 389 | eth_zero_addr(eth->h_dest); |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 4e1d427d340c..94ce98229828 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
| @@ -1827,7 +1827,7 @@ static int vxlan_build_skb(struct sk_buff *skb, struct dst_entry *dst, | |||
| 1827 | if (err) | 1827 | if (err) |
| 1828 | return err; | 1828 | return err; |
| 1829 | 1829 | ||
| 1830 | vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); | 1830 | vxh = __skb_push(skb, sizeof(*vxh)); |
| 1831 | vxh->vx_flags = VXLAN_HF_VNI; | 1831 | vxh->vx_flags = VXLAN_HF_VNI; |
| 1832 | vxh->vx_vni = vxlan_vni_field(vni); | 1832 | vxh->vx_vni = vxlan_vni_field(vni); |
| 1833 | 1833 | ||
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index dd7f3168c07d..a654687b5fa2 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
| @@ -221,7 +221,7 @@ void i2400m_tx_prep_header(struct sk_buff *skb) | |||
| 221 | { | 221 | { |
| 222 | struct i2400m_pl_data_hdr *pl_hdr; | 222 | struct i2400m_pl_data_hdr *pl_hdr; |
| 223 | skb_pull(skb, ETH_HLEN); | 223 | skb_pull(skb, ETH_HLEN); |
| 224 | pl_hdr = (struct i2400m_pl_data_hdr *) skb_push(skb, sizeof(*pl_hdr)); | 224 | pl_hdr = skb_push(skb, sizeof(*pl_hdr)); |
| 225 | pl_hdr->reserved = 0; | 225 | pl_hdr->reserved = 0; |
| 226 | } | 226 | } |
| 227 | 227 | ||
diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c index 5f64f3928c35..3b0802fc5bf5 100644 --- a/drivers/net/wireless/admtek/adm8211.c +++ b/drivers/net/wireless/admtek/adm8211.c | |||
| @@ -1700,7 +1700,7 @@ static void adm8211_tx(struct ieee80211_hw *dev, | |||
| 1700 | skb_pull(skb, hdrlen); | 1700 | skb_pull(skb, hdrlen); |
| 1701 | payload_len = skb->len; | 1701 | payload_len = skb->len; |
| 1702 | 1702 | ||
| 1703 | txhdr = (struct adm8211_tx_hdr *) skb_push(skb, sizeof(*txhdr)); | 1703 | txhdr = skb_push(skb, sizeof(*txhdr)); |
| 1704 | memset(txhdr, 0, sizeof(*txhdr)); | 1704 | memset(txhdr, 0, sizeof(*txhdr)); |
| 1705 | memcpy(txhdr->da, ieee80211_get_DA(hdr), ETH_ALEN); | 1705 | memcpy(txhdr->da, ieee80211_get_DA(hdr), ETH_ALEN); |
| 1706 | txhdr->signal = plcp_signal; | 1706 | txhdr->signal = plcp_signal; |
diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index f2f4ccfdf8da..106d6f8d471a 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c | |||
| @@ -829,8 +829,8 @@ static void ar5523_tx_work_locked(struct ar5523 *ar) | |||
| 829 | data->ar = ar; | 829 | data->ar = ar; |
| 830 | data->urb = urb; | 830 | data->urb = urb; |
| 831 | 831 | ||
| 832 | desc = (struct ar5523_tx_desc *)skb_push(skb, sizeof(*desc)); | 832 | desc = skb_push(skb, sizeof(*desc)); |
| 833 | chunk = (struct ar5523_chunk *)skb_push(skb, sizeof(*chunk)); | 833 | chunk = skb_push(skb, sizeof(*chunk)); |
| 834 | 834 | ||
| 835 | chunk->seqnum = 0; | 835 | chunk->seqnum = 0; |
| 836 | chunk->flags = UATH_CFLAGS_FINAL; | 836 | chunk->flags = UATH_CFLAGS_FINAL; |
diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c index b13d61111072..5c0ba83a44aa 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c | |||
| @@ -228,8 +228,7 @@ static int htc_issue_packets(struct htc_target *target, | |||
| 228 | payload_len = packet->act_len; | 228 | payload_len = packet->act_len; |
| 229 | 229 | ||
| 230 | /* setup HTC frame header */ | 230 | /* setup HTC frame header */ |
| 231 | htc_hdr = (struct htc_frame_hdr *) skb_push(skb, | 231 | htc_hdr = skb_push(skb, sizeof(*htc_hdr)); |
| 232 | sizeof(*htc_hdr)); | ||
| 233 | if (!htc_hdr) { | 232 | if (!htc_hdr) { |
| 234 | WARN_ON_ONCE(1); | 233 | WARN_ON_ONCE(1); |
| 235 | status = -EINVAL; | 234 | status = -EINVAL; |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 12aa8abbcba4..0d9687a2aa98 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
| @@ -199,7 +199,7 @@ static int hif_usb_send_mgmt(struct hif_device_usb *hif_dev, | |||
| 199 | cmd->skb = skb; | 199 | cmd->skb = skb; |
| 200 | cmd->hif_dev = hif_dev; | 200 | cmd->hif_dev = hif_dev; |
| 201 | 201 | ||
| 202 | hdr = (__le16 *) skb_push(skb, 4); | 202 | hdr = skb_push(skb, 4); |
| 203 | *hdr++ = cpu_to_le16(skb->len - 4); | 203 | *hdr++ = cpu_to_le16(skb->len - 4); |
| 204 | *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG); | 204 | *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG); |
| 205 | 205 | ||
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index 9fa8970a1f7d..1bf63a4efb4c 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c | |||
| @@ -26,8 +26,7 @@ static int htc_issue_send(struct htc_target *target, struct sk_buff* skb, | |||
| 26 | struct htc_endpoint *endpoint = &target->endpoint[epid]; | 26 | struct htc_endpoint *endpoint = &target->endpoint[epid]; |
| 27 | int status; | 27 | int status; |
| 28 | 28 | ||
| 29 | hdr = (struct htc_frame_hdr *) | 29 | hdr = skb_push(skb, sizeof(struct htc_frame_hdr)); |
| 30 | skb_push(skb, sizeof(struct htc_frame_hdr)); | ||
| 31 | hdr->endpoint_id = epid; | 30 | hdr->endpoint_id = epid; |
| 32 | hdr->flags = flags; | 31 | hdr->flags = flags; |
| 33 | hdr->payload_len = cpu_to_be16(len); | 32 | hdr->payload_len = cpu_to_be16(len); |
diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index c51c69b1ad96..85d09fdef8dc 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c | |||
| @@ -277,7 +277,7 @@ static int ath9k_wmi_cmd_issue(struct wmi *wmi, | |||
| 277 | struct wmi_cmd_hdr *hdr; | 277 | struct wmi_cmd_hdr *hdr; |
| 278 | unsigned long flags; | 278 | unsigned long flags; |
| 279 | 279 | ||
| 280 | hdr = (struct wmi_cmd_hdr *) skb_push(skb, sizeof(struct wmi_cmd_hdr)); | 280 | hdr = skb_push(skb, sizeof(struct wmi_cmd_hdr)); |
| 281 | hdr->command_id = cpu_to_be16(cmd); | 281 | hdr->command_id = cpu_to_be16(cmd); |
| 282 | hdr->seq_no = cpu_to_be16(++wmi->tx_seq_id); | 282 | hdr->seq_no = cpu_to_be16(++wmi->tx_seq_id); |
| 283 | 283 | ||
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index 2bf04c9edc98..0cb5b58925dc 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c | |||
| @@ -991,7 +991,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar, | |||
| 991 | else | 991 | else |
| 992 | cvif = NULL; | 992 | cvif = NULL; |
| 993 | 993 | ||
| 994 | txc = (void *)skb_push(skb, sizeof(*txc)); | 994 | txc = skb_push(skb, sizeof(*txc)); |
| 995 | memset(txc, 0, sizeof(*txc)); | 995 | memset(txc, 0, sizeof(*txc)); |
| 996 | 996 | ||
| 997 | SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, txc->s.misc, hw_queue); | 997 | SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, txc->s.misc, hw_queue); |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index edab4c0a900f..84d91606e6f3 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
| @@ -363,7 +363,7 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv *wil, | |||
| 363 | return; | 363 | return; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | rtap_vendor = (void *)skb_push(skb, rtap_len); | 366 | rtap_vendor = skb_push(skb, rtap_len); |
| 367 | memset(rtap_vendor, 0, rtap_len); | 367 | memset(rtap_vendor, 0, rtap_len); |
| 368 | 368 | ||
| 369 | rtap_vendor->rtap.rthdr.it_version = PKTHDR_RADIOTAP_VERSION; | 369 | rtap_vendor->rtap.rthdr.it_version = PKTHDR_RADIOTAP_VERSION; |
diff --git a/drivers/net/wireless/intersil/hostap/hostap_80211_rx.c b/drivers/net/wireless/intersil/hostap/hostap_80211_rx.c index 34dbddbf3f9b..6d8b64ca1a63 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/intersil/hostap/hostap_80211_rx.c | |||
| @@ -131,8 +131,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, | |||
| 131 | 131 | ||
| 132 | if (prism_header == 1) { | 132 | if (prism_header == 1) { |
| 133 | struct linux_wlan_ng_prism_hdr *hdr; | 133 | struct linux_wlan_ng_prism_hdr *hdr; |
| 134 | hdr = (struct linux_wlan_ng_prism_hdr *) | 134 | hdr = skb_push(skb, phdrlen); |
| 135 | skb_push(skb, phdrlen); | ||
| 136 | memset(hdr, 0, phdrlen); | 135 | memset(hdr, 0, phdrlen); |
| 137 | hdr->msgcode = LWNG_CAP_DID_BASE; | 136 | hdr->msgcode = LWNG_CAP_DID_BASE; |
| 138 | hdr->msglen = sizeof(*hdr); | 137 | hdr->msglen = sizeof(*hdr); |
| @@ -153,8 +152,7 @@ hdr->f.status = s; hdr->f.len = l; hdr->f.data = d | |||
| 153 | #undef LWNG_SETVAL | 152 | #undef LWNG_SETVAL |
| 154 | } else if (prism_header == 2) { | 153 | } else if (prism_header == 2) { |
| 155 | struct linux_wlan_ng_cap_hdr *hdr; | 154 | struct linux_wlan_ng_cap_hdr *hdr; |
| 156 | hdr = (struct linux_wlan_ng_cap_hdr *) | 155 | hdr = skb_push(skb, phdrlen); |
| 157 | skb_push(skb, phdrlen); | ||
| 158 | memset(hdr, 0, phdrlen); | 156 | memset(hdr, 0, phdrlen); |
| 159 | hdr->version = htonl(LWNG_CAPHDR_VERSION); | 157 | hdr->version = htonl(LWNG_CAPHDR_VERSION); |
| 160 | hdr->length = htonl(phdrlen); | 158 | hdr->length = htonl(phdrlen); |
| @@ -172,7 +170,7 @@ hdr->f.status = s; hdr->f.len = l; hdr->f.data = d | |||
| 172 | hdr->encoding = htonl(1); /* cck */ | 170 | hdr->encoding = htonl(1); /* cck */ |
| 173 | } else if (prism_header == 3) { | 171 | } else if (prism_header == 3) { |
| 174 | struct hostap_radiotap_rx *hdr; | 172 | struct hostap_radiotap_rx *hdr; |
| 175 | hdr = (struct hostap_radiotap_rx *)skb_push(skb, phdrlen); | 173 | hdr = skb_push(skb, phdrlen); |
| 176 | memset(hdr, 0, phdrlen); | 174 | memset(hdr, 0, phdrlen); |
| 177 | hdr->hdr.it_len = cpu_to_le16(phdrlen); | 175 | hdr->hdr.it_len = cpu_to_le16(phdrlen); |
| 178 | hdr->hdr.it_present = | 176 | hdr->hdr.it_present = |
diff --git a/drivers/net/wireless/intersil/orinoco/main.c b/drivers/net/wireless/intersil/orinoco/main.c index f7abc439fb92..28dac36d7c4c 100644 --- a/drivers/net/wireless/intersil/orinoco/main.c +++ b/drivers/net/wireless/intersil/orinoco/main.c | |||
| @@ -396,7 +396,7 @@ int orinoco_process_xmit_skb(struct sk_buff *skb, | |||
| 396 | memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr)); | 396 | memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr)); |
| 397 | 397 | ||
| 398 | /* Make room for the new header, and copy it in */ | 398 | /* Make room for the new header, and copy it in */ |
| 399 | eh = (struct ethhdr *) skb_push(skb, ENCAPS_OVERHEAD); | 399 | eh = skb_push(skb, ENCAPS_OVERHEAD); |
| 400 | memcpy(eh, &hdr, sizeof(hdr)); | 400 | memcpy(eh, &hdr, sizeof(hdr)); |
| 401 | } | 401 | } |
| 402 | 402 | ||
| @@ -1029,11 +1029,10 @@ static void orinoco_rx(struct net_device *dev, | |||
| 1029 | /* These indicate a SNAP within 802.2 LLC within | 1029 | /* These indicate a SNAP within 802.2 LLC within |
| 1030 | 802.11 frame which we'll need to de-encapsulate to | 1030 | 802.11 frame which we'll need to de-encapsulate to |
| 1031 | the original EthernetII frame. */ | 1031 | the original EthernetII frame. */ |
| 1032 | hdr = (struct ethhdr *)skb_push(skb, | 1032 | hdr = skb_push(skb, ETH_HLEN - ENCAPS_OVERHEAD); |
| 1033 | ETH_HLEN - ENCAPS_OVERHEAD); | ||
| 1034 | } else { | 1033 | } else { |
| 1035 | /* 802.3 frame - prepend 802.3 header as is */ | 1034 | /* 802.3 frame - prepend 802.3 header as is */ |
| 1036 | hdr = (struct ethhdr *)skb_push(skb, ETH_HLEN); | 1035 | hdr = skb_push(skb, ETH_HLEN); |
| 1037 | hdr->h_proto = htons(length); | 1036 | hdr->h_proto = htons(length); |
| 1038 | } | 1037 | } |
| 1039 | memcpy(hdr->h_dest, desc->addr1, ETH_ALEN); | 1038 | memcpy(hdr->h_dest, desc->addr1, ETH_ALEN); |
diff --git a/drivers/net/wireless/intersil/p54/txrx.c b/drivers/net/wireless/intersil/p54/txrx.c index b00c07d72f95..3a4214d362ff 100644 --- a/drivers/net/wireless/intersil/p54/txrx.c +++ b/drivers/net/wireless/intersil/p54/txrx.c | |||
| @@ -815,8 +815,8 @@ void p54_tx_80211(struct ieee80211_hw *dev, | |||
| 815 | } | 815 | } |
| 816 | } | 816 | } |
| 817 | 817 | ||
| 818 | txhdr = (struct p54_tx_data *) skb_push(skb, sizeof(*txhdr) + padding); | 818 | txhdr = skb_push(skb, sizeof(*txhdr) + padding); |
| 819 | hdr = (struct p54_hdr *) skb_push(skb, sizeof(*hdr)); | 819 | hdr = skb_push(skb, sizeof(*hdr)); |
| 820 | 820 | ||
| 821 | if (padding) | 821 | if (padding) |
| 822 | hdr_flags |= P54_HDR_FLAG_DATA_ALIGN; | 822 | hdr_flags |= P54_HDR_FLAG_DATA_ALIGN; |
diff --git a/drivers/net/wireless/intersil/prism54/islpci_eth.c b/drivers/net/wireless/intersil/prism54/islpci_eth.c index d83f6332019e..9b0ded733294 100644 --- a/drivers/net/wireless/intersil/prism54/islpci_eth.c +++ b/drivers/net/wireless/intersil/prism54/islpci_eth.c | |||
| @@ -276,10 +276,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb) | |||
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | /* make room for the new header and fill it. */ | 278 | /* make room for the new header and fill it. */ |
| 279 | avs = | 279 | avs = skb_push(*skb, sizeof(struct avs_80211_1_header)); |
| 280 | (struct avs_80211_1_header *) skb_push(*skb, | ||
| 281 | sizeof (struct | ||
| 282 | avs_80211_1_header)); | ||
| 283 | 280 | ||
| 284 | avs->version = cpu_to_be32(P80211CAPTURE_VERSION); | 281 | avs->version = cpu_to_be32(P80211CAPTURE_VERSION); |
| 285 | avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header)); | 282 | avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header)); |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 7418088e296f..c8852acc1462 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -848,7 +848,7 @@ static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw, | |||
| 848 | if (skb == NULL) | 848 | if (skb == NULL) |
| 849 | return; | 849 | return; |
| 850 | 850 | ||
| 851 | hdr = (struct hwsim_radiotap_hdr *) skb_push(skb, sizeof(*hdr)); | 851 | hdr = skb_push(skb, sizeof(*hdr)); |
| 852 | hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION; | 852 | hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION; |
| 853 | hdr->hdr.it_pad = 0; | 853 | hdr->hdr.it_pad = 0; |
| 854 | hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr)); | 854 | hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr)); |
| @@ -1146,7 +1146,7 @@ static void mac80211_hwsim_add_vendor_rtap(struct sk_buff *skb) | |||
| 1146 | * Note that this code requires the headroom in the SKB | 1146 | * Note that this code requires the headroom in the SKB |
| 1147 | * that was allocated earlier. | 1147 | * that was allocated earlier. |
| 1148 | */ | 1148 | */ |
| 1149 | rtap = (void *)skb_push(skb, sizeof(*rtap) + 8 + 4); | 1149 | rtap = skb_push(skb, sizeof(*rtap) + 8 + 4); |
| 1150 | rtap->oui[0] = HWSIM_RADIOTAP_OUI[0]; | 1150 | rtap->oui[0] = HWSIM_RADIOTAP_OUI[0]; |
| 1151 | rtap->oui[1] = HWSIM_RADIOTAP_OUI[1]; | 1151 | rtap->oui[1] = HWSIM_RADIOTAP_OUI[1]; |
| 1152 | rtap->oui[2] = HWSIM_RADIOTAP_OUI[2]; | 1152 | rtap->oui[2] = HWSIM_RADIOTAP_OUI[2]; |
diff --git a/drivers/net/wireless/marvell/libertas/rx.c b/drivers/net/wireless/marvell/libertas/rx.c index a18bb7a9889c..7586ff681b23 100644 --- a/drivers/net/wireless/marvell/libertas/rx.c +++ b/drivers/net/wireless/marvell/libertas/rx.c | |||
| @@ -257,7 +257,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
| 257 | goto done; | 257 | goto done; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr)); | 260 | pradiotap_hdr = skb_push(skb, sizeof(struct rx_radiotap_hdr)); |
| 261 | memcpy(pradiotap_hdr, &radiotap_hdr, sizeof(struct rx_radiotap_hdr)); | 261 | memcpy(pradiotap_hdr, &radiotap_hdr, sizeof(struct rx_radiotap_hdr)); |
| 262 | 262 | ||
| 263 | priv->cur_rate = lbs_fw_index_to_data_rate(prxpd->rx_rate); | 263 | priv->cur_rate = lbs_fw_index_to_data_rate(prxpd->rx_rate); |
diff --git a/drivers/net/wireless/marvell/libertas_tf/main.c b/drivers/net/wireless/marvell/libertas_tf/main.c index d80333117989..81228bf73043 100644 --- a/drivers/net/wireless/marvell/libertas_tf/main.c +++ b/drivers/net/wireless/marvell/libertas_tf/main.c | |||
| @@ -260,7 +260,7 @@ static void lbtf_tx_work(struct work_struct *work) | |||
| 260 | 260 | ||
| 261 | len = skb->len; | 261 | len = skb->len; |
| 262 | info = IEEE80211_SKB_CB(skb); | 262 | info = IEEE80211_SKB_CB(skb); |
| 263 | txpd = (struct txpd *) skb_push(skb, sizeof(struct txpd)); | 263 | txpd = skb_push(skb, sizeof(struct txpd)); |
| 264 | 264 | ||
| 265 | if (priv->surpriseremoved) { | 265 | if (priv->surpriseremoved) { |
| 266 | dev_kfree_skb_any(skb); | 266 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/wireless/mediatek/mt7601u/tx.c b/drivers/net/wireless/mediatek/mt7601u/tx.c index ad77bec1ba0f..3600e911a63e 100644 --- a/drivers/net/wireless/mediatek/mt7601u/tx.c +++ b/drivers/net/wireless/mediatek/mt7601u/tx.c | |||
| @@ -148,7 +148,7 @@ mt7601u_push_txwi(struct mt7601u_dev *dev, struct sk_buff *skb, | |||
| 148 | u16 rate_ctl; | 148 | u16 rate_ctl; |
| 149 | u8 nss; | 149 | u8 nss; |
| 150 | 150 | ||
| 151 | txwi = (struct mt76_txwi *)skb_push(skb, sizeof(struct mt76_txwi)); | 151 | txwi = skb_push(skb, sizeof(struct mt76_txwi)); |
| 152 | memset(txwi, 0, sizeof(*txwi)); | 152 | memset(txwi, 0, sizeof(*txwi)); |
| 153 | 153 | ||
| 154 | if (!wcid->tx_rate_set) | 154 | if (!wcid->tx_rate_set) |
diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c index 35fe991dcc56..55198ac2b755 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | |||
| @@ -278,8 +278,7 @@ static void rtl8187_tx(struct ieee80211_hw *dev, | |||
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | if (!priv->is_rtl8187b) { | 280 | if (!priv->is_rtl8187b) { |
| 281 | struct rtl8187_tx_hdr *hdr = | 281 | struct rtl8187_tx_hdr *hdr = skb_push(skb, sizeof(*hdr)); |
| 282 | (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); | ||
| 283 | hdr->flags = cpu_to_le32(flags); | 282 | hdr->flags = cpu_to_le32(flags); |
| 284 | hdr->len = 0; | 283 | hdr->len = 0; |
| 285 | hdr->rts_duration = rts_dur; | 284 | hdr->rts_duration = rts_dur; |
| @@ -292,8 +291,7 @@ static void rtl8187_tx(struct ieee80211_hw *dev, | |||
| 292 | unsigned int epmap[4] = { 6, 7, 5, 4 }; | 291 | unsigned int epmap[4] = { 6, 7, 5, 4 }; |
| 293 | u16 fc = le16_to_cpu(tx_hdr->frame_control); | 292 | u16 fc = le16_to_cpu(tx_hdr->frame_control); |
| 294 | 293 | ||
| 295 | struct rtl8187b_tx_hdr *hdr = | 294 | struct rtl8187b_tx_hdr *hdr = skb_push(skb, sizeof(*hdr)); |
| 296 | (struct rtl8187b_tx_hdr *)skb_push(skb, sizeof(*hdr)); | ||
| 297 | struct ieee80211_rate *txrate = | 295 | struct ieee80211_rate *txrate = |
| 298 | ieee80211_get_tx_rate(dev, info); | 296 | ieee80211_get_tx_rate(dev, info); |
| 299 | memset(hdr, 0, sizeof(*hdr)); | 297 | memset(hdr, 0, sizeof(*hdr)); |
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 39d56313bc94..21e5ef021260 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | |||
| @@ -4952,7 +4952,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, | |||
| 4952 | if (control && control->sta) | 4952 | if (control && control->sta) |
| 4953 | sta = control->sta; | 4953 | sta = control->sta; |
| 4954 | 4954 | ||
| 4955 | tx_desc = (struct rtl8xxxu_txdesc32 *)skb_push(skb, tx_desc_size); | 4955 | tx_desc = skb_push(skb, tx_desc_size); |
| 4956 | 4956 | ||
| 4957 | memset(tx_desc, 0, tx_desc_size); | 4957 | memset(tx_desc, 0, tx_desc_size); |
| 4958 | tx_desc->pkt_size = cpu_to_le16(pktlen); | 4958 | tx_desc->pkt_size = cpu_to_le16(pktlen); |
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c index 41422e4da8b7..de6c3428f7c6 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | |||
| @@ -512,7 +512,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | |||
| 512 | 512 | ||
| 513 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; | 513 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
| 514 | rtl_get_tcb_desc(hw, info, sta, skb, tcb_desc); | 514 | rtl_get_tcb_desc(hw, info, sta, skb, tcb_desc); |
| 515 | txdesc = (u8 *)skb_push(skb, RTL_TX_HEADER_SIZE); | 515 | txdesc = skb_push(skb, RTL_TX_HEADER_SIZE); |
| 516 | memset(txdesc, 0, RTL_TX_HEADER_SIZE); | 516 | memset(txdesc, 0, RTL_TX_HEADER_SIZE); |
| 517 | SET_TX_DESC_PKT_SIZE(txdesc, pktlen); | 517 | SET_TX_DESC_PKT_SIZE(txdesc, pktlen); |
| 518 | SET_TX_DESC_LINIP(txdesc, 0); | 518 | SET_TX_DESC_LINIP(txdesc, 0); |
diff --git a/drivers/net/wireless/st/cw1200/txrx.c b/drivers/net/wireless/st/cw1200/txrx.c index cd63ffef025a..e9050b41157a 100644 --- a/drivers/net/wireless/st/cw1200/txrx.c +++ b/drivers/net/wireless/st/cw1200/txrx.c | |||
| @@ -574,7 +574,7 @@ cw1200_tx_h_wsm(struct cw1200_common *priv, | |||
| 574 | return NULL; | 574 | return NULL; |
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | wsm = (struct wsm_tx *)skb_push(t->skb, sizeof(struct wsm_tx)); | 577 | wsm = skb_push(t->skb, sizeof(struct wsm_tx)); |
| 578 | t->txpriv.offset += sizeof(struct wsm_tx); | 578 | t->txpriv.offset += sizeof(struct wsm_tx); |
| 579 | memset(wsm, 0, sizeof(*wsm)); | 579 | memset(wsm, 0, sizeof(*wsm)); |
| 580 | wsm->hdr.len = __cpu_to_le16(t->skb->len); | 580 | wsm->hdr.len = __cpu_to_le16(t->skb->len); |
diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c index 81de83c6fcf6..de2fa6705574 100644 --- a/drivers/net/wireless/ti/wl1251/tx.c +++ b/drivers/net/wireless/ti/wl1251/tx.c | |||
| @@ -161,8 +161,7 @@ static int wl1251_tx_fill_hdr(struct wl1251 *wl, struct sk_buff *skb, | |||
| 161 | return id; | 161 | return id; |
| 162 | 162 | ||
| 163 | fc = *(u16 *)skb->data; | 163 | fc = *(u16 *)skb->data; |
| 164 | tx_hdr = (struct tx_double_buffer_desc *) skb_push(skb, | 164 | tx_hdr = skb_push(skb, sizeof(*tx_hdr)); |
| 165 | sizeof(*tx_hdr)); | ||
| 166 | 165 | ||
| 167 | tx_hdr->length = cpu_to_le16(skb->len - sizeof(*tx_hdr)); | 166 | tx_hdr->length = cpu_to_le16(skb->len - sizeof(*tx_hdr)); |
| 168 | rate = ieee80211_get_tx_rate(wl->hw, control); | 167 | rate = ieee80211_get_tx_rate(wl->hw, control); |
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index 229f4d01f239..2bfc12fdc929 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c | |||
| @@ -1282,7 +1282,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
| 1282 | memset(skb_push(skb, sizeof(__le16)), 0, sizeof(__le16)); | 1282 | memset(skb_push(skb, sizeof(__le16)), 0, sizeof(__le16)); |
| 1283 | 1283 | ||
| 1284 | /* mac80211 header */ | 1284 | /* mac80211 header */ |
| 1285 | hdr = (struct ieee80211_hdr_3addr *)skb_push(skb, sizeof(*hdr)); | 1285 | hdr = skb_push(skb, sizeof(*hdr)); |
| 1286 | memset(hdr, 0, sizeof(*hdr)); | 1286 | memset(hdr, 0, sizeof(*hdr)); |
| 1287 | fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_TODS; | 1287 | fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_TODS; |
| 1288 | if (wlvif->sta.qos) | 1288 | if (wlvif->sta.qos) |
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c index c1b8e4e9d70b..a3f5e9ca492a 100644 --- a/drivers/net/wireless/ti/wlcore/tx.c +++ b/drivers/net/wireless/ti/wlcore/tx.c | |||
| @@ -223,8 +223,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
| 223 | total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks); | 223 | total_blocks = wlcore_hw_calc_tx_blocks(wl, total_len, spare_blocks); |
| 224 | 224 | ||
| 225 | if (total_blocks <= wl->tx_blocks_available) { | 225 | if (total_blocks <= wl->tx_blocks_available) { |
| 226 | desc = (struct wl1271_tx_hw_descr *)skb_push( | 226 | desc = skb_push(skb, total_len - skb->len); |
| 227 | skb, total_len - skb->len); | ||
| 228 | 227 | ||
| 229 | wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks, | 228 | wlcore_hw_set_tx_desc_blocks(wl, desc, total_blocks, |
| 230 | spare_blocks); | 229 | spare_blocks); |
diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c index 2d929d2edb00..b785742bfd9e 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c | |||
| @@ -868,8 +868,7 @@ static int fill_ctrlset(struct zd_mac *mac, | |||
| 868 | unsigned int frag_len = skb->len + FCS_LEN; | 868 | unsigned int frag_len = skb->len + FCS_LEN; |
| 869 | unsigned int packet_length; | 869 | unsigned int packet_length; |
| 870 | struct ieee80211_rate *txrate; | 870 | struct ieee80211_rate *txrate; |
| 871 | struct zd_ctrlset *cs = (struct zd_ctrlset *) | 871 | struct zd_ctrlset *cs = skb_push(skb, sizeof(struct zd_ctrlset)); |
| 872 | skb_push(skb, sizeof(struct zd_ctrlset)); | ||
| 873 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 872 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 874 | 873 | ||
| 875 | ZD_ASSERT(frag_len <= 0xffff); | 874 | ZD_ASSERT(frag_len <= 0xffff); |
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index 97f003e84381..d5781aa0f791 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c | |||
| @@ -79,8 +79,8 @@ static void fdp_nci_i2c_add_len_lrc(struct sk_buff *skb) | |||
| 79 | 79 | ||
| 80 | /* Add length header */ | 80 | /* Add length header */ |
| 81 | len = skb->len; | 81 | len = skb->len; |
| 82 | *skb_push(skb, 1) = len & 0xff; | 82 | *(u8 *)skb_push(skb, 1) = len & 0xff; |
| 83 | *skb_push(skb, 1) = len >> 8; | 83 | *(u8 *)skb_push(skb, 1) = len >> 8; |
| 84 | 84 | ||
| 85 | /* Compute and add lrc */ | 85 | /* Compute and add lrc */ |
| 86 | for (i = 0; i < len + 2; i++) | 86 | for (i = 0; i < len + 2; i++) |
diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c index 8e328c36a816..386cc61d95b9 100644 --- a/drivers/nfc/microread/i2c.c +++ b/drivers/nfc/microread/i2c.c | |||
| @@ -70,7 +70,7 @@ static void microread_i2c_add_len_crc(struct sk_buff *skb) | |||
| 70 | int len; | 70 | int len; |
| 71 | 71 | ||
| 72 | len = skb->len; | 72 | len = skb->len; |
| 73 | *skb_push(skb, 1) = len; | 73 | *(u8 *)skb_push(skb, 1) = len; |
| 74 | 74 | ||
| 75 | for (i = 0; i < skb->len; i++) | 75 | for (i = 0; i < skb->len; i++) |
| 76 | crc = crc ^ skb->data[i]; | 76 | crc = crc ^ skb->data[i]; |
diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c index 9d0dd1be0923..38a979eacc29 100644 --- a/drivers/nfc/microread/microread.c +++ b/drivers/nfc/microread/microread.c | |||
| @@ -419,7 +419,7 @@ static int microread_im_transceive(struct nfc_hci_dev *hdev, | |||
| 419 | pr_info("data exchange to gate 0x%x\n", target->hci_reader_gate); | 419 | pr_info("data exchange to gate 0x%x\n", target->hci_reader_gate); |
| 420 | 420 | ||
| 421 | if (target->hci_reader_gate == MICROREAD_GATE_ID_P2P_INITIATOR) { | 421 | if (target->hci_reader_gate == MICROREAD_GATE_ID_P2P_INITIATOR) { |
| 422 | *skb_push(skb, 1) = 0; | 422 | *(u8 *)skb_push(skb, 1) = 0; |
| 423 | 423 | ||
| 424 | return nfc_hci_send_event(hdev, target->hci_reader_gate, | 424 | return nfc_hci_send_event(hdev, target->hci_reader_gate, |
| 425 | MICROREAD_EVT_P2P_INITIATOR_EXCHANGE_TO_RF, | 425 | MICROREAD_EVT_P2P_INITIATOR_EXCHANGE_TO_RF, |
| @@ -453,7 +453,7 @@ static int microread_im_transceive(struct nfc_hci_dev *hdev, | |||
| 453 | return 1; | 453 | return 1; |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | *skb_push(skb, 1) = control_bits; | 456 | *(u8 *)skb_push(skb, 1) = control_bits; |
| 457 | 457 | ||
| 458 | info->async_cb_type = MICROREAD_CB_TYPE_READER_ALL; | 458 | info->async_cb_type = MICROREAD_CB_TYPE_READER_ALL; |
| 459 | info->async_cb = cb; | 459 | info->async_cb = cb; |
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index 51c8240a1672..c5038e6447bd 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c | |||
| @@ -68,7 +68,7 @@ static int nfcmrvl_nci_send(struct nci_dev *ndev, struct sk_buff *skb) | |||
| 68 | unsigned char *hdr; | 68 | unsigned char *hdr; |
| 69 | unsigned char len = skb->len; | 69 | unsigned char len = skb->len; |
| 70 | 70 | ||
| 71 | hdr = (char *) skb_push(skb, NFCMRVL_HCI_EVENT_HEADER_SIZE); | 71 | hdr = skb_push(skb, NFCMRVL_HCI_EVENT_HEADER_SIZE); |
| 72 | hdr[0] = NFCMRVL_HCI_COMMAND_CODE; | 72 | hdr[0] = NFCMRVL_HCI_COMMAND_CODE; |
| 73 | hdr[1] = NFCMRVL_HCI_OGF; | 73 | hdr[1] = NFCMRVL_HCI_OGF; |
| 74 | hdr[2] = NFCMRVL_HCI_OCF; | 74 | hdr[2] = NFCMRVL_HCI_OCF; |
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index 68a3cd0287f6..6a711b5b9490 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c | |||
| @@ -2090,10 +2090,10 @@ static int pn533_fill_fragment_skbs(struct pn533 *dev, struct sk_buff *skb) | |||
| 2090 | 2090 | ||
| 2091 | /* MI + TG */ | 2091 | /* MI + TG */ |
| 2092 | if (frag_size == PN533_CMD_DATAFRAME_MAXLEN) | 2092 | if (frag_size == PN533_CMD_DATAFRAME_MAXLEN) |
| 2093 | *skb_push(frag, sizeof(u8)) = | 2093 | *(u8 *)skb_push(frag, sizeof(u8)) = |
| 2094 | (PN533_CMD_MI_MASK | 1); | 2094 | (PN533_CMD_MI_MASK | 1); |
| 2095 | else | 2095 | else |
| 2096 | *skb_push(frag, sizeof(u8)) = 1; /* TG */ | 2096 | *(u8 *)skb_push(frag, sizeof(u8)) = 1; /* TG */ |
| 2097 | } | 2097 | } |
| 2098 | 2098 | ||
| 2099 | skb_put_data(frag, skb->data, frag_size); | 2099 | skb_put_data(frag, skb->data, frag_size); |
| @@ -2160,7 +2160,7 @@ static int pn533_transceive(struct nfc_dev *nfc_dev, | |||
| 2160 | goto error; | 2160 | goto error; |
| 2161 | } | 2161 | } |
| 2162 | } else { | 2162 | } else { |
| 2163 | *skb_push(skb, sizeof(u8)) = 1; /* TG */ | 2163 | *(u8 *)skb_push(skb, sizeof(u8)) = 1; /* TG */ |
| 2164 | } | 2164 | } |
| 2165 | 2165 | ||
| 2166 | rc = pn533_send_data_async(dev, PN533_CMD_IN_DATA_EXCHANGE, | 2166 | rc = pn533_send_data_async(dev, PN533_CMD_IN_DATA_EXCHANGE, |
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index dc1e3768cee6..b7be6c25b7e6 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c | |||
| @@ -283,7 +283,7 @@ static void pn544_hci_i2c_add_len_crc(struct sk_buff *skb) | |||
| 283 | int len; | 283 | int len; |
| 284 | 284 | ||
| 285 | len = skb->len + 2; | 285 | len = skb->len + 2; |
| 286 | *skb_push(skb, 1) = len; | 286 | *(u8 *)skb_push(skb, 1) = len; |
| 287 | 287 | ||
| 288 | crc = crc_ccitt(0xffff, skb->data, skb->len); | 288 | crc = crc_ccitt(0xffff, skb->data, skb->len); |
| 289 | crc = ~crc; | 289 | crc = ~crc; |
diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index 12e819ddf17a..70e898e38b16 100644 --- a/drivers/nfc/pn544/pn544.c +++ b/drivers/nfc/pn544/pn544.c | |||
| @@ -649,8 +649,8 @@ static int pn544_hci_im_transceive(struct nfc_hci_dev *hdev, | |||
| 649 | } else | 649 | } else |
| 650 | return 1; | 650 | return 1; |
| 651 | case PN544_RF_READER_F_GATE: | 651 | case PN544_RF_READER_F_GATE: |
| 652 | *skb_push(skb, 1) = 0; | 652 | *(u8 *)skb_push(skb, 1) = 0; |
| 653 | *skb_push(skb, 1) = 0; | 653 | *(u8 *)skb_push(skb, 1) = 0; |
| 654 | 654 | ||
| 655 | info->async_cb_type = PN544_CB_TYPE_READER_F; | 655 | info->async_cb_type = PN544_CB_TYPE_READER_F; |
| 656 | info->async_cb = cb; | 656 | info->async_cb = cb; |
| @@ -665,7 +665,7 @@ static int pn544_hci_im_transceive(struct nfc_hci_dev *hdev, | |||
| 665 | PN544_JEWEL_RAW_CMD, skb->data, | 665 | PN544_JEWEL_RAW_CMD, skb->data, |
| 666 | skb->len, cb, cb_context); | 666 | skb->len, cb, cb_context); |
| 667 | case PN544_RF_READER_NFCIP1_INITIATOR_GATE: | 667 | case PN544_RF_READER_NFCIP1_INITIATOR_GATE: |
| 668 | *skb_push(skb, 1) = 0; | 668 | *(u8 *)skb_push(skb, 1) = 0; |
| 669 | 669 | ||
| 670 | return nfc_hci_send_event(hdev, target->hci_reader_gate, | 670 | return nfc_hci_send_event(hdev, target->hci_reader_gate, |
| 671 | PN544_HCI_EVT_SND_DATA, skb->data, | 671 | PN544_HCI_EVT_SND_DATA, skb->data, |
| @@ -680,7 +680,7 @@ static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) | |||
| 680 | int r; | 680 | int r; |
| 681 | 681 | ||
| 682 | /* Set default false for multiple information chaining */ | 682 | /* Set default false for multiple information chaining */ |
| 683 | *skb_push(skb, 1) = 0; | 683 | *(u8 *)skb_push(skb, 1) = 0; |
| 684 | 684 | ||
| 685 | r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, | 685 | r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, |
| 686 | PN544_HCI_EVT_SND_DATA, skb->data, skb->len); | 686 | PN544_HCI_EVT_SND_DATA, skb->data, skb->len); |
diff --git a/drivers/nfc/st-nci/ndlc.c b/drivers/nfc/st-nci/ndlc.c index 50880d747b02..9477994cf975 100644 --- a/drivers/nfc/st-nci/ndlc.c +++ b/drivers/nfc/st-nci/ndlc.c | |||
| @@ -87,7 +87,7 @@ int ndlc_send(struct llt_ndlc *ndlc, struct sk_buff *skb) | |||
| 87 | u8 pcb = PCB_TYPE_DATAFRAME | PCB_DATAFRAME_RETRANSMIT_NO | | 87 | u8 pcb = PCB_TYPE_DATAFRAME | PCB_DATAFRAME_RETRANSMIT_NO | |
| 88 | PCB_FRAME_CRC_INFO_NOTPRESENT; | 88 | PCB_FRAME_CRC_INFO_NOTPRESENT; |
| 89 | 89 | ||
| 90 | *skb_push(skb, 1) = pcb; | 90 | *(u8 *)skb_push(skb, 1) = pcb; |
| 91 | skb_queue_tail(&ndlc->send_q, skb); | 91 | skb_queue_tail(&ndlc->send_q, skb); |
| 92 | 92 | ||
| 93 | schedule_work(&ndlc->sm_work); | 93 | schedule_work(&ndlc->sm_work); |
diff --git a/drivers/nfc/st21nfca/core.c b/drivers/nfc/st21nfca/core.c index 50be3b788f1c..e803fdfa9189 100644 --- a/drivers/nfc/st21nfca/core.c +++ b/drivers/nfc/st21nfca/core.c | |||
| @@ -782,12 +782,12 @@ static int st21nfca_hci_im_transceive(struct nfc_hci_dev *hdev, | |||
| 782 | if (target->supported_protocols == NFC_PROTO_NFC_DEP_MASK) | 782 | if (target->supported_protocols == NFC_PROTO_NFC_DEP_MASK) |
| 783 | return st21nfca_im_send_dep_req(hdev, skb); | 783 | return st21nfca_im_send_dep_req(hdev, skb); |
| 784 | 784 | ||
| 785 | *skb_push(skb, 1) = 0x1a; | 785 | *(u8 *)skb_push(skb, 1) = 0x1a; |
| 786 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, | 786 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, |
| 787 | ST21NFCA_WR_XCHG_DATA, skb->data, | 787 | ST21NFCA_WR_XCHG_DATA, skb->data, |
| 788 | skb->len, cb, cb_context); | 788 | skb->len, cb, cb_context); |
| 789 | case ST21NFCA_RF_READER_14443_3_A_GATE: | 789 | case ST21NFCA_RF_READER_14443_3_A_GATE: |
| 790 | *skb_push(skb, 1) = 0x1a; /* CTR, see spec:10.2.2.1 */ | 790 | *(u8 *)skb_push(skb, 1) = 0x1a; /* CTR, see spec:10.2.2.1 */ |
| 791 | 791 | ||
| 792 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, | 792 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, |
| 793 | ST21NFCA_WR_XCHG_DATA, skb->data, | 793 | ST21NFCA_WR_XCHG_DATA, skb->data, |
| @@ -797,7 +797,7 @@ static int st21nfca_hci_im_transceive(struct nfc_hci_dev *hdev, | |||
| 797 | info->async_cb = cb; | 797 | info->async_cb = cb; |
| 798 | info->async_cb_context = cb_context; | 798 | info->async_cb_context = cb_context; |
| 799 | 799 | ||
| 800 | *skb_push(skb, 1) = 0x17; | 800 | *(u8 *)skb_push(skb, 1) = 0x17; |
| 801 | 801 | ||
| 802 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, | 802 | return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, |
| 803 | ST21NFCA_WR_XCHG_DATA, skb->data, | 803 | ST21NFCA_WR_XCHG_DATA, skb->data, |
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c index ada7b114b6c1..fd08be2917e6 100644 --- a/drivers/nfc/st21nfca/dep.c +++ b/drivers/nfc/st21nfca/dep.c | |||
| @@ -315,10 +315,10 @@ int st21nfca_tm_send_dep_res(struct nfc_hci_dev *hdev, struct sk_buff *skb) | |||
| 315 | int r; | 315 | int r; |
| 316 | struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); | 316 | struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); |
| 317 | 317 | ||
| 318 | *skb_push(skb, 1) = info->dep_info.curr_nfc_dep_pni; | 318 | *(u8 *)skb_push(skb, 1) = info->dep_info.curr_nfc_dep_pni; |
| 319 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_RES; | 319 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_RES; |
| 320 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_RES; | 320 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_RES; |
| 321 | *skb_push(skb, 1) = skb->len; | 321 | *(u8 *)skb_push(skb, 1) = skb->len; |
| 322 | 322 | ||
| 323 | r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, | 323 | r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, |
| 324 | ST21NFCA_EVT_SEND_DATA, skb->data, skb->len); | 324 | ST21NFCA_EVT_SEND_DATA, skb->data, skb->len); |
| @@ -466,7 +466,7 @@ static void st21nfca_im_send_psl_req(struct nfc_hci_dev *hdev, u8 did, u8 bsi, | |||
| 466 | psl_req->brs = (0x30 & bsi << 4) | (bri & 0x03); | 466 | psl_req->brs = (0x30 & bsi << 4) | (bri & 0x03); |
| 467 | psl_req->fsl = lri; | 467 | psl_req->fsl = lri; |
| 468 | 468 | ||
| 469 | *skb_push(skb, 1) = info->dep_info.to | 0x10; | 469 | *(u8 *)skb_push(skb, 1) = info->dep_info.to | 0x10; |
| 470 | 470 | ||
| 471 | st21nfca_im_send_pdu(info, skb); | 471 | st21nfca_im_send_pdu(info, skb); |
| 472 | } | 472 | } |
| @@ -568,7 +568,7 @@ int st21nfca_im_send_atr_req(struct nfc_hci_dev *hdev, u8 *gb, size_t gb_len) | |||
| 568 | } | 568 | } |
| 569 | atr_req->length = sizeof(struct st21nfca_atr_req) + hdev->gb_len; | 569 | atr_req->length = sizeof(struct st21nfca_atr_req) + hdev->gb_len; |
| 570 | 570 | ||
| 571 | *skb_push(skb, 1) = info->dep_info.to | 0x10; /* timeout */ | 571 | *(u8 *)skb_push(skb, 1) = info->dep_info.to | 0x10; /* timeout */ |
| 572 | 572 | ||
| 573 | info->async_cb_type = ST21NFCA_CB_TYPE_READER_F; | 573 | info->async_cb_type = ST21NFCA_CB_TYPE_READER_F; |
| 574 | info->async_cb_context = info; | 574 | info->async_cb_context = info; |
| @@ -629,10 +629,10 @@ static void st21nfca_im_recv_dep_res_cb(void *context, struct sk_buff *skb, | |||
| 629 | case ST21NFCA_NFC_DEP_PFB_SUPERVISOR_PDU: | 629 | case ST21NFCA_NFC_DEP_PFB_SUPERVISOR_PDU: |
| 630 | pr_err("Received a SUPERVISOR PDU\n"); | 630 | pr_err("Received a SUPERVISOR PDU\n"); |
| 631 | skb_pull(skb, size); | 631 | skb_pull(skb, size); |
| 632 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_REQ; | 632 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_REQ; |
| 633 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_REQ; | 633 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_REQ; |
| 634 | *skb_push(skb, 1) = skb->len; | 634 | *(u8 *)skb_push(skb, 1) = skb->len; |
| 635 | *skb_push(skb, 1) = info->dep_info.to | 0x10; | 635 | *(u8 *)skb_push(skb, 1) = info->dep_info.to | 0x10; |
| 636 | 636 | ||
| 637 | st21nfca_im_send_pdu(info, skb); | 637 | st21nfca_im_send_pdu(info, skb); |
| 638 | break; | 638 | break; |
| @@ -655,12 +655,12 @@ int st21nfca_im_send_dep_req(struct nfc_hci_dev *hdev, struct sk_buff *skb) | |||
| 655 | info->async_cb_context = info; | 655 | info->async_cb_context = info; |
| 656 | info->async_cb = st21nfca_im_recv_dep_res_cb; | 656 | info->async_cb = st21nfca_im_recv_dep_res_cb; |
| 657 | 657 | ||
| 658 | *skb_push(skb, 1) = info->dep_info.curr_nfc_dep_pni; | 658 | *(u8 *)skb_push(skb, 1) = info->dep_info.curr_nfc_dep_pni; |
| 659 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_REQ; | 659 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_DEP_REQ; |
| 660 | *skb_push(skb, 1) = ST21NFCA_NFCIP1_REQ; | 660 | *(u8 *)skb_push(skb, 1) = ST21NFCA_NFCIP1_REQ; |
| 661 | *skb_push(skb, 1) = skb->len; | 661 | *(u8 *)skb_push(skb, 1) = skb->len; |
| 662 | 662 | ||
| 663 | *skb_push(skb, 1) = info->dep_info.to | 0x10; | 663 | *(u8 *)skb_push(skb, 1) = info->dep_info.to | 0x10; |
| 664 | 664 | ||
| 665 | return nfc_hci_send_cmd_async(hdev, ST21NFCA_RF_READER_F_GATE, | 665 | return nfc_hci_send_cmd_async(hdev, ST21NFCA_RF_READER_F_GATE, |
| 666 | ST21NFCA_WR_XCHG_DATA, | 666 | ST21NFCA_WR_XCHG_DATA, |
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index c36f0e0afdfd..396cdafb3e36 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c | |||
| @@ -171,7 +171,7 @@ static void st21nfca_hci_add_len_crc(struct sk_buff *skb) | |||
| 171 | u16 crc; | 171 | u16 crc; |
| 172 | u8 tmp; | 172 | u8 tmp; |
| 173 | 173 | ||
| 174 | *skb_push(skb, 1) = 0; | 174 | *(u8 *)skb_push(skb, 1) = 0; |
| 175 | 175 | ||
| 176 | crc = crc_ccitt(0xffff, skb->data, skb->len); | 176 | crc = crc_ccitt(0xffff, skb->data, skb->len); |
| 177 | crc = ~crc; | 177 | crc = ~crc; |
| @@ -216,7 +216,7 @@ static int st21nfca_hci_i2c_write(void *phy_id, struct sk_buff *skb) | |||
| 216 | /* add ST21NFCA_SOF_EOF on tail */ | 216 | /* add ST21NFCA_SOF_EOF on tail */ |
| 217 | *(u8 *)skb_put(skb, 1) = ST21NFCA_SOF_EOF; | 217 | *(u8 *)skb_put(skb, 1) = ST21NFCA_SOF_EOF; |
| 218 | /* add ST21NFCA_SOF_EOF on head */ | 218 | /* add ST21NFCA_SOF_EOF on head */ |
| 219 | *skb_push(skb, 1) = ST21NFCA_SOF_EOF; | 219 | *(u8 *)skb_push(skb, 1) = ST21NFCA_SOF_EOF; |
| 220 | 220 | ||
| 221 | /* | 221 | /* |
| 222 | * Compute byte stuffing | 222 | * Compute byte stuffing |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 70b633f951ea..c6bc63b8b295 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
| @@ -759,8 +759,7 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, | |||
| 759 | sizeof(struct qeth_hdr)); | 759 | sizeof(struct qeth_hdr)); |
| 760 | if (!new_skb) | 760 | if (!new_skb) |
| 761 | goto tx_drop; | 761 | goto tx_drop; |
| 762 | hdr = (struct qeth_hdr *)skb_push(new_skb, | 762 | hdr = skb_push(new_skb, sizeof(struct qeth_hdr)); |
| 763 | sizeof(struct qeth_hdr)); | ||
| 764 | skb_set_mac_header(new_skb, sizeof(struct qeth_hdr)); | 763 | skb_set_mac_header(new_skb, sizeof(struct qeth_hdr)); |
| 765 | qeth_l2_fill_header(card, hdr, new_skb, cast_type); | 764 | qeth_l2_fill_header(card, hdr, new_skb, cast_type); |
| 766 | if (new_skb->ip_summed == CHECKSUM_PARTIAL) | 765 | if (new_skb->ip_summed == CHECKSUM_PARTIAL) |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 37b594231b76..3062cde33a3d 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
| @@ -2729,16 +2729,14 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, | |||
| 2729 | } | 2729 | } |
| 2730 | 2730 | ||
| 2731 | if (use_tso) { | 2731 | if (use_tso) { |
| 2732 | hdr = (struct qeth_hdr *)skb_push(new_skb, | 2732 | hdr = skb_push(new_skb, sizeof(struct qeth_hdr_tso)); |
| 2733 | sizeof(struct qeth_hdr_tso)); | ||
| 2734 | memset(hdr, 0, sizeof(struct qeth_hdr_tso)); | 2733 | memset(hdr, 0, sizeof(struct qeth_hdr_tso)); |
| 2735 | qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type); | 2734 | qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type); |
| 2736 | qeth_tso_fill_header(card, hdr, new_skb); | 2735 | qeth_tso_fill_header(card, hdr, new_skb); |
| 2737 | hdr_elements++; | 2736 | hdr_elements++; |
| 2738 | } else { | 2737 | } else { |
| 2739 | if (data_offset < 0) { | 2738 | if (data_offset < 0) { |
| 2740 | hdr = (struct qeth_hdr *)skb_push(new_skb, | 2739 | hdr = skb_push(new_skb, sizeof(struct qeth_hdr)); |
| 2741 | sizeof(struct qeth_hdr)); | ||
| 2742 | qeth_l3_fill_header(card, hdr, new_skb, ipv, | 2740 | qeth_l3_fill_header(card, hdr, new_skb, ipv, |
| 2743 | cast_type); | 2741 | cast_type); |
| 2744 | } else { | 2742 | } else { |
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index 1880eb6c68f7..7b09e7ddf35e 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | |||
| @@ -354,7 +354,7 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, | |||
| 354 | struct l2t_entry *l2t = csk->l2t; | 354 | struct l2t_entry *l2t = csk->l2t; |
| 355 | 355 | ||
| 356 | skb_reset_transport_header(skb); | 356 | skb_reset_transport_header(skb); |
| 357 | req = (struct tx_data_wr *)__skb_push(skb, sizeof(*req)); | 357 | req = __skb_push(skb, sizeof(*req)); |
| 358 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA) | | 358 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA) | |
| 359 | (req_completion ? F_WR_COMPL : 0)); | 359 | (req_completion ? F_WR_COMPL : 0)); |
| 360 | req->wr_lo = htonl(V_WR_TID(csk->tid)); | 360 | req->wr_lo = htonl(V_WR_TID(csk->tid)); |
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index 397094b8bad6..5485d68f286a 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | |||
| @@ -644,7 +644,7 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, | |||
| 644 | unsigned int wr_ulp_mode = 0, val; | 644 | unsigned int wr_ulp_mode = 0, val; |
| 645 | bool imm = is_ofld_imm(skb); | 645 | bool imm = is_ofld_imm(skb); |
| 646 | 646 | ||
| 647 | req = (struct fw_ofld_tx_data_wr *)__skb_push(skb, sizeof(*req)); | 647 | req = __skb_push(skb, sizeof(*req)); |
| 648 | 648 | ||
| 649 | if (imm) { | 649 | if (imm) { |
| 650 | req->op_to_immdlen = htonl(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) | | 650 | req->op_to_immdlen = htonl(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) | |
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index e17bdb3adf9e..fff6f1851dc1 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
| @@ -626,7 +626,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip, struct fc_lport *lport, | |||
| 626 | fh = (struct fc_frame_header *)skb->data; | 626 | fh = (struct fc_frame_header *)skb->data; |
| 627 | op = *(u8 *)(fh + 1); | 627 | op = *(u8 *)(fh + 1); |
| 628 | dlen = sizeof(struct fip_encaps) + skb->len; /* len before push */ | 628 | dlen = sizeof(struct fip_encaps) + skb->len; /* len before push */ |
| 629 | cap = (struct fip_encaps_head *)skb_push(skb, sizeof(*cap)); | 629 | cap = skb_push(skb, sizeof(*cap)); |
| 630 | memset(cap, 0, sizeof(*cap)); | 630 | memset(cap, 0, sizeof(*cap)); |
| 631 | 631 | ||
| 632 | if (lport->point_to_multipoint) { | 632 | if (lport->point_to_multipoint) { |
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index e3b964b7235a..e72becaad8a5 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c | |||
| @@ -1000,8 +1000,7 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
| 1000 | 1000 | ||
| 1001 | if (!fnic->vlan_hw_insert) { | 1001 | if (!fnic->vlan_hw_insert) { |
| 1002 | eth_hdr = (struct ethhdr *)skb_mac_header(skb); | 1002 | eth_hdr = (struct ethhdr *)skb_mac_header(skb); |
| 1003 | vlan_hdr = (struct vlan_ethhdr *)skb_push(skb, | 1003 | vlan_hdr = skb_push(skb, sizeof(*vlan_hdr) - sizeof(*eth_hdr)); |
| 1004 | sizeof(*vlan_hdr) - sizeof(*eth_hdr)); | ||
| 1005 | memcpy(vlan_hdr, eth_hdr, 2 * ETH_ALEN); | 1004 | memcpy(vlan_hdr, eth_hdr, 2 * ETH_ALEN); |
| 1006 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); | 1005 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); |
| 1007 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; | 1006 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; |
| @@ -1067,7 +1066,7 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
| 1067 | 1066 | ||
| 1068 | if (!fnic->vlan_hw_insert) { | 1067 | if (!fnic->vlan_hw_insert) { |
| 1069 | eth_hdr_len = sizeof(*vlan_hdr) + sizeof(*fcoe_hdr); | 1068 | eth_hdr_len = sizeof(*vlan_hdr) + sizeof(*fcoe_hdr); |
| 1070 | vlan_hdr = (struct vlan_ethhdr *)skb_push(skb, eth_hdr_len); | 1069 | vlan_hdr = skb_push(skb, eth_hdr_len); |
| 1071 | eth_hdr = (struct ethhdr *)vlan_hdr; | 1070 | eth_hdr = (struct ethhdr *)vlan_hdr; |
| 1072 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); | 1071 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); |
| 1073 | vlan_hdr->h_vlan_encapsulated_proto = htons(ETH_P_FCOE); | 1072 | vlan_hdr->h_vlan_encapsulated_proto = htons(ETH_P_FCOE); |
| @@ -1075,7 +1074,7 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
| 1075 | fcoe_hdr = (struct fcoe_hdr *)(vlan_hdr + 1); | 1074 | fcoe_hdr = (struct fcoe_hdr *)(vlan_hdr + 1); |
| 1076 | } else { | 1075 | } else { |
| 1077 | eth_hdr_len = sizeof(*eth_hdr) + sizeof(*fcoe_hdr); | 1076 | eth_hdr_len = sizeof(*eth_hdr) + sizeof(*fcoe_hdr); |
| 1078 | eth_hdr = (struct ethhdr *)skb_push(skb, eth_hdr_len); | 1077 | eth_hdr = skb_push(skb, eth_hdr_len); |
| 1079 | eth_hdr->h_proto = htons(ETH_P_FCOE); | 1078 | eth_hdr->h_proto = htons(ETH_P_FCOE); |
| 1080 | fcoe_hdr = (struct fcoe_hdr *)(eth_hdr + 1); | 1079 | fcoe_hdr = (struct fcoe_hdr *)(eth_hdr + 1); |
| 1081 | } | 1080 | } |
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index e10b91cc3c62..0d4bf70803ae 100644 --- a/drivers/scsi/qedf/qedf_fip.c +++ b/drivers/scsi/qedf/qedf_fip.c | |||
| @@ -125,8 +125,7 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
| 125 | sub = fiph->fip_subcode; | 125 | sub = fiph->fip_subcode; |
| 126 | 126 | ||
| 127 | if (!qedf->vlan_hw_insert) { | 127 | if (!qedf->vlan_hw_insert) { |
| 128 | vlan_hdr = (struct vlan_ethhdr *)skb_push(skb, sizeof(*vlan_hdr) | 128 | vlan_hdr = skb_push(skb, sizeof(*vlan_hdr) - sizeof(*eth_hdr)); |
| 129 | - sizeof(*eth_hdr)); | ||
| 130 | memcpy(vlan_hdr, eth_hdr, 2 * ETH_ALEN); | 129 | memcpy(vlan_hdr, eth_hdr, 2 * ETH_ALEN); |
| 131 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); | 130 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); |
| 132 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; | 131 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; |
diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index dbc266a37974..01efa80b4f88 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c | |||
| @@ -74,7 +74,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) | |||
| 74 | 74 | ||
| 75 | skb_put_data(skb, buff, size); | 75 | skb_put_data(skb, buff, size); |
| 76 | 76 | ||
| 77 | cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb, sizeof(*cb_hdr)); | 77 | cb_hdr = skb_push(skb, sizeof(*cb_hdr)); |
| 78 | memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); | 78 | memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); |
| 79 | 79 | ||
| 80 | cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ | 80 | cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ |
| @@ -101,7 +101,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) | |||
| 101 | return; | 101 | return; |
| 102 | 102 | ||
| 103 | skb_put_data(skb, buff, size); | 103 | skb_put_data(skb, buff, size); |
| 104 | hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, sizeof(*hdr)); | 104 | hdr = skb_push(skb, sizeof(*hdr)); |
| 105 | memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr)); | 105 | memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr)); |
| 106 | hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ | 106 | hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ |
| 107 | hdr->hdr.it_len = cpu_to_le16(sizeof(struct wilc_wfi_radiotap_hdr)); | 107 | hdr->hdr.it_len = cpu_to_le16(sizeof(struct wilc_wfi_radiotap_hdr)); |
| @@ -202,7 +202,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, | |||
| 202 | 202 | ||
| 203 | skb_put_data(skb2, skb->data, skb->len); | 203 | skb_put_data(skb2, skb->data, skb->len); |
| 204 | 204 | ||
| 205 | cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb2, sizeof(*cb_hdr)); | 205 | cb_hdr = skb_push(skb2, sizeof(*cb_hdr)); |
| 206 | memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); | 206 | memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr)); |
| 207 | 207 | ||
| 208 | cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ | 208 | cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */ |
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index a062e80361ef..fc8ad33ade9f 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c | |||
| @@ -148,9 +148,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv, | |||
| 148 | skb_pull(skb, ETH_HLEN); | 148 | skb_pull(skb, ETH_HLEN); |
| 149 | 149 | ||
| 150 | /* tack on SNAP */ | 150 | /* tack on SNAP */ |
| 151 | e_snap = | 151 | e_snap = skb_push(skb, sizeof(struct wlan_snap)); |
| 152 | (struct wlan_snap *)skb_push(skb, | ||
| 153 | sizeof(struct wlan_snap)); | ||
| 154 | e_snap->type = htons(proto); | 152 | e_snap->type = htons(proto); |
| 155 | if (ethconv == WLAN_ETHCONV_8021h && | 153 | if (ethconv == WLAN_ETHCONV_8021h && |
| 156 | p80211_stt_findproto(proto)) { | 154 | p80211_stt_findproto(proto)) { |
| @@ -162,9 +160,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv, | |||
| 162 | } | 160 | } |
| 163 | 161 | ||
| 164 | /* tack on llc */ | 162 | /* tack on llc */ |
| 165 | e_llc = | 163 | e_llc = skb_push(skb, sizeof(struct wlan_llc)); |
| 166 | (struct wlan_llc *)skb_push(skb, | ||
| 167 | sizeof(struct wlan_llc)); | ||
| 168 | e_llc->dsap = 0xAA; /* SNAP, see IEEE 802 */ | 164 | e_llc->dsap = 0xAA; /* SNAP, see IEEE 802 */ |
| 169 | e_llc->ssap = 0xAA; | 165 | e_llc->ssap = 0xAA; |
| 170 | e_llc->ctl = 0x03; | 166 | e_llc->ctl = 0x03; |
| @@ -407,7 +403,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, | |||
| 407 | skb_pull(skb, payload_offset); | 403 | skb_pull(skb, payload_offset); |
| 408 | 404 | ||
| 409 | /* create 802.3 header at beginning of skb. */ | 405 | /* create 802.3 header at beginning of skb. */ |
| 410 | e_hdr = (struct wlan_ethhdr *)skb_push(skb, ETH_HLEN); | 406 | e_hdr = skb_push(skb, ETH_HLEN); |
| 411 | ether_addr_copy(e_hdr->daddr, daddr); | 407 | ether_addr_copy(e_hdr->daddr, daddr); |
| 412 | ether_addr_copy(e_hdr->saddr, saddr); | 408 | ether_addr_copy(e_hdr->saddr, saddr); |
| 413 | e_hdr->type = htons(payload_length); | 409 | e_hdr->type = htons(payload_length); |
| @@ -448,7 +444,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, | |||
| 448 | skb_pull(skb, sizeof(struct wlan_snap)); | 444 | skb_pull(skb, sizeof(struct wlan_snap)); |
| 449 | 445 | ||
| 450 | /* create 802.3 header at beginning of skb. */ | 446 | /* create 802.3 header at beginning of skb. */ |
| 451 | e_hdr = (struct wlan_ethhdr *)skb_push(skb, ETH_HLEN); | 447 | e_hdr = skb_push(skb, ETH_HLEN); |
| 452 | e_hdr->type = e_snap->type; | 448 | e_hdr->type = e_snap->type; |
| 453 | ether_addr_copy(e_hdr->daddr, daddr); | 449 | ether_addr_copy(e_hdr->daddr, daddr); |
| 454 | ether_addr_copy(e_hdr->saddr, saddr); | 450 | ether_addr_copy(e_hdr->saddr, saddr); |
| @@ -475,7 +471,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, | |||
| 475 | skb_pull(skb, payload_offset); | 471 | skb_pull(skb, payload_offset); |
| 476 | 472 | ||
| 477 | /* create 802.3 header at beginning of skb. */ | 473 | /* create 802.3 header at beginning of skb. */ |
| 478 | e_hdr = (struct wlan_ethhdr *)skb_push(skb, ETH_HLEN); | 474 | e_hdr = skb_push(skb, ETH_HLEN); |
| 479 | ether_addr_copy(e_hdr->daddr, daddr); | 475 | ether_addr_copy(e_hdr->daddr, daddr); |
| 480 | ether_addr_copy(e_hdr->saddr, saddr); | 476 | ether_addr_copy(e_hdr->saddr, saddr); |
| 481 | e_hdr->type = htons(payload_length); | 477 | e_hdr->type = htons(payload_length); |
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c index bdcc8b4c522a..dda13f1af38e 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_target.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_target.c | |||
| @@ -136,7 +136,7 @@ cxgbit_cpl_tx_data_iso(struct sk_buff *skb, struct cxgbit_iso_info *iso_info) | |||
| 136 | unsigned int fslice = !!(iso_info->flags & CXGBIT_ISO_FSLICE); | 136 | unsigned int fslice = !!(iso_info->flags & CXGBIT_ISO_FSLICE); |
| 137 | unsigned int lslice = !!(iso_info->flags & CXGBIT_ISO_LSLICE); | 137 | unsigned int lslice = !!(iso_info->flags & CXGBIT_ISO_LSLICE); |
| 138 | 138 | ||
| 139 | cpl = (struct cpl_tx_data_iso *)__skb_push(skb, sizeof(*cpl)); | 139 | cpl = __skb_push(skb, sizeof(*cpl)); |
| 140 | 140 | ||
| 141 | cpl->op_to_scsi = htonl(CPL_TX_DATA_ISO_OP_V(CPL_TX_DATA_ISO) | | 141 | cpl->op_to_scsi = htonl(CPL_TX_DATA_ISO_OP_V(CPL_TX_DATA_ISO) | |
| 142 | CPL_TX_DATA_ISO_FIRST_V(fslice) | | 142 | CPL_TX_DATA_ISO_FIRST_V(fslice) | |
| @@ -183,8 +183,7 @@ cxgbit_tx_data_wr(struct cxgbit_sock *csk, struct sk_buff *skb, u32 dlen, | |||
| 183 | if (cxgbit_is_ofld_imm(skb)) | 183 | if (cxgbit_is_ofld_imm(skb)) |
| 184 | immlen += dlen; | 184 | immlen += dlen; |
| 185 | 185 | ||
| 186 | req = (struct fw_ofld_tx_data_wr *)__skb_push(skb, | 186 | req = __skb_push(skb, hdr_size); |
| 187 | hdr_size); | ||
| 188 | req->op_to_immdlen = cpu_to_be32(FW_WR_OP_V(opcode) | | 187 | req->op_to_immdlen = cpu_to_be32(FW_WR_OP_V(opcode) | |
| 189 | FW_WR_COMPL_V(compl) | | 188 | FW_WR_COMPL_V(compl) | |
| 190 | FW_WR_IMMDLEN_V(immlen)); | 189 | FW_WR_IMMDLEN_V(immlen)); |
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c index a3b5e468b116..d6341045c631 100644 --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c | |||
| @@ -999,7 +999,7 @@ void rndis_add_hdr(struct sk_buff *skb) | |||
| 999 | 999 | ||
| 1000 | if (!skb) | 1000 | if (!skb) |
| 1001 | return; | 1001 | return; |
| 1002 | header = (void *)skb_push(skb, sizeof(*header)); | 1002 | header = skb_push(skb, sizeof(*header)); |
| 1003 | memset(header, 0, sizeof *header); | 1003 | memset(header, 0, sizeof *header); |
| 1004 | header->MessageType = cpu_to_le32(RNDIS_MSG_PACKET); | 1004 | header->MessageType = cpu_to_le32(RNDIS_MSG_PACKET); |
| 1005 | header->MessageLength = cpu_to_le32(skb->len); | 1005 | header->MessageLength = cpu_to_le32(skb->len); |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 283dc2f5364d..5e6a2d4dc366 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -318,7 +318,7 @@ static inline int __vlan_insert_tag(struct sk_buff *skb, | |||
| 318 | if (skb_cow_head(skb, VLAN_HLEN) < 0) | 318 | if (skb_cow_head(skb, VLAN_HLEN) < 0) |
| 319 | return -ENOMEM; | 319 | return -ENOMEM; |
| 320 | 320 | ||
| 321 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); | 321 | veth = skb_push(skb, VLAN_HLEN); |
| 322 | 322 | ||
| 323 | /* Move the mac addresses to the beginning of the new header. */ | 323 | /* Move the mac addresses to the beginning of the new header. */ |
| 324 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); | 324 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ac9d10dadd1a..46bd514e719c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1923,8 +1923,8 @@ static inline void *skb_put_data(struct sk_buff *skb, const void *data, | |||
| 1923 | return tmp; | 1923 | return tmp; |
| 1924 | } | 1924 | } |
| 1925 | 1925 | ||
| 1926 | unsigned char *skb_push(struct sk_buff *skb, unsigned int len); | 1926 | void *skb_push(struct sk_buff *skb, unsigned int len); |
| 1927 | static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | 1927 | static inline void *__skb_push(struct sk_buff *skb, unsigned int len) |
| 1928 | { | 1928 | { |
| 1929 | skb->data -= len; | 1929 | skb->data -= len; |
| 1930 | skb->len += len; | 1930 | skb->len += len; |
| @@ -2951,8 +2951,7 @@ void *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | |||
| 2951 | * that the checksum difference is zero (e.g., a valid IP header) | 2951 | * that the checksum difference is zero (e.g., a valid IP header) |
| 2952 | * or you are setting ip_summed to CHECKSUM_NONE. | 2952 | * or you are setting ip_summed to CHECKSUM_NONE. |
| 2953 | */ | 2953 | */ |
| 2954 | static inline unsigned char *skb_push_rcsum(struct sk_buff *skb, | 2954 | static inline void *skb_push_rcsum(struct sk_buff *skb, unsigned int len) |
| 2955 | unsigned int len) | ||
| 2956 | { | 2955 | { |
| 2957 | skb_push(skb, len); | 2956 | skb_push(skb, len); |
| 2958 | skb_postpush_rcsum(skb, skb->data, len); | 2957 | skb_postpush_rcsum(skb, skb->data, len); |
diff --git a/net/802/fc.c b/net/802/fc.c index 1bb496ea997e..058a9f708918 100644 --- a/net/802/fc.c +++ b/net/802/fc.c | |||
| @@ -49,7 +49,7 @@ static int fc_header(struct sk_buff *skb, struct net_device *dev, | |||
| 49 | struct fcllc *fcllc; | 49 | struct fcllc *fcllc; |
| 50 | 50 | ||
| 51 | hdr_len = sizeof(struct fch_hdr) + sizeof(struct fcllc); | 51 | hdr_len = sizeof(struct fch_hdr) + sizeof(struct fcllc); |
| 52 | fch = (struct fch_hdr *)skb_push(skb, hdr_len); | 52 | fch = skb_push(skb, hdr_len); |
| 53 | fcllc = (struct fcllc *)(fch+1); | 53 | fcllc = (struct fcllc *)(fch+1); |
| 54 | fcllc->dsap = fcllc->ssap = EXTENDED_SAP; | 54 | fcllc->dsap = fcllc->ssap = EXTENDED_SAP; |
| 55 | fcllc->llc = UI_CMD; | 55 | fcllc->llc = UI_CMD; |
| @@ -59,7 +59,7 @@ static int fc_header(struct sk_buff *skb, struct net_device *dev, | |||
| 59 | else | 59 | else |
| 60 | { | 60 | { |
| 61 | hdr_len = sizeof(struct fch_hdr); | 61 | hdr_len = sizeof(struct fch_hdr); |
| 62 | fch = (struct fch_hdr *)skb_push(skb, hdr_len); | 62 | fch = skb_push(skb, hdr_len); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | if(saddr) | 65 | if(saddr) |
diff --git a/net/802/fddi.c b/net/802/fddi.c index 6356623fc238..90f1416567a1 100644 --- a/net/802/fddi.c +++ b/net/802/fddi.c | |||
| @@ -58,7 +58,7 @@ static int fddi_header(struct sk_buff *skb, struct net_device *dev, | |||
| 58 | 58 | ||
| 59 | if(type != ETH_P_IP && type != ETH_P_IPV6 && type != ETH_P_ARP) | 59 | if(type != ETH_P_IP && type != ETH_P_IPV6 && type != ETH_P_ARP) |
| 60 | hl=FDDI_K_8022_HLEN-3; | 60 | hl=FDDI_K_8022_HLEN-3; |
| 61 | fddi = (struct fddihdr *)skb_push(skb, hl); | 61 | fddi = skb_push(skb, hl); |
| 62 | fddi->fc = FDDI_FC_K_ASYNC_LLC_DEF; | 62 | fddi->fc = FDDI_FC_K_ASYNC_LLC_DEF; |
| 63 | if(type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP) | 63 | if(type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP) |
| 64 | { | 64 | { |
diff --git a/net/802/hippi.c b/net/802/hippi.c index 4460606e9c36..690308b9b94a 100644 --- a/net/802/hippi.c +++ b/net/802/hippi.c | |||
| @@ -47,7 +47,7 @@ static int hippi_header(struct sk_buff *skb, struct net_device *dev, | |||
| 47 | unsigned short type, | 47 | unsigned short type, |
| 48 | const void *daddr, const void *saddr, unsigned int len) | 48 | const void *daddr, const void *saddr, unsigned int len) |
| 49 | { | 49 | { |
| 50 | struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN); | 50 | struct hippi_hdr *hip = skb_push(skb, HIPPI_HLEN); |
| 51 | struct hippi_cb *hcb = (struct hippi_cb *) skb->cb; | 51 | struct hippi_cb *hcb = (struct hippi_cb *) skb->cb; |
| 52 | 52 | ||
| 53 | if (!len){ | 53 | if (!len){ |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index c1742322f7d2..f7e83f6d2e64 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -58,7 +58,7 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, | |||
| 58 | int rc; | 58 | int rc; |
| 59 | 59 | ||
| 60 | if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) { | 60 | if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) { |
| 61 | vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN); | 61 | vhdr = skb_push(skb, VLAN_HLEN); |
| 62 | 62 | ||
| 63 | vlan_tci = vlan->vlan_id; | 63 | vlan_tci = vlan->vlan_id; |
| 64 | vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb->priority); | 64 | vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb->priority); |
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index c7af6dc70fa2..5d035c1f1156 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
| @@ -1529,7 +1529,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
| 1529 | * The push leaves us with a ddephdr not an shdr, and | 1529 | * The push leaves us with a ddephdr not an shdr, and |
| 1530 | * handily the port bytes in the right place preset. | 1530 | * handily the port bytes in the right place preset. |
| 1531 | */ | 1531 | */ |
| 1532 | ddp = (struct ddpehdr *) skb_push(skb, sizeof(*ddp) - 4); | 1532 | ddp = skb_push(skb, sizeof(*ddp) - 4); |
| 1533 | 1533 | ||
| 1534 | /* Now fill in the long header */ | 1534 | /* Now fill in the long header */ |
| 1535 | 1535 | ||
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index b7c486752b3a..0c92ba0cbe0b 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -1562,7 +1562,7 @@ static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) | |||
| 1562 | 1562 | ||
| 1563 | /* Add the PID if one is not supplied by the user in the skb */ | 1563 | /* Add the PID if one is not supplied by the user in the skb */ |
| 1564 | if (!ax25->pidincl) | 1564 | if (!ax25->pidincl) |
| 1565 | *skb_push(skb, 1) = sk->sk_protocol; | 1565 | *(u8 *)skb_push(skb, 1) = sk->sk_protocol; |
| 1566 | 1566 | ||
| 1567 | if (sk->sk_type == SOCK_SEQPACKET) { | 1567 | if (sk->sk_type == SOCK_SEQPACKET) { |
| 1568 | /* Connected mode sockets go via the LAPB machine */ | 1568 | /* Connected mode sockets go via the LAPB machine */ |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1301a8786d8d..cdb5c1a7481e 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
| @@ -332,7 +332,7 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 332 | return; | 332 | return; |
| 333 | 333 | ||
| 334 | /* Put header before the data */ | 334 | /* Put header before the data */ |
| 335 | hdr = (void *)skb_push(skb_copy, HCI_MON_HDR_SIZE); | 335 | hdr = skb_push(skb_copy, HCI_MON_HDR_SIZE); |
| 336 | hdr->opcode = opcode; | 336 | hdr->opcode = opcode; |
| 337 | hdr->index = cpu_to_le16(hdev->id); | 337 | hdr->index = cpu_to_le16(hdev->id); |
| 338 | hdr->len = cpu_to_le16(skb->len); | 338 | hdr->len = cpu_to_le16(skb->len); |
| @@ -383,7 +383,7 @@ void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event, | |||
| 383 | 383 | ||
| 384 | skb->tstamp = tstamp; | 384 | skb->tstamp = tstamp; |
| 385 | 385 | ||
| 386 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 386 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 387 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_EVENT); | 387 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_EVENT); |
| 388 | hdr->index = index; | 388 | hdr->index = index; |
| 389 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); | 389 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); |
| @@ -467,7 +467,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) | |||
| 467 | 467 | ||
| 468 | __net_timestamp(skb); | 468 | __net_timestamp(skb); |
| 469 | 469 | ||
| 470 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 470 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 471 | hdr->opcode = opcode; | 471 | hdr->opcode = opcode; |
| 472 | hdr->index = cpu_to_le16(hdev->id); | 472 | hdr->index = cpu_to_le16(hdev->id); |
| 473 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); | 473 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); |
| @@ -522,7 +522,7 @@ static struct sk_buff *create_monitor_ctrl_open(struct sock *sk) | |||
| 522 | 522 | ||
| 523 | __net_timestamp(skb); | 523 | __net_timestamp(skb); |
| 524 | 524 | ||
| 525 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 525 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 526 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_OPEN); | 526 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_OPEN); |
| 527 | if (hci_pi(sk)->hdev) | 527 | if (hci_pi(sk)->hdev) |
| 528 | hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); | 528 | hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); |
| @@ -560,7 +560,7 @@ static struct sk_buff *create_monitor_ctrl_close(struct sock *sk) | |||
| 560 | 560 | ||
| 561 | __net_timestamp(skb); | 561 | __net_timestamp(skb); |
| 562 | 562 | ||
| 563 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 563 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 564 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_CLOSE); | 564 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_CLOSE); |
| 565 | if (hci_pi(sk)->hdev) | 565 | if (hci_pi(sk)->hdev) |
| 566 | hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); | 566 | hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); |
| @@ -590,7 +590,7 @@ static struct sk_buff *create_monitor_ctrl_command(struct sock *sk, u16 index, | |||
| 590 | 590 | ||
| 591 | __net_timestamp(skb); | 591 | __net_timestamp(skb); |
| 592 | 592 | ||
| 593 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 593 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 594 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_COMMAND); | 594 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_COMMAND); |
| 595 | hdr->index = cpu_to_le16(index); | 595 | hdr->index = cpu_to_le16(index); |
| 596 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); | 596 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); |
diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c index d057113e0d4b..0d0a6d77b9e8 100644 --- a/net/bluetooth/mgmt_util.c +++ b/net/bluetooth/mgmt_util.c | |||
| @@ -48,7 +48,7 @@ static struct sk_buff *create_monitor_ctrl_event(__le16 index, u32 cookie, | |||
| 48 | 48 | ||
| 49 | __net_timestamp(skb); | 49 | __net_timestamp(skb); |
| 50 | 50 | ||
| 51 | hdr = (void *)skb_push(skb, HCI_MON_HDR_SIZE); | 51 | hdr = skb_push(skb, HCI_MON_HDR_SIZE); |
| 52 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_EVENT); | 52 | hdr->opcode = cpu_to_le16(HCI_MON_CTRL_EVENT); |
| 53 | hdr->index = index; | 53 | hdr->index = index; |
| 54 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); | 54 | hdr->len = cpu_to_le16(skb->len - HCI_MON_HDR_SIZE); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 1a9b906c5a35..4a0b41d75c84 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
| @@ -1149,10 +1149,10 @@ static void rfcomm_make_uih(struct sk_buff *skb, u8 addr) | |||
| 1149 | u8 *crc; | 1149 | u8 *crc; |
| 1150 | 1150 | ||
| 1151 | if (len > 127) { | 1151 | if (len > 127) { |
| 1152 | hdr = (void *) skb_push(skb, 4); | 1152 | hdr = skb_push(skb, 4); |
| 1153 | put_unaligned(cpu_to_le16(__len16(len)), (__le16 *) &hdr->len); | 1153 | put_unaligned(cpu_to_le16(__len16(len)), (__le16 *) &hdr->len); |
| 1154 | } else { | 1154 | } else { |
| 1155 | hdr = (void *) skb_push(skb, 3); | 1155 | hdr = skb_push(skb, 3); |
| 1156 | hdr->len = __len8(len); | 1156 | hdr->len = __len8(len); |
| 1157 | } | 1157 | } |
| 1158 | hdr->addr = addr; | 1158 | hdr->addr = addr; |
diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c index 15bf0c5322ab..a05775afa44b 100644 --- a/net/bridge/netfilter/nft_reject_bridge.c +++ b/net/bridge/netfilter/nft_reject_bridge.c | |||
| @@ -28,7 +28,7 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb, | |||
| 28 | { | 28 | { |
| 29 | struct ethhdr *eth; | 29 | struct ethhdr *eth; |
| 30 | 30 | ||
| 31 | eth = (struct ethhdr *)skb_push(nskb, ETH_HLEN); | 31 | eth = skb_push(nskb, ETH_HLEN); |
| 32 | skb_reset_mac_header(nskb); | 32 | skb_reset_mac_header(nskb); |
| 33 | ether_addr_copy(eth->h_source, eth_hdr(oldskb)->h_dest); | 33 | ether_addr_copy(eth->h_source, eth_hdr(oldskb)->h_dest); |
| 34 | ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source); | 34 | ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source); |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 29be2466970c..37c1e34ddd85 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
| @@ -441,7 +441,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
| 441 | ip6h->saddr = np->local_ip.in6; | 441 | ip6h->saddr = np->local_ip.in6; |
| 442 | ip6h->daddr = np->remote_ip.in6; | 442 | ip6h->daddr = np->remote_ip.in6; |
| 443 | 443 | ||
| 444 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); | 444 | eth = skb_push(skb, ETH_HLEN); |
| 445 | skb_reset_mac_header(skb); | 445 | skb_reset_mac_header(skb); |
| 446 | skb->protocol = eth->h_proto = htons(ETH_P_IPV6); | 446 | skb->protocol = eth->h_proto = htons(ETH_P_IPV6); |
| 447 | } else { | 447 | } else { |
| @@ -470,7 +470,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
| 470 | put_unaligned(np->remote_ip.ip, &(iph->daddr)); | 470 | put_unaligned(np->remote_ip.ip, &(iph->daddr)); |
| 471 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 471 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
| 472 | 472 | ||
| 473 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); | 473 | eth = skb_push(skb, ETH_HLEN); |
| 474 | skb_reset_mac_header(skb); | 474 | skb_reset_mac_header(skb); |
| 475 | skb->protocol = eth->h_proto = htons(ETH_P_IP); | 475 | skb->protocol = eth->h_proto = htons(ETH_P_IP); |
| 476 | } | 476 | } |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index b8bcf9021329..2dd42c5b0366 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -2675,7 +2675,7 @@ static int process_ipsec(struct pktgen_dev *pkt_dev, | |||
| 2675 | goto err; | 2675 | goto err; |
| 2676 | } | 2676 | } |
| 2677 | /* restore ll */ | 2677 | /* restore ll */ |
| 2678 | eth = (struct ethhdr *)skb_push(skb, ETH_HLEN); | 2678 | eth = skb_push(skb, ETH_HLEN); |
| 2679 | memcpy(eth, pkt_dev->hh, 2 * ETH_ALEN); | 2679 | memcpy(eth, pkt_dev->hh, 2 * ETH_ALEN); |
| 2680 | eth->h_proto = protocol; | 2680 | eth->h_proto = protocol; |
| 2681 | 2681 | ||
| @@ -2844,7 +2844,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
| 2844 | skb_reserve(skb, 16); | 2844 | skb_reserve(skb, 16); |
| 2845 | 2845 | ||
| 2846 | /* Reserve for ethernet and IP header */ | 2846 | /* Reserve for ethernet and IP header */ |
| 2847 | eth = (__u8 *) skb_push(skb, 14); | 2847 | eth = skb_push(skb, 14); |
| 2848 | mpls = skb_put(skb, pkt_dev->nr_labels * sizeof(__u32)); | 2848 | mpls = skb_put(skb, pkt_dev->nr_labels * sizeof(__u32)); |
| 2849 | if (pkt_dev->nr_labels) | 2849 | if (pkt_dev->nr_labels) |
| 2850 | mpls_push(mpls, pkt_dev); | 2850 | mpls_push(mpls, pkt_dev); |
| @@ -2972,7 +2972,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, | |||
| 2972 | skb_reserve(skb, 16); | 2972 | skb_reserve(skb, 16); |
| 2973 | 2973 | ||
| 2974 | /* Reserve for ethernet and IP header */ | 2974 | /* Reserve for ethernet and IP header */ |
| 2975 | eth = (__u8 *) skb_push(skb, 14); | 2975 | eth = skb_push(skb, 14); |
| 2976 | mpls = skb_put(skb, pkt_dev->nr_labels * sizeof(__u32)); | 2976 | mpls = skb_put(skb, pkt_dev->nr_labels * sizeof(__u32)); |
| 2977 | if (pkt_dev->nr_labels) | 2977 | if (pkt_dev->nr_labels) |
| 2978 | mpls_push(mpls, pkt_dev); | 2978 | mpls_push(mpls, pkt_dev); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9a1639f7d61a..f75897a33fa4 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -1461,7 +1461,7 @@ EXPORT_SYMBOL(skb_put); | |||
| 1461 | * start. If this would exceed the total buffer headroom the kernel will | 1461 | * start. If this would exceed the total buffer headroom the kernel will |
| 1462 | * panic. A pointer to the first byte of the extra data is returned. | 1462 | * panic. A pointer to the first byte of the extra data is returned. |
| 1463 | */ | 1463 | */ |
| 1464 | unsigned char *skb_push(struct sk_buff *skb, unsigned int len) | 1464 | void *skb_push(struct sk_buff *skb, unsigned int len) |
| 1465 | { | 1465 | { |
| 1466 | skb->data -= len; | 1466 | skb->data -= len; |
| 1467 | skb->len += len; | 1467 | skb->len += len; |
diff --git a/net/dccp/options.c b/net/dccp/options.c index 74d29c56c367..51cdfc3bd8ca 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
| @@ -484,7 +484,7 @@ int dccp_insert_option_mandatory(struct sk_buff *skb) | |||
| 484 | return -1; | 484 | return -1; |
| 485 | 485 | ||
| 486 | DCCP_SKB_CB(skb)->dccpd_opt_len++; | 486 | DCCP_SKB_CB(skb)->dccpd_opt_len++; |
| 487 | *skb_push(skb, 1) = DCCPO_MANDATORY; | 487 | *(u8 *)skb_push(skb, 1) = DCCPO_MANDATORY; |
| 488 | return 0; | 488 | return 0; |
| 489 | } | 489 | } |
| 490 | 490 | ||
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 1d84f6dae315..fa0110b57ca1 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
| @@ -867,7 +867,7 @@ static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa) | |||
| 867 | msg->datalen = 0x02; | 867 | msg->datalen = 0x02; |
| 868 | memset(msg->data, 0xAA, 2); | 868 | memset(msg->data, 0xAA, 2); |
| 869 | 869 | ||
| 870 | pktlen = (__le16 *)skb_push(skb,2); | 870 | pktlen = skb_push(skb, 2); |
| 871 | *pktlen = cpu_to_le16(skb->len - 2); | 871 | *pktlen = cpu_to_le16(skb->len - 2); |
| 872 | 872 | ||
| 873 | skb_reset_network_header(skb); | 873 | skb_reset_network_header(skb); |
| @@ -959,7 +959,7 @@ static void dn_send_router_hello(struct net_device *dev, struct dn_ifaddr *ifa) | |||
| 959 | 959 | ||
| 960 | skb_trim(skb, (27 + *i2)); | 960 | skb_trim(skb, (27 + *i2)); |
| 961 | 961 | ||
| 962 | pktlen = (__le16 *)skb_push(skb, 2); | 962 | pktlen = skb_push(skb, 2); |
| 963 | *pktlen = cpu_to_le16(skb->len - 2); | 963 | *pktlen = cpu_to_le16(skb->len - 2); |
| 964 | 964 | ||
| 965 | skb_reset_network_header(skb); | 965 | skb_reset_network_header(skb); |
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 1446810047f5..eaeba9b99a73 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
| @@ -83,7 +83,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, | |||
| 83 | unsigned short type, | 83 | unsigned short type, |
| 84 | const void *daddr, const void *saddr, unsigned int len) | 84 | const void *daddr, const void *saddr, unsigned int len) |
| 85 | { | 85 | { |
| 86 | struct ethhdr *eth = (struct ethhdr *)skb_push(skb, ETH_HLEN); | 86 | struct ethhdr *eth = skb_push(skb, ETH_HLEN); |
| 87 | 87 | ||
| 88 | if (type != ETH_P_802_3 && type != ETH_P_802_2) | 88 | if (type != ETH_P_802_3 && type != ETH_P_802_2) |
| 89 | eth->h_proto = htons(type); | 89 | eth->h_proto = htons(type); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index d815d1755473..1f18b4650253 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
| @@ -609,7 +609,7 @@ static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi) | |||
| 609 | * decryption. | 609 | * decryption. |
| 610 | */ | 610 | */ |
| 611 | if ((x->props.flags & XFRM_STATE_ESN)) { | 611 | if ((x->props.flags & XFRM_STATE_ESN)) { |
| 612 | esph = (void *)skb_push(skb, 4); | 612 | esph = skb_push(skb, 4); |
| 613 | *seqhi = esph->spi; | 613 | *seqhi = esph->spi; |
| 614 | esph->spi = esph->seq_no; | 614 | esph->spi = esph->seq_no; |
| 615 | esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi; | 615 | esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index e90c80a548ad..41394a4b9af9 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
| @@ -592,7 +592,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev, | |||
| 592 | struct iphdr *iph; | 592 | struct iphdr *iph; |
| 593 | struct gre_base_hdr *greh; | 593 | struct gre_base_hdr *greh; |
| 594 | 594 | ||
| 595 | iph = (struct iphdr *)skb_push(skb, t->hlen + sizeof(*iph)); | 595 | iph = skb_push(skb, t->hlen + sizeof(*iph)); |
| 596 | greh = (struct gre_base_hdr *)(iph+1); | 596 | greh = (struct gre_base_hdr *)(iph+1); |
| 597 | greh->flags = gre_tnl_flags_to_gre_flags(t->parms.o_flags); | 597 | greh->flags = gre_tnl_flags_to_gre_flags(t->parms.o_flags); |
| 598 | greh->protocol = htons(type); | 598 | greh->protocol = htons(type); |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 2ede4e459c4e..d8b40ff4b2e6 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
| @@ -538,7 +538,7 @@ static void esp_input_set_header(struct sk_buff *skb, __be32 *seqhi) | |||
| 538 | * decryption. | 538 | * decryption. |
| 539 | */ | 539 | */ |
| 540 | if ((x->props.flags & XFRM_STATE_ESN)) { | 540 | if ((x->props.flags & XFRM_STATE_ESN)) { |
| 541 | esph = (void *)skb_push(skb, 4); | 541 | esph = skb_push(skb, 4); |
| 542 | *seqhi = esph->spi; | 542 | *seqhi = esph->spi; |
| 543 | esph->spi = esph->seq_no; | 543 | esph->spi = esph->seq_no; |
| 544 | esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi; | 544 | esph->seq_no = XFRM_SKB_CB(skb)->seq.input.hi; |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index b636f1da9aec..0460af226011 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
| @@ -847,7 +847,7 @@ static void ipv6_push_rthdr0(struct sk_buff *skb, u8 *proto, | |||
| 847 | 847 | ||
| 848 | ihdr = (struct rt0_hdr *) opt; | 848 | ihdr = (struct rt0_hdr *) opt; |
| 849 | 849 | ||
| 850 | phdr = (struct rt0_hdr *) skb_push(skb, (ihdr->rt_hdr.hdrlen + 1) << 3); | 850 | phdr = skb_push(skb, (ihdr->rt_hdr.hdrlen + 1) << 3); |
| 851 | memcpy(phdr, ihdr, sizeof(struct rt0_hdr)); | 851 | memcpy(phdr, ihdr, sizeof(struct rt0_hdr)); |
| 852 | 852 | ||
| 853 | hops = ihdr->rt_hdr.hdrlen >> 1; | 853 | hops = ihdr->rt_hdr.hdrlen >> 1; |
| @@ -873,7 +873,7 @@ static void ipv6_push_rthdr4(struct sk_buff *skb, u8 *proto, | |||
| 873 | sr_ihdr = (struct ipv6_sr_hdr *)opt; | 873 | sr_ihdr = (struct ipv6_sr_hdr *)opt; |
| 874 | plen = (sr_ihdr->hdrlen + 1) << 3; | 874 | plen = (sr_ihdr->hdrlen + 1) << 3; |
| 875 | 875 | ||
| 876 | sr_phdr = (struct ipv6_sr_hdr *)skb_push(skb, plen); | 876 | sr_phdr = skb_push(skb, plen); |
| 877 | memcpy(sr_phdr, sr_ihdr, sizeof(struct ipv6_sr_hdr)); | 877 | memcpy(sr_phdr, sr_ihdr, sizeof(struct ipv6_sr_hdr)); |
| 878 | 878 | ||
| 879 | hops = sr_ihdr->first_segment + 1; | 879 | hops = sr_ihdr->first_segment + 1; |
| @@ -923,7 +923,7 @@ static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, | |||
| 923 | 923 | ||
| 924 | static void ipv6_push_exthdr(struct sk_buff *skb, u8 *proto, u8 type, struct ipv6_opt_hdr *opt) | 924 | static void ipv6_push_exthdr(struct sk_buff *skb, u8 *proto, u8 type, struct ipv6_opt_hdr *opt) |
| 925 | { | 925 | { |
| 926 | struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_push(skb, ipv6_optlen(opt)); | 926 | struct ipv6_opt_hdr *h = skb_push(skb, ipv6_optlen(opt)); |
| 927 | 927 | ||
| 928 | memcpy(h, opt, ipv6_optlen(opt)); | 928 | memcpy(h, opt, ipv6_optlen(opt)); |
| 929 | h->nexthdr = *proto; | 929 | h->nexthdr = *proto; |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 64eea3962733..e0e726c338a7 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
| @@ -942,7 +942,7 @@ static int ip6gre_header(struct sk_buff *skb, struct net_device *dev, | |||
| 942 | const void *daddr, const void *saddr, unsigned int len) | 942 | const void *daddr, const void *saddr, unsigned int len) |
| 943 | { | 943 | { |
| 944 | struct ip6_tnl *t = netdev_priv(dev); | 944 | struct ip6_tnl *t = netdev_priv(dev); |
| 945 | struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb_push(skb, t->hlen); | 945 | struct ipv6hdr *ipv6h = skb_push(skb, t->hlen); |
| 946 | __be16 *p = (__be16 *)(ipv6h+1); | 946 | __be16 *p = (__be16 *)(ipv6h+1); |
| 947 | 947 | ||
| 948 | ip6_flow_hdr(ipv6h, 0, | 948 | ip6_flow_hdr(ipv6h, 0, |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0d6f3b6345de..8b8efb0e55bf 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -682,7 +682,7 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, | |||
| 682 | skb_frag_list_init(skb); | 682 | skb_frag_list_init(skb); |
| 683 | 683 | ||
| 684 | __skb_pull(skb, hlen); | 684 | __skb_pull(skb, hlen); |
| 685 | fh = (struct frag_hdr *)__skb_push(skb, sizeof(struct frag_hdr)); | 685 | fh = __skb_push(skb, sizeof(struct frag_hdr)); |
| 686 | __skb_push(skb, hlen); | 686 | __skb_push(skb, hlen); |
| 687 | skb_reset_network_header(skb); | 687 | skb_reset_network_header(skb); |
| 688 | memcpy(skb_network_header(skb), tmp_hdr, hlen); | 688 | memcpy(skb_network_header(skb), tmp_hdr, hlen); |
| @@ -706,7 +706,7 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, | |||
| 706 | if (frag) { | 706 | if (frag) { |
| 707 | frag->ip_summed = CHECKSUM_NONE; | 707 | frag->ip_summed = CHECKSUM_NONE; |
| 708 | skb_reset_transport_header(frag); | 708 | skb_reset_transport_header(frag); |
| 709 | fh = (struct frag_hdr *)__skb_push(frag, sizeof(struct frag_hdr)); | 709 | fh = __skb_push(frag, sizeof(struct frag_hdr)); |
| 710 | __skb_push(frag, hlen); | 710 | __skb_push(frag, hlen); |
| 711 | skb_reset_network_header(frag); | 711 | skb_reset_network_header(frag); |
| 712 | memcpy(skb_network_header(frag), tmp_hdr, | 712 | memcpy(skb_network_header(frag), tmp_hdr, |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 84ad50218255..6264917fe4c7 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
| @@ -789,7 +789,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 | |||
| 789 | 789 | ||
| 790 | skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len); | 790 | skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len); |
| 791 | 791 | ||
| 792 | t1 = (struct tcphdr *) skb_push(buff, tot_len); | 792 | t1 = skb_push(buff, tot_len); |
| 793 | skb_reset_transport_header(buff); | 793 | skb_reset_transport_header(buff); |
| 794 | 794 | ||
| 795 | /* Swap the send and the receive. */ | 795 | /* Swap the send and the receive. */ |
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c index 7f17a8020e8a..e390bceeb2f8 100644 --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c | |||
| @@ -1065,7 +1065,7 @@ irnet_data_indication(void * instance, | |||
| 1065 | if(p[0] & 1) | 1065 | if(p[0] & 1) |
| 1066 | { | 1066 | { |
| 1067 | /* protocol is compressed */ | 1067 | /* protocol is compressed */ |
| 1068 | skb_push(skb, 1)[0] = 0; | 1068 | *(u8 *)skb_push(skb, 1) = 0; |
| 1069 | } | 1069 | } |
| 1070 | else | 1070 | else |
| 1071 | if(skb->len < 2) | 1071 | if(skb->len < 2) |
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 84de7b6326dc..2cf9d59f1b72 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
| @@ -322,8 +322,7 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock, | |||
| 322 | int err, confirm_recv = 0; | 322 | int err, confirm_recv = 0; |
| 323 | 323 | ||
| 324 | memset(skb->head, 0, ETH_HLEN); | 324 | memset(skb->head, 0, ETH_HLEN); |
| 325 | phs_hdr = (struct af_iucv_trans_hdr *)skb_push(skb, | 325 | phs_hdr = skb_push(skb, sizeof(struct af_iucv_trans_hdr)); |
| 326 | sizeof(struct af_iucv_trans_hdr)); | ||
| 327 | skb_reset_mac_header(skb); | 326 | skb_reset_mac_header(skb); |
| 328 | skb_reset_network_header(skb); | 327 | skb_reset_network_header(skb); |
| 329 | skb_push(skb, ETH_HLEN); | 328 | skb_push(skb, ETH_HLEN); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 53b00bb52095..70e9d2ca8bbe 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -273,7 +273,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | |||
| 273 | if (!(has_fcs && ieee80211_hw_check(&local->hw, RX_INCLUDES_FCS))) | 273 | if (!(has_fcs && ieee80211_hw_check(&local->hw, RX_INCLUDES_FCS))) |
| 274 | mpdulen += FCS_LEN; | 274 | mpdulen += FCS_LEN; |
| 275 | 275 | ||
| 276 | rthdr = (struct ieee80211_radiotap_header *)skb_push(skb, rtap_len); | 276 | rthdr = skb_push(skb, rtap_len); |
| 277 | memset(rthdr, 0, rtap_len - rtap.len - rtap.pad); | 277 | memset(rthdr, 0, rtap_len - rtap.len - rtap.pad); |
| 278 | it_present = &rthdr->it_present; | 278 | it_present = &rthdr->it_present; |
| 279 | 279 | ||
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index a9fa6ee57e8f..da7427a41529 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
| @@ -288,7 +288,7 @@ ieee80211_add_tx_radiotap_header(struct ieee80211_local *local, | |||
| 288 | unsigned char *pos; | 288 | unsigned char *pos; |
| 289 | u16 txflags; | 289 | u16 txflags; |
| 290 | 290 | ||
| 291 | rthdr = (struct ieee80211_radiotap_header *) skb_push(skb, rtap_len); | 291 | rthdr = skb_push(skb, rtap_len); |
| 292 | 292 | ||
| 293 | memset(rthdr, 0, rtap_len); | 293 | memset(rthdr, 0, rtap_len); |
| 294 | rthdr->it_len = cpu_to_le16(rtap_len); | 294 | rthdr->it_len = cpu_to_le16(rtap_len); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index ec5a9a72797e..8858f4f185e9 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -2708,7 +2708,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, | |||
| 2708 | if (ieee80211_is_data_qos(fc)) { | 2708 | if (ieee80211_is_data_qos(fc)) { |
| 2709 | __le16 *qos_control; | 2709 | __le16 *qos_control; |
| 2710 | 2710 | ||
| 2711 | qos_control = (__le16 *) skb_push(skb, 2); | 2711 | qos_control = skb_push(skb, 2); |
| 2712 | memcpy(skb_push(skb, hdrlen - 2), &hdr, hdrlen - 2); | 2712 | memcpy(skb_push(skb, hdrlen - 2), &hdr, hdrlen - 2); |
| 2713 | /* | 2713 | /* |
| 2714 | * Maybe we could actually set some fields here, for now just | 2714 | * Maybe we could actually set some fields here, for now just |
| @@ -3347,7 +3347,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, | |||
| 3347 | } | 3347 | } |
| 3348 | 3348 | ||
| 3349 | memcpy(ð, skb->data, ETH_HLEN - 2); | 3349 | memcpy(ð, skb->data, ETH_HLEN - 2); |
| 3350 | hdr = (void *)skb_push(skb, extra_head); | 3350 | hdr = skb_push(skb, extra_head); |
| 3351 | memcpy(skb->data, fast_tx->hdr, fast_tx->hdr_len); | 3351 | memcpy(skb->data, fast_tx->hdr, fast_tx->hdr_len); |
| 3352 | memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN); | 3352 | memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN); |
| 3353 | memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN); | 3353 | memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN); |
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c index b010ae94175b..5e03ed190e18 100644 --- a/net/ncsi/ncsi-cmd.c +++ b/net/ncsi/ncsi-cmd.c | |||
| @@ -331,7 +331,7 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca) | |||
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | /* Fill the ethernet header */ | 333 | /* Fill the ethernet header */ |
| 334 | eh = (struct ethhdr *)skb_push(nr->cmd, sizeof(*eh)); | 334 | eh = skb_push(nr->cmd, sizeof(*eh)); |
| 335 | eh->h_proto = htons(ETH_P_NCSI); | 335 | eh->h_proto = htons(ETH_P_NCSI); |
| 336 | eth_broadcast_addr(eh->h_dest); | 336 | eth_broadcast_addr(eh->h_dest); |
| 337 | eth_broadcast_addr(eh->h_source); | 337 | eth_broadcast_addr(eh->h_source); |
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c index 82471af5553e..f948fc2099d2 100644 --- a/net/nfc/digital_dep.c +++ b/net/nfc/digital_dep.c | |||
| @@ -185,7 +185,7 @@ static void digital_skb_push_dep_sod(struct nfc_digital_dev *ddev, | |||
| 185 | skb->data[0] = skb->len; | 185 | skb->data[0] = skb->len; |
| 186 | 186 | ||
| 187 | if (ddev->curr_rf_tech == NFC_DIGITAL_RF_TECH_106A) | 187 | if (ddev->curr_rf_tech == NFC_DIGITAL_RF_TECH_106A) |
| 188 | *skb_push(skb, sizeof(u8)) = DIGITAL_NFC_DEP_NFCA_SOD_SB; | 188 | *(u8 *)skb_push(skb, sizeof(u8)) = DIGITAL_NFC_DEP_NFCA_SOD_SB; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | static int digital_skb_pull_dep_sod(struct nfc_digital_dev *ddev, | 191 | static int digital_skb_pull_dep_sod(struct nfc_digital_dev *ddev, |
diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c index fae6d31b377c..492204e440ec 100644 --- a/net/nfc/digital_technology.c +++ b/net/nfc/digital_technology.c | |||
| @@ -828,7 +828,7 @@ int digital_in_send_sensf_req(struct nfc_digital_dev *ddev, u8 rf_tech) | |||
| 828 | sensf_req->rc = 0; | 828 | sensf_req->rc = 0; |
| 829 | sensf_req->tsn = 0; | 829 | sensf_req->tsn = 0; |
| 830 | 830 | ||
| 831 | *skb_push(skb, 1) = size + 1; | 831 | *(u8 *)skb_push(skb, 1) = size + 1; |
| 832 | 832 | ||
| 833 | if (!DIGITAL_DRV_CAPS_IN_CRC(ddev)) | 833 | if (!DIGITAL_DRV_CAPS_IN_CRC(ddev)) |
| 834 | digital_skb_add_crc_f(skb); | 834 | digital_skb_add_crc_f(skb); |
| @@ -1161,7 +1161,7 @@ static int digital_tg_send_sensf_res(struct nfc_digital_dev *ddev, | |||
| 1161 | break; | 1161 | break; |
| 1162 | } | 1162 | } |
| 1163 | 1163 | ||
| 1164 | *skb_push(skb, sizeof(u8)) = size + 1; | 1164 | *(u8 *)skb_push(skb, sizeof(u8)) = size + 1; |
| 1165 | 1165 | ||
| 1166 | if (!DIGITAL_DRV_CAPS_TG_CRC(ddev)) | 1166 | if (!DIGITAL_DRV_CAPS_TG_CRC(ddev)) |
| 1167 | digital_skb_add_crc_f(skb); | 1167 | digital_skb_add_crc_f(skb); |
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 3a0c94590411..7b2bdda1514c 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
| @@ -727,7 +727,7 @@ static int hci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target, | |||
| 727 | break; | 727 | break; |
| 728 | } | 728 | } |
| 729 | 729 | ||
| 730 | *skb_push(skb, 1) = 0; /* CTR, see spec:10.2.2.1 */ | 730 | *(u8 *)skb_push(skb, 1) = 0; /* CTR, see spec:10.2.2.1 */ |
| 731 | 731 | ||
| 732 | hdev->async_cb_type = HCI_CB_TYPE_TRANSCEIVE; | 732 | hdev->async_cb_type = HCI_CB_TYPE_TRANSCEIVE; |
| 733 | hdev->async_cb = cb; | 733 | hdev->async_cb = cb; |
diff --git a/net/nfc/hci/llc_shdlc.c b/net/nfc/hci/llc_shdlc.c index 9ab4a05f086f..5bd4529279f5 100644 --- a/net/nfc/hci/llc_shdlc.c +++ b/net/nfc/hci/llc_shdlc.c | |||
| @@ -160,7 +160,7 @@ static int llc_shdlc_send_s_frame(struct llc_shdlc *shdlc, | |||
| 160 | if (skb == NULL) | 160 | if (skb == NULL) |
| 161 | return -ENOMEM; | 161 | return -ENOMEM; |
| 162 | 162 | ||
| 163 | *skb_push(skb, 1) = SHDLC_CONTROL_HEAD_S | (sframe_type << 3) | nr; | 163 | *(u8 *)skb_push(skb, 1) = SHDLC_CONTROL_HEAD_S | (sframe_type << 3) | nr; |
| 164 | 164 | ||
| 165 | r = shdlc->xmit_to_drv(shdlc->hdev, skb); | 165 | r = shdlc->xmit_to_drv(shdlc->hdev, skb); |
| 166 | 166 | ||
| @@ -178,7 +178,7 @@ static int llc_shdlc_send_u_frame(struct llc_shdlc *shdlc, | |||
| 178 | 178 | ||
| 179 | pr_debug("uframe_modifier=%d\n", uframe_modifier); | 179 | pr_debug("uframe_modifier=%d\n", uframe_modifier); |
| 180 | 180 | ||
| 181 | *skb_push(skb, 1) = SHDLC_CONTROL_HEAD_U | uframe_modifier; | 181 | *(u8 *)skb_push(skb, 1) = SHDLC_CONTROL_HEAD_U | uframe_modifier; |
| 182 | 182 | ||
| 183 | r = shdlc->xmit_to_drv(shdlc->hdev, skb); | 183 | r = shdlc->xmit_to_drv(shdlc->hdev, skb); |
| 184 | 184 | ||
| @@ -551,8 +551,8 @@ static void llc_shdlc_handle_send_queue(struct llc_shdlc *shdlc) | |||
| 551 | 551 | ||
| 552 | skb = skb_dequeue(&shdlc->send_q); | 552 | skb = skb_dequeue(&shdlc->send_q); |
| 553 | 553 | ||
| 554 | *skb_push(skb, 1) = SHDLC_CONTROL_HEAD_I | (shdlc->ns << 3) | | 554 | *(u8 *)skb_push(skb, 1) = SHDLC_CONTROL_HEAD_I | (shdlc->ns << 3) | |
| 555 | shdlc->nr; | 555 | shdlc->nr; |
| 556 | 556 | ||
| 557 | pr_debug("Sending I-Frame %d, waiting to rcv %d\n", shdlc->ns, | 557 | pr_debug("Sending I-Frame %d, waiting to rcv %d\n", shdlc->ns, |
| 558 | shdlc->nr); | 558 | shdlc->nr); |
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c index 2488d9241f1d..908f25e3773e 100644 --- a/net/nfc/nci/data.c +++ b/net/nfc/nci/data.c | |||
| @@ -81,7 +81,7 @@ static inline void nci_push_data_hdr(struct nci_dev *ndev, | |||
| 81 | struct nci_data_hdr *hdr; | 81 | struct nci_data_hdr *hdr; |
| 82 | int plen = skb->len; | 82 | int plen = skb->len; |
| 83 | 83 | ||
| 84 | hdr = (struct nci_data_hdr *) skb_push(skb, NCI_DATA_HDR_SIZE); | 84 | hdr = skb_push(skb, NCI_DATA_HDR_SIZE); |
| 85 | hdr->conn_id = conn_id; | 85 | hdr->conn_id = conn_id; |
| 86 | hdr->rfu = 0; | 86 | hdr->rfu = 0; |
| 87 | hdr->plen = plen; | 87 | hdr->plen = plen; |
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index d1119bb35f24..3f93df58d9f1 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c | |||
| @@ -170,7 +170,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe, | |||
| 170 | return -ENOMEM; | 170 | return -ENOMEM; |
| 171 | 171 | ||
| 172 | skb_reserve(skb, NCI_DATA_HDR_SIZE + 2); | 172 | skb_reserve(skb, NCI_DATA_HDR_SIZE + 2); |
| 173 | *skb_push(skb, 1) = data_type; | 173 | *(u8 *)skb_push(skb, 1) = data_type; |
| 174 | 174 | ||
| 175 | do { | 175 | do { |
| 176 | len = conn_info->max_pkt_payload_len; | 176 | len = conn_info->max_pkt_payload_len; |
| @@ -184,7 +184,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe, | |||
| 184 | len = conn_info->max_pkt_payload_len - skb->len - 1; | 184 | len = conn_info->max_pkt_payload_len - skb->len - 1; |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | *skb_push(skb, 1) = cb; | 187 | *(u8 *)skb_push(skb, 1) = cb; |
| 188 | 188 | ||
| 189 | if (len > 0) | 189 | if (len > 0) |
| 190 | skb_put_data(skb, data + i, len); | 190 | skb_put_data(skb, data + i, len); |
diff --git a/net/nfc/nci/spi.c b/net/nfc/nci/spi.c index a502a334918a..3b4512731a2f 100644 --- a/net/nfc/nci/spi.c +++ b/net/nfc/nci/spi.c | |||
| @@ -238,8 +238,8 @@ static struct sk_buff *__nci_spi_read(struct nci_spi *nspi) | |||
| 238 | goto receive_error; | 238 | goto receive_error; |
| 239 | 239 | ||
| 240 | if (nspi->acknowledge_mode == NCI_SPI_CRC_ENABLED) { | 240 | if (nspi->acknowledge_mode == NCI_SPI_CRC_ENABLED) { |
| 241 | *skb_push(skb, 1) = resp_hdr[1]; | 241 | *(u8 *)skb_push(skb, 1) = resp_hdr[1]; |
| 242 | *skb_push(skb, 1) = resp_hdr[0]; | 242 | *(u8 *)skb_push(skb, 1) = resp_hdr[0]; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | return skb; | 245 | return skb; |
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index e386e6c90b17..e2188deb08dc 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
| @@ -142,7 +142,7 @@ error: | |||
| 142 | 142 | ||
| 143 | static int rawsock_add_header(struct sk_buff *skb) | 143 | static int rawsock_add_header(struct sk_buff *skb) |
| 144 | { | 144 | { |
| 145 | *skb_push(skb, NFC_HEADER_SIZE) = 0; | 145 | *(u8 *)skb_push(skb, NFC_HEADER_SIZE) = 0; |
| 146 | 146 | ||
| 147 | return 0; | 147 | return 0; |
| 148 | } | 148 | } |
diff --git a/net/sctp/output.c b/net/sctp/output.c index febcc350cf00..89cee1482d35 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
| @@ -585,7 +585,7 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) | |||
| 585 | sctp_packet_set_owner_w(head, sk); | 585 | sctp_packet_set_owner_w(head, sk); |
| 586 | 586 | ||
| 587 | /* set sctp header */ | 587 | /* set sctp header */ |
| 588 | sh = (struct sctphdr *)skb_push(head, sizeof(struct sctphdr)); | 588 | sh = skb_push(head, sizeof(struct sctphdr)); |
| 589 | skb_reset_transport_header(head); | 589 | skb_reset_transport_header(head); |
| 590 | sh->source = htons(packet->source_port); | 590 | sh->source = htons(packet->source_port); |
| 591 | sh->dest = htons(packet->destination_port); | 591 | sh->dest = htons(packet->destination_port); |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index df73190da761..8feff96a5bef 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
| @@ -770,8 +770,8 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net, | |||
| 770 | auth.skb = chunk->auth_chunk; | 770 | auth.skb = chunk->auth_chunk; |
| 771 | auth.asoc = chunk->asoc; | 771 | auth.asoc = chunk->asoc; |
| 772 | auth.sctp_hdr = chunk->sctp_hdr; | 772 | auth.sctp_hdr = chunk->sctp_hdr; |
| 773 | auth.chunk_hdr = (sctp_chunkhdr_t *)skb_push(chunk->auth_chunk, | 773 | auth.chunk_hdr = skb_push(chunk->auth_chunk, |
| 774 | sizeof(sctp_chunkhdr_t)); | 774 | sizeof(sctp_chunkhdr_t)); |
| 775 | skb_pull(chunk->auth_chunk, sizeof(sctp_chunkhdr_t)); | 775 | skb_pull(chunk->auth_chunk, sizeof(sctp_chunkhdr_t)); |
| 776 | auth.transport = chunk->transport; | 776 | auth.transport = chunk->transport; |
| 777 | 777 | ||
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index e361f0b57fb6..17854fb0e512 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
| @@ -153,8 +153,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( | |||
| 153 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); | 153 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); |
| 154 | 154 | ||
| 155 | /* Include the notification structure */ | 155 | /* Include the notification structure */ |
| 156 | sac = (struct sctp_assoc_change *) | 156 | sac = skb_push(skb, sizeof(struct sctp_assoc_change)); |
| 157 | skb_push(skb, sizeof(struct sctp_assoc_change)); | ||
| 158 | 157 | ||
| 159 | /* Trim the buffer to the right length. */ | 158 | /* Trim the buffer to the right length. */ |
| 160 | skb_trim(skb, sizeof(struct sctp_assoc_change) + | 159 | skb_trim(skb, sizeof(struct sctp_assoc_change) + |
| @@ -400,7 +399,7 @@ sctp_ulpevent_make_remote_error(const struct sctp_association *asoc, | |||
| 400 | event = sctp_skb2event(skb); | 399 | event = sctp_skb2event(skb); |
| 401 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); | 400 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); |
| 402 | 401 | ||
| 403 | sre = (struct sctp_remote_error *) skb_push(skb, sizeof(*sre)); | 402 | sre = skb_push(skb, sizeof(*sre)); |
| 404 | 403 | ||
| 405 | /* Trim the buffer to the right length. */ | 404 | /* Trim the buffer to the right length. */ |
| 406 | skb_trim(skb, sizeof(*sre) + elen); | 405 | skb_trim(skb, sizeof(*sre) + elen); |
| @@ -451,8 +450,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed( | |||
| 451 | event = sctp_skb2event(skb); | 450 | event = sctp_skb2event(skb); |
| 452 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); | 451 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); |
| 453 | 452 | ||
| 454 | ssf = (struct sctp_send_failed *) | 453 | ssf = skb_push(skb, sizeof(struct sctp_send_failed)); |
| 455 | skb_push(skb, sizeof(struct sctp_send_failed)); | ||
| 456 | 454 | ||
| 457 | /* Socket Extensions for SCTP | 455 | /* Socket Extensions for SCTP |
| 458 | * 5.3.1.4 SCTP_SEND_FAILED | 456 | * 5.3.1.4 SCTP_SEND_FAILED |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 96613fe2c6b1..bcb1284c3415 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
| @@ -522,7 +522,7 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, | |||
| 522 | pskb_pull(skb, hdrlen); | 522 | pskb_pull(skb, hdrlen); |
| 523 | 523 | ||
| 524 | if (!ehdr) | 524 | if (!ehdr) |
| 525 | ehdr = (struct ethhdr *) skb_push(skb, sizeof(struct ethhdr)); | 525 | ehdr = skb_push(skb, sizeof(struct ethhdr)); |
| 526 | memcpy(ehdr, &tmp, sizeof(tmp)); | 526 | memcpy(ehdr, &tmp, sizeof(tmp)); |
| 527 | 527 | ||
| 528 | return 0; | 528 | return 0; |
