summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-06-16 08:29:21 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-16 11:48:39 -0400
commit4df864c1d9afb46e2461a9f808d9f11a42d31bad (patch)
tree07e7b3d16b161e0d199c5b8116df277798566e4f
parent59ae1d127ac0ae404baf414c434ba2651b793f46 (diff)
networking: make skb_put & friends 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 (skb_put, __skb_put and pskb_put) 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_put, __skb_put }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_put, __skb_put }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) which actually doesn't cover pskb_put since there are only three users overall. A handful of stragglers were converted manually, notably a macro in drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many instances in net/bluetooth/hci_sock.c. In the former file, I also had to fix one whitespace problem spatch introduced. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/atm/atmtcp.c4
-rw-r--r--drivers/atm/solos-pci.c12
-rw-r--r--drivers/bluetooth/bluecard_cs.c2
-rw-r--r--drivers/bluetooth/bt3c_cs.c2
-rw-r--r--drivers/bluetooth/btmrvl_main.c2
-rw-r--r--drivers/bluetooth/btuart_cs.c2
-rw-r--r--drivers/bluetooth/btusb.c10
-rw-r--r--drivers/bluetooth/dtl1_cs.c4
-rw-r--r--drivers/bluetooth/hci_bcm.c6
-rw-r--r--drivers/bluetooth/hci_intel.c6
-rw-r--r--drivers/bluetooth/hci_ll.c2
-rw-r--r--drivers/bluetooth/hci_nokia.c10
-rw-r--r--drivers/bluetooth/hci_qca.c2
-rw-r--r--drivers/bluetooth/hci_vhci.c4
-rw-r--r--drivers/crypto/chelsio/chcr_algo.c10
-rw-r--r--drivers/infiniband/core/addr.c3
-rw-r--r--drivers/infiniband/core/sa_query.c3
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c2
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c22
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c22
-rw-r--r--drivers/infiniband/hw/cxgb4/cq.c4
-rw-r--r--drivers/infiniband/hw/cxgb4/mem.c4
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c8
-rw-r--r--drivers/isdn/capi/capi.c4
-rw-r--r--drivers/isdn/gigaset/asyncdata.c26
-rw-r--r--drivers/isdn/gigaset/isocdata.c2
-rw-r--r--drivers/isdn/i4l/isdn_audio.c4
-rw-r--r--drivers/isdn/i4l/isdn_bsdcomp.c8
-rw-r--r--drivers/isdn/i4l/isdn_x25iface.c4
-rw-r--r--drivers/media/dvb-core/dvb_net.c2
-rw-r--r--drivers/media/radio/wl128x/fmdrv_common.c2
-rw-r--r--drivers/net/bonding/bond_3ad.c4
-rw-r--r--drivers/net/can/dev.c4
-rw-r--r--drivers/net/ethernet/allwinner/sun4i-emac.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c12
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c4
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/l2t.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c4
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c8
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/l2t.c2
-rw-r--r--drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h10
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c2
-rw-r--r--drivers/net/ethernet/dnet.c2
-rw-r--r--drivers/net/ethernet/hp/hp100.c2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_fcoe.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_selftest.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c6
-rw-r--r--drivers/net/ethernet/micrel/ks8842.c4
-rw-r--r--drivers/net/ethernet/sfc/falcon/selftest.c3
-rw-r--r--drivers/net/ethernet/sfc/selftest.c3
-rw-r--r--drivers/net/hamradio/scc.c4
-rw-r--r--drivers/net/ppp/pppoe.c2
-rw-r--r--drivers/net/usb/cdc_ncm.c2
-rw-r--r--drivers/net/usb/net1080.c4
-rw-r--r--drivers/net/usb/zaurus.c8
-rw-r--r--drivers/net/wan/hdlc_ppp.c2
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.c2
-rw-r--r--drivers/net/wireless/ath/ath6kl/htc_pipe.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c9
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c2
-rw-r--r--drivers/net/wireless/cisco/airo.c4
-rw-r--r--drivers/net/wireless/intel/ipw2x00/ipw2200.c2
-rw-r--r--drivers/net/wireless/intel/ipw2x00/libipw_tx.c3
-rw-r--r--drivers/net/wireless/intersil/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/intersil/p54/fwio.c43
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c8
-rw-r--r--drivers/net/wireless/marvell/mwifiex/11n_aggr.c2
-rw-r--r--drivers/net/wireless/marvell/mwifiex/tdls.c38
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/qlink_util.h11
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c2
-rw-r--r--drivers/nfc/fdp/i2c.c2
-rw-r--r--drivers/nfc/microread/i2c.c4
-rw-r--r--drivers/nfc/microread/microread.c4
-rw-r--r--drivers/nfc/nfcmrvl/fw_dnld.c6
-rw-r--r--drivers/nfc/pn533/pn533.c32
-rw-r--r--drivers/nfc/pn544/i2c.c6
-rw-r--r--drivers/nfc/port100.c4
-rw-r--r--drivers/nfc/st21nfca/i2c.c6
-rw-r--r--drivers/nfc/st95hf/core.c2
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c2
-rw-r--r--drivers/scsi/fcoe/fcoe.c2
-rw-r--r--drivers/scsi/qedf/qedf_main.c2
-rw-r--r--drivers/staging/rtl8192e/rtl819x_BAProc.c10
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac.c34
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c21
-rw-r--r--drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c8
-rw-r--r--drivers/target/iscsi/cxgbit/cxgbit_cm.c8
-rw-r--r--drivers/target/iscsi/cxgbit/cxgbit_ddp.c2
-rw-r--r--drivers/usb/gadget/function/f_ncm.c5
-rw-r--r--include/linux/skbuff.h8
-rw-r--r--lib/nlattr.c2
-rw-r--r--net/802/garp.c6
-rw-r--r--net/802/mrp.c11
-rw-r--r--net/appletalk/ddp.c2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/batman-adv/icmp_socket.c2
-rw-r--r--net/batman-adv/tp_meter.c6
-rw-r--r--net/bluetooth/hci_request.c2
-rw-r--r--net/bluetooth/hci_sock.c12
-rw-r--r--net/bluetooth/hidp/core.c2
-rw-r--r--net/bluetooth/l2cap_core.c14
-rw-r--r--net/bluetooth/mgmt_util.c10
-rw-r--r--net/bluetooth/rfcomm/core.c2
-rw-r--r--net/core/pktgen.c32
-rw-r--r--net/core/skbuff.c6
-rw-r--r--net/decnet/dn_dev.c2
-rw-r--r--net/decnet/dn_nsp_out.c18
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/igmp.c6
-rw-r--r--net/ipv4/ipmr.c2
-rw-r--r--net/ipv4/netfilter/ipt_SYNPROXY.c10
-rw-r--r--net/ipv4/netfilter/nf_reject_ipv4.c2
-rw-r--r--net/ipv6/mcast.c4
-rw-r--r--net/ipv6/ndisc.c8
-rw-r--r--net/ipv6/netfilter/ip6t_SYNPROXY.c10
-rw-r--r--net/ipv6/netfilter/nf_reject_ipv6.c2
-rw-r--r--net/irda/irlap_frame.c17
-rw-r--r--net/key/af_key.c116
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/ht.c2
-rw-r--r--net/mac80211/mesh.c2
-rw-r--r--net/mac80211/mesh_ps.c2
-rw-r--r--net/mac80211/sta_info.c2
-rw-r--r--net/mac80211/tdls.c10
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/mac80211/wpa.c6
-rw-r--r--net/netfilter/nfnetlink_log.c2
-rw-r--r--net/netfilter/nfnetlink_queue.c2
-rw-r--r--net/netlink/af_netlink.c2
-rw-r--r--net/nfc/digital_core.c4
-rw-r--r--net/nfc/digital_dep.c2
-rw-r--r--net/nfc/digital_technology.c18
-rw-r--r--net/nfc/hci/core.c2
-rw-r--r--net/nfc/hci/llc_shdlc.c4
-rw-r--r--net/nfc/nci/core.c2
-rw-r--r--net/nfc/nci/hci.c2
-rw-r--r--net/nfc/nci/spi.c8
-rw-r--r--net/nfc/nci/uart.c2
-rw-r--r--net/psample/psample.c2
-rw-r--r--net/qrtr/qrtr.c2
-rw-r--r--net/sctp/sm_make_chunk.c2
-rw-r--r--net/sctp/ulpevent.c29
-rw-r--r--net/vmw_vsock/virtio_transport_common.c2
145 files changed, 486 insertions, 547 deletions
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
index 3ef6253e1cce..56fa16c85ebf 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -60,7 +60,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type,
60 return -EUNATCH; 60 return -EUNATCH;
61 } 61 }
62 atm_force_charge(out_vcc,skb->truesize); 62 atm_force_charge(out_vcc,skb->truesize);
63 new_msg = (struct atmtcp_control *) skb_put(skb,sizeof(*new_msg)); 63 new_msg = skb_put(skb, sizeof(*new_msg));
64 *new_msg = *msg; 64 *new_msg = *msg;
65 new_msg->hdr.length = ATMTCP_HDR_MAGIC; 65 new_msg->hdr.length = ATMTCP_HDR_MAGIC;
66 new_msg->type = type; 66 new_msg->type = type;
@@ -217,7 +217,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
217 atomic_inc(&vcc->stats->tx_err); 217 atomic_inc(&vcc->stats->tx_err);
218 return -ENOBUFS; 218 return -ENOBUFS;
219 } 219 }
220 hdr = (void *) skb_put(new_skb,sizeof(struct atmtcp_hdr)); 220 hdr = skb_put(new_skb, sizeof(struct atmtcp_hdr));
221 hdr->vpi = htons(vcc->vpi); 221 hdr->vpi = htons(vcc->vpi);
222 hdr->vci = htons(vcc->vci); 222 hdr->vci = htons(vcc->vci);
223 hdr->length = htonl(skb->len); 223 hdr->length = htonl(skb->len);
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 077dd15c3a40..4fc99ae1c534 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -205,7 +205,7 @@ static ssize_t solos_param_show(struct device *dev, struct device_attribute *att
205 return -ENOMEM; 205 return -ENOMEM;
206 } 206 }
207 207
208 header = (void *)skb_put(skb, sizeof(*header)); 208 header = skb_put(skb, sizeof(*header));
209 209
210 buflen = snprintf((void *)&header[1], buflen - 1, 210 buflen = snprintf((void *)&header[1], buflen - 1,
211 "L%05d\n%s\n", current->pid, attr->attr.name); 211 "L%05d\n%s\n", current->pid, attr->attr.name);
@@ -261,7 +261,7 @@ static ssize_t solos_param_store(struct device *dev, struct device_attribute *at
261 return -ENOMEM; 261 return -ENOMEM;
262 } 262 }
263 263
264 header = (void *)skb_put(skb, sizeof(*header)); 264 header = skb_put(skb, sizeof(*header));
265 265
266 buflen = snprintf((void *)&header[1], buflen - 1, 266 buflen = snprintf((void *)&header[1], buflen - 1,
267 "L%05d\n%s\n%s\n", current->pid, attr->attr.name, buf); 267 "L%05d\n%s\n%s\n", current->pid, attr->attr.name, buf);
@@ -486,7 +486,7 @@ static int send_command(struct solos_card *card, int dev, const char *buf, size_
486 return 0; 486 return 0;
487 } 487 }
488 488
489 header = (void *)skb_put(skb, sizeof(*header)); 489 header = skb_put(skb, sizeof(*header));
490 490
491 header->size = cpu_to_le16(size); 491 header->size = cpu_to_le16(size);
492 header->vpi = cpu_to_le16(0); 492 header->vpi = cpu_to_le16(0);
@@ -945,7 +945,7 @@ static int popen(struct atm_vcc *vcc)
945 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n"); 945 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
946 return -ENOMEM; 946 return -ENOMEM;
947 } 947 }
948 header = (void *)skb_put(skb, sizeof(*header)); 948 header = skb_put(skb, sizeof(*header));
949 949
950 header->size = cpu_to_le16(0); 950 header->size = cpu_to_le16(0);
951 header->vpi = cpu_to_le16(vcc->vpi); 951 header->vpi = cpu_to_le16(vcc->vpi);
@@ -982,7 +982,7 @@ static void pclose(struct atm_vcc *vcc)
982 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n"); 982 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
983 return; 983 return;
984 } 984 }
985 header = (void *)skb_put(skb, sizeof(*header)); 985 header = skb_put(skb, sizeof(*header));
986 986
987 header->size = cpu_to_le16(0); 987 header->size = cpu_to_le16(0);
988 header->vpi = cpu_to_le16(vcc->vpi); 988 header->vpi = cpu_to_le16(vcc->vpi);
@@ -1398,7 +1398,7 @@ static int atm_init(struct solos_card *card, struct device *parent)
1398 continue; 1398 continue;
1399 } 1399 }
1400 1400
1401 header = (void *)skb_put(skb, sizeof(*header)); 1401 header = skb_put(skb, sizeof(*header));
1402 1402
1403 header->size = cpu_to_le16(0); 1403 header->size = cpu_to_le16(0);
1404 header->vpi = cpu_to_le16(0); 1404 header->vpi = cpu_to_le16(0);
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 1d30c116b2ee..39a05b0c8998 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -448,7 +448,7 @@ static void bluecard_receive(struct bluecard_info *info,
448 448
449 } else { 449 } else {
450 450
451 *skb_put(info->rx_skb, 1) = buf[i]; 451 *(u8 *)skb_put(info->rx_skb, 1) = buf[i];
452 info->rx_count--; 452 info->rx_count--;
453 453
454 if (info->rx_count == 0) { 454 if (info->rx_count == 0) {
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 8165ef2fe877..be2d431aa366 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -282,7 +282,7 @@ static void bt3c_receive(struct bt3c_info *info)
282 282
283 __u8 x = inb(iobase + DATA_L); 283 __u8 x = inb(iobase + DATA_L);
284 284
285 *skb_put(info->rx_skb, 1) = x; 285 *(u8 *)skb_put(info->rx_skb, 1) = x;
286 inb(iobase + DATA_H); 286 inb(iobase + DATA_H);
287 info->rx_count--; 287 info->rx_count--;
288 288
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 24a188eab360..8d3d9175d891 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -189,7 +189,7 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 opcode,
189 return -ENOMEM; 189 return -ENOMEM;
190 } 190 }
191 191
192 hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE); 192 hdr = skb_put(skb, HCI_COMMAND_HDR_SIZE);
193 hdr->opcode = cpu_to_le16(opcode); 193 hdr->opcode = cpu_to_le16(opcode);
194 hdr->plen = len; 194 hdr->plen = len;
195 195
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 9624b29f8349..80b64e9684a3 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -233,7 +233,7 @@ static void btuart_receive(struct btuart_info *info)
233 233
234 } else { 234 } else {
235 235
236 *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); 236 *(u8 *)skb_put(info->rx_skb, 1) = inb(iobase + UART_RX);
237 info->rx_count--; 237 info->rx_count--;
238 238
239 if (info->rx_count == 0) { 239 if (info->rx_count == 0) {
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c7ea398e65c1..ba207c787605 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1836,15 +1836,15 @@ static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode)
1836 if (!skb) 1836 if (!skb)
1837 return -ENOMEM; 1837 return -ENOMEM;
1838 1838
1839 hdr = (struct hci_event_hdr *)skb_put(skb, sizeof(*hdr)); 1839 hdr = skb_put(skb, sizeof(*hdr));
1840 hdr->evt = HCI_EV_CMD_COMPLETE; 1840 hdr->evt = HCI_EV_CMD_COMPLETE;
1841 hdr->plen = sizeof(*evt) + 1; 1841 hdr->plen = sizeof(*evt) + 1;
1842 1842
1843 evt = (struct hci_ev_cmd_complete *)skb_put(skb, sizeof(*evt)); 1843 evt = skb_put(skb, sizeof(*evt));
1844 evt->ncmd = 0x01; 1844 evt->ncmd = 0x01;
1845 evt->opcode = cpu_to_le16(opcode); 1845 evt->opcode = cpu_to_le16(opcode);
1846 1846
1847 *skb_put(skb, 1) = 0x00; 1847 *(u8 *)skb_put(skb, 1) = 0x00;
1848 1848
1849 hci_skb_pkt_type(skb) = HCI_EVENT_PKT; 1849 hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
1850 1850
@@ -2767,8 +2767,8 @@ static struct urb *alloc_diag_urb(struct hci_dev *hdev, bool enable)
2767 return ERR_PTR(-ENOMEM); 2767 return ERR_PTR(-ENOMEM);
2768 } 2768 }
2769 2769
2770 *skb_put(skb, 1) = 0xf0; 2770 *(u8 *)skb_put(skb, 1) = 0xf0;
2771 *skb_put(skb, 1) = enable; 2771 *(u8 *)skb_put(skb, 1) = enable;
2772 2772
2773 pipe = usb_sndbulkpipe(data->udev, data->diag_tx_ep->bEndpointAddress); 2773 pipe = usb_sndbulkpipe(data->udev, data->diag_tx_ep->bEndpointAddress);
2774 2774
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 6317c6f323bf..6c5a3aa566a4 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -226,7 +226,7 @@ static void dtl1_receive(struct dtl1_info *info)
226 } 226 }
227 } 227 }
228 228
229 *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); 229 *(u8 *)skb_put(info->rx_skb, 1) = inb(iobase + UART_RX);
230 nsh = (struct nsh *)info->rx_skb->data; 230 nsh = (struct nsh *)info->rx_skb->data;
231 231
232 info->rx_count--; 232 info->rx_count--;
@@ -414,7 +414,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
414 skb_reserve(s, NSHL); 414 skb_reserve(s, NSHL);
415 skb_copy_from_linear_data(skb, skb_put(s, skb->len), skb->len); 415 skb_copy_from_linear_data(skb, skb_put(s, skb->len), skb->len);
416 if (skb->len & 0x0001) 416 if (skb->len & 0x0001)
417 *skb_put(s, 1) = 0; /* PAD */ 417 *(u8 *)skb_put(s, 1) = 0; /* PAD */
418 418
419 /* Prepend skb with Nokia frame header and queue */ 419 /* Prepend skb with Nokia frame header and queue */
420 memcpy(skb_push(s, NSHL), &nsh, NSHL); 420 memcpy(skb_push(s, NSHL), &nsh, NSHL);
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index e2096c7803b3..c1c4048ee37d 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -262,9 +262,9 @@ static int bcm_set_diag(struct hci_dev *hdev, bool enable)
262 if (!skb) 262 if (!skb)
263 return -ENOMEM; 263 return -ENOMEM;
264 264
265 *skb_put(skb, 1) = BCM_LM_DIAG_PKT; 265 *(u8 *)skb_put(skb, 1) = BCM_LM_DIAG_PKT;
266 *skb_put(skb, 1) = 0xf0; 266 *(u8 *)skb_put(skb, 1) = 0xf0;
267 *skb_put(skb, 1) = enable; 267 *(u8 *)skb_put(skb, 1) = enable;
268 268
269 skb_queue_tail(&bcm->txq, skb); 269 skb_queue_tail(&bcm->txq, skb);
270 hci_uart_tx_wakeup(hu); 270 hci_uart_tx_wakeup(hu);
diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c
index 16e728577cd8..ee97c465e32e 100644
--- a/drivers/bluetooth/hci_intel.c
+++ b/drivers/bluetooth/hci_intel.c
@@ -462,15 +462,15 @@ static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode)
462 if (!skb) 462 if (!skb)
463 return -ENOMEM; 463 return -ENOMEM;
464 464
465 hdr = (struct hci_event_hdr *)skb_put(skb, sizeof(*hdr)); 465 hdr = skb_put(skb, sizeof(*hdr));
466 hdr->evt = HCI_EV_CMD_COMPLETE; 466 hdr->evt = HCI_EV_CMD_COMPLETE;
467 hdr->plen = sizeof(*evt) + 1; 467 hdr->plen = sizeof(*evt) + 1;
468 468
469 evt = (struct hci_ev_cmd_complete *)skb_put(skb, sizeof(*evt)); 469 evt = skb_put(skb, sizeof(*evt));
470 evt->ncmd = 0x01; 470 evt->ncmd = 0x01;
471 evt->opcode = cpu_to_le16(opcode); 471 evt->opcode = cpu_to_le16(opcode);
472 472
473 *skb_put(skb, 1) = 0x00; 473 *(u8 *)skb_put(skb, 1) = 0x00;
474 474
475 hci_skb_pkt_type(skb) = HCI_EVENT_PKT; 475 hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
476 476
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index cc2fa78b434e..c982943f0747 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -120,7 +120,7 @@ static int send_hcill_cmd(u8 cmd, struct hci_uart *hu)
120 } 120 }
121 121
122 /* prepare packet */ 122 /* prepare packet */
123 hcill_packet = (struct hcill_cmd *) skb_put(skb, 1); 123 hcill_packet = skb_put(skb, 1);
124 hcill_packet->cmd = cmd; 124 hcill_packet->cmd = cmd;
125 125
126 /* send packet */ 126 /* send packet */
diff --git a/drivers/bluetooth/hci_nokia.c b/drivers/bluetooth/hci_nokia.c
index a7d687d8d456..c1b081725b2c 100644
--- a/drivers/bluetooth/hci_nokia.c
+++ b/drivers/bluetooth/hci_nokia.c
@@ -246,9 +246,9 @@ static int nokia_send_alive_packet(struct hci_uart *hu)
246 hci_skb_pkt_type(skb) = HCI_NOKIA_ALIVE_PKT; 246 hci_skb_pkt_type(skb) = HCI_NOKIA_ALIVE_PKT;
247 memset(skb->data, 0x00, len); 247 memset(skb->data, 0x00, len);
248 248
249 hdr = (struct hci_nokia_alive_hdr *)skb_put(skb, sizeof(*hdr)); 249 hdr = skb_put(skb, sizeof(*hdr));
250 hdr->dlen = sizeof(*pkt); 250 hdr->dlen = sizeof(*pkt);
251 pkt = (struct hci_nokia_alive_pkt *)skb_put(skb, sizeof(*pkt)); 251 pkt = skb_put(skb, sizeof(*pkt));
252 pkt->mid = NOKIA_ALIVE_REQ; 252 pkt->mid = NOKIA_ALIVE_REQ;
253 253
254 nokia_enqueue(hu, skb); 254 nokia_enqueue(hu, skb);
@@ -285,10 +285,10 @@ static int nokia_send_negotiation(struct hci_uart *hu)
285 285
286 hci_skb_pkt_type(skb) = HCI_NOKIA_NEG_PKT; 286 hci_skb_pkt_type(skb) = HCI_NOKIA_NEG_PKT;
287 287
288 neg_hdr = (struct hci_nokia_neg_hdr *)skb_put(skb, sizeof(*neg_hdr)); 288 neg_hdr = skb_put(skb, sizeof(*neg_hdr));
289 neg_hdr->dlen = sizeof(*neg_cmd); 289 neg_hdr->dlen = sizeof(*neg_cmd);
290 290
291 neg_cmd = (struct hci_nokia_neg_cmd *)skb_put(skb, sizeof(*neg_cmd)); 291 neg_cmd = skb_put(skb, sizeof(*neg_cmd));
292 neg_cmd->ack = NOKIA_NEG_REQ; 292 neg_cmd->ack = NOKIA_NEG_REQ;
293 neg_cmd->baud = cpu_to_le16(baud); 293 neg_cmd->baud = cpu_to_le16(baud);
294 neg_cmd->unused1 = 0x0000; 294 neg_cmd->unused1 = 0x0000;
@@ -532,7 +532,7 @@ static int nokia_enqueue(struct hci_uart *hu, struct sk_buff *skb)
532 err = skb_pad(skb, 1); 532 err = skb_pad(skb, 1);
533 if (err) 533 if (err)
534 return err; 534 return err;
535 *skb_put(skb, 1) = 0x00; 535 *(u8 *)skb_put(skb, 1) = 0x00;
536 } 536 }
537 537
538 skb_queue_tail(&btdev->txq, skb); 538 skb_queue_tail(&btdev->txq, skb);
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index b55f01320631..e2c88515340a 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -215,7 +215,7 @@ static int send_hci_ibs_cmd(u8 cmd, struct hci_uart *hu)
215 } 215 }
216 216
217 /* Assign HCI_IBS type */ 217 /* Assign HCI_IBS type */
218 *skb_put(skb, 1) = cmd; 218 *(u8 *)skb_put(skb, 1) = cmd;
219 219
220 skb_queue_tail(&qca->txq, skb); 220 skb_queue_tail(&qca->txq, skb);
221 221
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 233e850fdac7..1ef9c427a2d8 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -146,8 +146,8 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
146 146
147 hci_skb_pkt_type(skb) = HCI_VENDOR_PKT; 147 hci_skb_pkt_type(skb) = HCI_VENDOR_PKT;
148 148
149 *skb_put(skb, 1) = 0xff; 149 *(u8 *)skb_put(skb, 1) = 0xff;
150 *skb_put(skb, 1) = opcode; 150 *(u8 *)skb_put(skb, 1) = opcode;
151 put_unaligned_le16(hdev->id, skb_put(skb, 2)); 151 put_unaligned_le16(hdev->id, skb_put(skb, 2));
152 skb_queue_tail(&data->readq, skb); 152 skb_queue_tail(&data->readq, skb);
153 153
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index f00e0d8bd039..92185ab6797d 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -604,7 +604,7 @@ static struct sk_buff
604 if (!skb) 604 if (!skb)
605 return ERR_PTR(-ENOMEM); 605 return ERR_PTR(-ENOMEM);
606 skb_reserve(skb, sizeof(struct sge_opaque_hdr)); 606 skb_reserve(skb, sizeof(struct sge_opaque_hdr));
607 chcr_req = (struct chcr_wr *)__skb_put(skb, transhdr_len); 607 chcr_req = __skb_put(skb, transhdr_len);
608 memset(chcr_req, 0, transhdr_len); 608 memset(chcr_req, 0, transhdr_len);
609 chcr_req->sec_cpl.op_ivinsrtofst = 609 chcr_req->sec_cpl.op_ivinsrtofst =
610 FILL_SEC_CPL_OP_IVINSR(ctx->dev->rx_channel_id, 2, 1); 610 FILL_SEC_CPL_OP_IVINSR(ctx->dev->rx_channel_id, 2, 1);
@@ -881,7 +881,7 @@ static struct sk_buff *create_hash_wr(struct ahash_request *req,
881 return skb; 881 return skb;
882 882
883 skb_reserve(skb, sizeof(struct sge_opaque_hdr)); 883 skb_reserve(skb, sizeof(struct sge_opaque_hdr));
884 chcr_req = (struct chcr_wr *)__skb_put(skb, transhdr_len); 884 chcr_req = __skb_put(skb, transhdr_len);
885 memset(chcr_req, 0, transhdr_len); 885 memset(chcr_req, 0, transhdr_len);
886 886
887 chcr_req->sec_cpl.op_ivinsrtofst = 887 chcr_req->sec_cpl.op_ivinsrtofst =
@@ -1447,7 +1447,7 @@ static struct sk_buff *create_authenc_wr(struct aead_request *req,
1447 skb_reserve(skb, sizeof(struct sge_opaque_hdr)); 1447 skb_reserve(skb, sizeof(struct sge_opaque_hdr));
1448 1448
1449 /* Write WR */ 1449 /* Write WR */
1450 chcr_req = (struct chcr_wr *) __skb_put(skb, transhdr_len); 1450 chcr_req = __skb_put(skb, transhdr_len);
1451 memset(chcr_req, 0, transhdr_len); 1451 memset(chcr_req, 0, transhdr_len);
1452 1452
1453 stop_offset = (op_type == CHCR_ENCRYPT_OP) ? 0 : authsize; 1453 stop_offset = (op_type == CHCR_ENCRYPT_OP) ? 0 : authsize;
@@ -1779,7 +1779,7 @@ static struct sk_buff *create_aead_ccm_wr(struct aead_request *req,
1779 1779
1780 skb_reserve(skb, sizeof(struct sge_opaque_hdr)); 1780 skb_reserve(skb, sizeof(struct sge_opaque_hdr));
1781 1781
1782 chcr_req = (struct chcr_wr *) __skb_put(skb, transhdr_len); 1782 chcr_req = __skb_put(skb, transhdr_len);
1783 memset(chcr_req, 0, transhdr_len); 1783 memset(chcr_req, 0, transhdr_len);
1784 1784
1785 fill_sec_cpl_for_aead(&chcr_req->sec_cpl, dst_size, req, op_type, ctx); 1785 fill_sec_cpl_for_aead(&chcr_req->sec_cpl, dst_size, req, op_type, ctx);
@@ -1892,7 +1892,7 @@ static struct sk_buff *create_gcm_wr(struct aead_request *req,
1892 /* NIC driver is going to write the sge hdr. */ 1892 /* NIC driver is going to write the sge hdr. */
1893 skb_reserve(skb, sizeof(struct sge_opaque_hdr)); 1893 skb_reserve(skb, sizeof(struct sge_opaque_hdr));
1894 1894
1895 chcr_req = (struct chcr_wr *)__skb_put(skb, transhdr_len); 1895 chcr_req = __skb_put(skb, transhdr_len);
1896 memset(chcr_req, 0, transhdr_len); 1896 memset(chcr_req, 0, transhdr_len);
1897 1897
1898 if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106) 1898 if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106)
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 02971e239a18..d2957b38575f 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -179,8 +179,7 @@ static int ib_nl_ip_send_msg(struct rdma_dev_addr *dev_addr,
179 } 179 }
180 180
181 /* Construct the family header first */ 181 /* Construct the family header first */
182 header = (struct rdma_ls_ip_resolve_header *) 182 header = skb_put(skb, NLMSG_ALIGN(sizeof(*header)));
183 skb_put(skb, NLMSG_ALIGN(sizeof(*header)));
184 header->ifindex = dev_addr->bound_dev_if; 183 header->ifindex = dev_addr->bound_dev_if;
185 nla_put(skb, attrtype, size, daddr); 184 nla_put(skb, attrtype, size, daddr);
186 185
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index fb7aec4047c8..70fa4cabe48e 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -759,8 +759,7 @@ static void ib_nl_set_path_rec_attrs(struct sk_buff *skb,
759 query->mad_buf->context[1] = NULL; 759 query->mad_buf->context[1] = NULL;
760 760
761 /* Construct the family header first */ 761 /* Construct the family header first */
762 header = (struct rdma_ls_resolve_header *) 762 header = skb_put(skb, NLMSG_ALIGN(sizeof(*header)));
763 skb_put(skb, NLMSG_ALIGN(sizeof(*header)));
764 memcpy(header->device_name, query->port->agent->device->name, 763 memcpy(header->device_name, query->port->agent->device->name,
765 LS_DEVICE_NAME_MAX); 764 LS_DEVICE_NAME_MAX);
766 header->port_num = query->port->port_num; 765 header->port_num = query->port->port_num;
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 97f7f9544e70..3eff6541bd6f 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -835,7 +835,7 @@ int cxio_rdma_init(struct cxio_rdev *rdev_p, struct t3_rdma_init_attr *attr)
835 if (!skb) 835 if (!skb)
836 return -ENOMEM; 836 return -ENOMEM;
837 pr_debug("%s rdev_p %p\n", __func__, rdev_p); 837 pr_debug("%s rdev_p %p\n", __func__, rdev_p);
838 wqe = (struct t3_rdma_init_wr *) __skb_put(skb, sizeof(*wqe)); 838 wqe = __skb_put(skb, sizeof(*wqe));
839 wqe->wrh.op_seop_flags = cpu_to_be32(V_FW_RIWR_OP(T3_WR_INIT)); 839 wqe->wrh.op_seop_flags = cpu_to_be32(V_FW_RIWR_OP(T3_WR_INIT));
840 wqe->wrh.gen_tid_len = cpu_to_be32(V_FW_RIWR_TID(attr->tid) | 840 wqe->wrh.gen_tid_len = cpu_to_be32(V_FW_RIWR_TID(attr->tid) |
841 V_FW_RIWR_LEN(sizeof(*wqe) >> 3)); 841 V_FW_RIWR_LEN(sizeof(*wqe) >> 3));
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index f4c23a74f18c..9ae518c01bc2 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -175,7 +175,7 @@ static void release_tid(struct t3cdev *tdev, u32 hwtid, struct sk_buff *skb)
175 skb = get_skb(skb, sizeof *req, GFP_KERNEL); 175 skb = get_skb(skb, sizeof *req, GFP_KERNEL);
176 if (!skb) 176 if (!skb)
177 return; 177 return;
178 req = (struct cpl_tid_release *) skb_put(skb, sizeof(*req)); 178 req = skb_put(skb, sizeof(*req));
179 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 179 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
180 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid)); 180 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid));
181 skb->priority = CPL_PRIORITY_SETUP; 181 skb->priority = CPL_PRIORITY_SETUP;
@@ -190,7 +190,7 @@ int iwch_quiesce_tid(struct iwch_ep *ep)
190 190
191 if (!skb) 191 if (!skb)
192 return -ENOMEM; 192 return -ENOMEM;
193 req = (struct cpl_set_tcb_field *) skb_put(skb, sizeof(*req)); 193 req = skb_put(skb, sizeof(*req));
194 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 194 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
195 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); 195 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid));
196 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, ep->hwtid)); 196 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, ep->hwtid));
@@ -211,7 +211,7 @@ int iwch_resume_tid(struct iwch_ep *ep)
211 211
212 if (!skb) 212 if (!skb)
213 return -ENOMEM; 213 return -ENOMEM;
214 req = (struct cpl_set_tcb_field *) skb_put(skb, sizeof(*req)); 214 req = skb_put(skb, sizeof(*req));
215 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 215 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
216 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); 216 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid));
217 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, ep->hwtid)); 217 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, ep->hwtid));
@@ -398,7 +398,7 @@ static int send_halfclose(struct iwch_ep *ep, gfp_t gfp)
398 } 398 }
399 skb->priority = CPL_PRIORITY_DATA; 399 skb->priority = CPL_PRIORITY_DATA;
400 set_arp_failure_handler(skb, arp_failure_discard); 400 set_arp_failure_handler(skb, arp_failure_discard);
401 req = (struct cpl_close_con_req *) skb_put(skb, sizeof(*req)); 401 req = skb_put(skb, sizeof(*req));
402 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_CLOSE_CON)); 402 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_CLOSE_CON));
403 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); 403 req->wr.wr_lo = htonl(V_WR_TID(ep->hwtid));
404 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, ep->hwtid)); 404 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, ep->hwtid));
@@ -455,7 +455,7 @@ static int send_connect(struct iwch_ep *ep)
455 skb->priority = CPL_PRIORITY_SETUP; 455 skb->priority = CPL_PRIORITY_SETUP;
456 set_arp_failure_handler(skb, act_open_req_arp_failure); 456 set_arp_failure_handler(skb, act_open_req_arp_failure);
457 457
458 req = (struct cpl_act_open_req *) skb_put(skb, sizeof(*req)); 458 req = skb_put(skb, sizeof(*req));
459 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 459 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
460 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, ep->atid)); 460 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, ep->atid));
461 req->local_port = ep->com.local_addr.sin_port; 461 req->local_port = ep->com.local_addr.sin_port;
@@ -546,7 +546,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen)
546 return -ENOMEM; 546 return -ENOMEM;
547 } 547 }
548 skb_reserve(skb, sizeof(*req)); 548 skb_reserve(skb, sizeof(*req));
549 mpa = (struct mpa_message *) skb_put(skb, mpalen); 549 mpa = skb_put(skb, mpalen);
550 memset(mpa, 0, sizeof(*mpa)); 550 memset(mpa, 0, sizeof(*mpa));
551 memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key)); 551 memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key));
552 mpa->flags = MPA_REJECT; 552 mpa->flags = MPA_REJECT;
@@ -596,7 +596,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen)
596 } 596 }
597 skb->priority = CPL_PRIORITY_DATA; 597 skb->priority = CPL_PRIORITY_DATA;
598 skb_reserve(skb, sizeof(*req)); 598 skb_reserve(skb, sizeof(*req));
599 mpa = (struct mpa_message *) skb_put(skb, mpalen); 599 mpa = skb_put(skb, mpalen);
600 memset(mpa, 0, sizeof(*mpa)); 600 memset(mpa, 0, sizeof(*mpa));
601 memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key)); 601 memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key));
602 mpa->flags = (ep->mpa_attr.crc_enabled ? MPA_CRC : 0) | 602 mpa->flags = (ep->mpa_attr.crc_enabled ? MPA_CRC : 0) |
@@ -800,7 +800,7 @@ static int update_rx_credits(struct iwch_ep *ep, u32 credits)
800 return 0; 800 return 0;
801 } 801 }
802 802
803 req = (struct cpl_rx_data_ack *) skb_put(skb, sizeof(*req)); 803 req = skb_put(skb, sizeof(*req));
804 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 804 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
805 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid)); 805 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid));
806 req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1)); 806 req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1));
@@ -1205,7 +1205,7 @@ static int listen_start(struct iwch_listen_ep *ep)
1205 return -ENOMEM; 1205 return -ENOMEM;
1206 } 1206 }
1207 1207
1208 req = (struct cpl_pass_open_req *) skb_put(skb, sizeof(*req)); 1208 req = skb_put(skb, sizeof(*req));
1209 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 1209 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1210 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, ep->stid)); 1210 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, ep->stid));
1211 req->local_port = ep->com.local_addr.sin_port; 1211 req->local_port = ep->com.local_addr.sin_port;
@@ -1246,7 +1246,7 @@ static int listen_stop(struct iwch_listen_ep *ep)
1246 pr_err("%s - failed to alloc skb\n", __func__); 1246 pr_err("%s - failed to alloc skb\n", __func__);
1247 return -ENOMEM; 1247 return -ENOMEM;
1248 } 1248 }
1249 req = (struct cpl_close_listserv_req *) skb_put(skb, sizeof(*req)); 1249 req = skb_put(skb, sizeof(*req));
1250 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 1250 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1251 req->cpu_idx = 0; 1251 req->cpu_idx = 0;
1252 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid)); 1252 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid));
@@ -1614,7 +1614,7 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1614 goto out; 1614 goto out;
1615 } 1615 }
1616 rpl_skb->priority = CPL_PRIORITY_DATA; 1616 rpl_skb->priority = CPL_PRIORITY_DATA;
1617 rpl = (struct cpl_abort_rpl *) skb_put(rpl_skb, sizeof(*rpl)); 1617 rpl = skb_put(rpl_skb, sizeof(*rpl));
1618 rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL)); 1618 rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL));
1619 rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); 1619 rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid));
1620 OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid)); 1620 OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid));
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 7c32a7c7977d..36ae3023e703 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -597,7 +597,7 @@ static int send_flowc(struct c4iw_ep *ep)
597 else 597 else
598 nparams = 9; 598 nparams = 9;
599 599
600 flowc = (struct fw_flowc_wr *)__skb_put(skb, FLOWC_LEN); 600 flowc = __skb_put(skb, FLOWC_LEN);
601 601
602 flowc->op_to_nparams = cpu_to_be32(FW_WR_OP_V(FW_FLOWC_WR) | 602 flowc->op_to_nparams = cpu_to_be32(FW_WR_OP_V(FW_FLOWC_WR) |
603 FW_FLOWC_WR_NPARAMS_V(nparams)); 603 FW_FLOWC_WR_NPARAMS_V(nparams));
@@ -787,18 +787,16 @@ static int send_connect(struct c4iw_ep *ep)
787 if (ep->com.remote_addr.ss_family == AF_INET) { 787 if (ep->com.remote_addr.ss_family == AF_INET) {
788 switch (CHELSIO_CHIP_VERSION(adapter_type)) { 788 switch (CHELSIO_CHIP_VERSION(adapter_type)) {
789 case CHELSIO_T4: 789 case CHELSIO_T4:
790 req = (struct cpl_act_open_req *)skb_put(skb, wrlen); 790 req = skb_put(skb, wrlen);
791 INIT_TP_WR(req, 0); 791 INIT_TP_WR(req, 0);
792 break; 792 break;
793 case CHELSIO_T5: 793 case CHELSIO_T5:
794 t5req = (struct cpl_t5_act_open_req *)skb_put(skb, 794 t5req = skb_put(skb, wrlen);
795 wrlen);
796 INIT_TP_WR(t5req, 0); 795 INIT_TP_WR(t5req, 0);
797 req = (struct cpl_act_open_req *)t5req; 796 req = (struct cpl_act_open_req *)t5req;
798 break; 797 break;
799 case CHELSIO_T6: 798 case CHELSIO_T6:
800 t6req = (struct cpl_t6_act_open_req *)skb_put(skb, 799 t6req = skb_put(skb, wrlen);
801 wrlen);
802 INIT_TP_WR(t6req, 0); 800 INIT_TP_WR(t6req, 0);
803 req = (struct cpl_act_open_req *)t6req; 801 req = (struct cpl_act_open_req *)t6req;
804 t5req = (struct cpl_t5_act_open_req *)t6req; 802 t5req = (struct cpl_t5_act_open_req *)t6req;
@@ -839,18 +837,16 @@ static int send_connect(struct c4iw_ep *ep)
839 } else { 837 } else {
840 switch (CHELSIO_CHIP_VERSION(adapter_type)) { 838 switch (CHELSIO_CHIP_VERSION(adapter_type)) {
841 case CHELSIO_T4: 839 case CHELSIO_T4:
842 req6 = (struct cpl_act_open_req6 *)skb_put(skb, wrlen); 840 req6 = skb_put(skb, wrlen);
843 INIT_TP_WR(req6, 0); 841 INIT_TP_WR(req6, 0);
844 break; 842 break;
845 case CHELSIO_T5: 843 case CHELSIO_T5:
846 t5req6 = (struct cpl_t5_act_open_req6 *)skb_put(skb, 844 t5req6 = skb_put(skb, wrlen);
847 wrlen);
848 INIT_TP_WR(t5req6, 0); 845 INIT_TP_WR(t5req6, 0);
849 req6 = (struct cpl_act_open_req6 *)t5req6; 846 req6 = (struct cpl_act_open_req6 *)t5req6;
850 break; 847 break;
851 case CHELSIO_T6: 848 case CHELSIO_T6:
852 t6req6 = (struct cpl_t6_act_open_req6 *)skb_put(skb, 849 t6req6 = skb_put(skb, wrlen);
853 wrlen);
854 INIT_TP_WR(t6req6, 0); 850 INIT_TP_WR(t6req6, 0);
855 req6 = (struct cpl_act_open_req6 *)t6req6; 851 req6 = (struct cpl_act_open_req6 *)t6req6;
856 t5req6 = (struct cpl_t5_act_open_req6 *)t6req6; 852 t5req6 = (struct cpl_t5_act_open_req6 *)t6req6;
@@ -1904,7 +1900,7 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
1904 int win; 1900 int win;
1905 1901
1906 skb = get_skb(NULL, sizeof(*req), GFP_KERNEL); 1902 skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
1907 req = (struct fw_ofld_connection_wr *)__skb_put(skb, sizeof(*req)); 1903 req = __skb_put(skb, sizeof(*req));
1908 memset(req, 0, sizeof(*req)); 1904 memset(req, 0, sizeof(*req));
1909 req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR)); 1905 req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR));
1910 req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16))); 1906 req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
@@ -3807,7 +3803,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,
3807 req_skb = alloc_skb(sizeof(struct fw_ofld_connection_wr), GFP_KERNEL); 3803 req_skb = alloc_skb(sizeof(struct fw_ofld_connection_wr), GFP_KERNEL);
3808 if (!req_skb) 3804 if (!req_skb)
3809 return; 3805 return;
3810 req = (struct fw_ofld_connection_wr *)__skb_put(req_skb, sizeof(*req)); 3806 req = __skb_put(req_skb, sizeof(*req));
3811 memset(req, 0, sizeof(*req)); 3807 memset(req, 0, sizeof(*req));
3812 req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F); 3808 req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F);
3813 req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16))); 3809 req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index 14de5bde1b63..394cfe2625fe 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -44,7 +44,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
44 wr_len = sizeof *res_wr + sizeof *res; 44 wr_len = sizeof *res_wr + sizeof *res;
45 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); 45 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
46 46
47 res_wr = (struct fw_ri_res_wr *)__skb_put(skb, wr_len); 47 res_wr = __skb_put(skb, wr_len);
48 memset(res_wr, 0, wr_len); 48 memset(res_wr, 0, wr_len);
49 res_wr->op_nres = cpu_to_be32( 49 res_wr->op_nres = cpu_to_be32(
50 FW_WR_OP_V(FW_RI_RES_WR) | 50 FW_WR_OP_V(FW_RI_RES_WR) |
@@ -114,7 +114,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
114 } 114 }
115 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); 115 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
116 116
117 res_wr = (struct fw_ri_res_wr *)__skb_put(skb, wr_len); 117 res_wr = __skb_put(skb, wr_len);
118 memset(res_wr, 0, wr_len); 118 memset(res_wr, 0, wr_len);
119 res_wr->op_nres = cpu_to_be32( 119 res_wr->op_nres = cpu_to_be32(
120 FW_WR_OP_V(FW_RI_RES_WR) | 120 FW_WR_OP_V(FW_RI_RES_WR) |
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index 3ee7f43e419a..ca992e4b66e4 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -81,7 +81,7 @@ static int _c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr,
81 } 81 }
82 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); 82 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
83 83
84 req = (struct ulp_mem_io *)__skb_put(skb, wr_len); 84 req = __skb_put(skb, wr_len);
85 memset(req, 0, wr_len); 85 memset(req, 0, wr_len);
86 INIT_ULPTX_WR(req, wr_len, 0, 0); 86 INIT_ULPTX_WR(req, wr_len, 0, 0);
87 req->wr.wr_hi = cpu_to_be32(FW_WR_OP_V(FW_ULPTX_WR) | 87 req->wr.wr_hi = cpu_to_be32(FW_WR_OP_V(FW_ULPTX_WR) |
@@ -142,7 +142,7 @@ static int _c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len,
142 } 142 }
143 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); 143 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
144 144
145 req = (struct ulp_mem_io *)__skb_put(skb, wr_len); 145 req = __skb_put(skb, wr_len);
146 memset(req, 0, wr_len); 146 memset(req, 0, wr_len);
147 INIT_ULPTX_WR(req, wr_len, 0, 0); 147 INIT_ULPTX_WR(req, wr_len, 0, 0);
148 148
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 8e4154b4253e..b23a0b057347 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -293,7 +293,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
293 } 293 }
294 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); 294 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
295 295
296 res_wr = (struct fw_ri_res_wr *)__skb_put(skb, wr_len); 296 res_wr = __skb_put(skb, wr_len);
297 memset(res_wr, 0, wr_len); 297 memset(res_wr, 0, wr_len);
298 res_wr->op_nres = cpu_to_be32( 298 res_wr->op_nres = cpu_to_be32(
299 FW_WR_OP_V(FW_RI_RES_WR) | 299 FW_WR_OP_V(FW_RI_RES_WR) |
@@ -1228,7 +1228,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe,
1228 1228
1229 set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); 1229 set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
1230 1230
1231 wqe = (struct fw_ri_wr *)__skb_put(skb, sizeof(*wqe)); 1231 wqe = __skb_put(skb, sizeof(*wqe));
1232 memset(wqe, 0, sizeof *wqe); 1232 memset(wqe, 0, sizeof *wqe);
1233 wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR)); 1233 wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR));
1234 wqe->flowid_len16 = cpu_to_be32( 1234 wqe->flowid_len16 = cpu_to_be32(
@@ -1350,7 +1350,7 @@ static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
1350 1350
1351 set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx); 1351 set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx);
1352 1352
1353 wqe = (struct fw_ri_wr *)__skb_put(skb, sizeof(*wqe)); 1353 wqe = __skb_put(skb, sizeof(*wqe));
1354 memset(wqe, 0, sizeof *wqe); 1354 memset(wqe, 0, sizeof *wqe);
1355 wqe->op_compl = cpu_to_be32( 1355 wqe->op_compl = cpu_to_be32(
1356 FW_WR_OP_V(FW_RI_INIT_WR) | 1356 FW_WR_OP_V(FW_RI_INIT_WR) |
@@ -1419,7 +1419,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp)
1419 } 1419 }
1420 set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); 1420 set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
1421 1421
1422 wqe = (struct fw_ri_wr *)__skb_put(skb, sizeof(*wqe)); 1422 wqe = __skb_put(skb, sizeof(*wqe));
1423 memset(wqe, 0, sizeof *wqe); 1423 memset(wqe, 0, sizeof *wqe);
1424 wqe->op_compl = cpu_to_be32( 1424 wqe->op_compl = cpu_to_be32(
1425 FW_WR_OP_V(FW_RI_INIT_WR) | 1425 FW_WR_OP_V(FW_RI_INIT_WR) |
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 77be17590866..96f586d34d2d 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1082,7 +1082,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1082 skb = mp->outskb; 1082 skb = mp->outskb;
1083 if (skb) { 1083 if (skb) {
1084 if (skb_tailroom(skb) > 0) { 1084 if (skb_tailroom(skb) > 0) {
1085 *(skb_put(skb, 1)) = ch; 1085 *(u8 *)skb_put(skb, 1) = ch;
1086 goto unlock_out; 1086 goto unlock_out;
1087 } 1087 }
1088 mp->outskb = NULL; 1088 mp->outskb = NULL;
@@ -1094,7 +1094,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1094 skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC); 1094 skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC);
1095 if (skb) { 1095 if (skb) {
1096 skb_reserve(skb, CAPI_DATA_B3_REQ_LEN); 1096 skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
1097 *(skb_put(skb, 1)) = ch; 1097 *(u8 *)skb_put(skb, 1) = ch;
1098 mp->outskb = skb; 1098 mp->outskb = skb;
1099 } else { 1099 } else {
1100 printk(KERN_ERR "capinc_put_char: char %u lost\n", ch); 1100 printk(KERN_ERR "capinc_put_char: char %u lost\n", ch);
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index c90dca5abeac..03ac9fbfe318 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -264,7 +264,7 @@ byte_stuff:
264 /* skip remainder of packet */ 264 /* skip remainder of packet */
265 bcs->rx_skb = skb = NULL; 265 bcs->rx_skb = skb = NULL;
266 } else { 266 } else {
267 *__skb_put(skb, 1) = c; 267 *(u8 *)__skb_put(skb, 1) = c;
268 fcs = crc_ccitt_byte(fcs, c); 268 fcs = crc_ccitt_byte(fcs, c);
269 } 269 }
270 } 270 }
@@ -315,7 +315,7 @@ static unsigned iraw_loop(unsigned numbytes, struct inbuf_t *inbuf)
315 315
316 /* regular data byte: append to current skb */ 316 /* regular data byte: append to current skb */
317 inputstate |= INS_have_data; 317 inputstate |= INS_have_data;
318 *__skb_put(skb, 1) = bitrev8(c); 318 *(u8 *)__skb_put(skb, 1) = bitrev8(c);
319 } 319 }
320 320
321 /* pass data up */ 321 /* pass data up */
@@ -492,33 +492,33 @@ static struct sk_buff *HDLC_Encode(struct sk_buff *skb)
492 hdlc_skb->mac_len = skb->mac_len; 492 hdlc_skb->mac_len = skb->mac_len;
493 493
494 /* Add flag sequence in front of everything.. */ 494 /* Add flag sequence in front of everything.. */
495 *(skb_put(hdlc_skb, 1)) = PPP_FLAG; 495 *(u8 *)skb_put(hdlc_skb, 1) = PPP_FLAG;
496 496
497 /* Perform byte stuffing while copying data. */ 497 /* Perform byte stuffing while copying data. */
498 while (skb->len--) { 498 while (skb->len--) {
499 if (muststuff(*skb->data)) { 499 if (muststuff(*skb->data)) {
500 *(skb_put(hdlc_skb, 1)) = PPP_ESCAPE; 500 *(u8 *)skb_put(hdlc_skb, 1) = PPP_ESCAPE;
501 *(skb_put(hdlc_skb, 1)) = (*skb->data++) ^ PPP_TRANS; 501 *(u8 *)skb_put(hdlc_skb, 1) = (*skb->data++) ^ PPP_TRANS;
502 } else 502 } else
503 *(skb_put(hdlc_skb, 1)) = *skb->data++; 503 *(u8 *)skb_put(hdlc_skb, 1) = *skb->data++;
504 } 504 }
505 505
506 /* Finally add FCS (byte stuffed) and flag sequence */ 506 /* Finally add FCS (byte stuffed) and flag sequence */
507 c = (fcs & 0x00ff); /* least significant byte first */ 507 c = (fcs & 0x00ff); /* least significant byte first */
508 if (muststuff(c)) { 508 if (muststuff(c)) {
509 *(skb_put(hdlc_skb, 1)) = PPP_ESCAPE; 509 *(u8 *)skb_put(hdlc_skb, 1) = PPP_ESCAPE;
510 c ^= PPP_TRANS; 510 c ^= PPP_TRANS;
511 } 511 }
512 *(skb_put(hdlc_skb, 1)) = c; 512 *(u8 *)skb_put(hdlc_skb, 1) = c;
513 513
514 c = ((fcs >> 8) & 0x00ff); 514 c = ((fcs >> 8) & 0x00ff);
515 if (muststuff(c)) { 515 if (muststuff(c)) {
516 *(skb_put(hdlc_skb, 1)) = PPP_ESCAPE; 516 *(u8 *)skb_put(hdlc_skb, 1) = PPP_ESCAPE;
517 c ^= PPP_TRANS; 517 c ^= PPP_TRANS;
518 } 518 }
519 *(skb_put(hdlc_skb, 1)) = c; 519 *(u8 *)skb_put(hdlc_skb, 1) = c;
520 520
521 *(skb_put(hdlc_skb, 1)) = PPP_FLAG; 521 *(u8 *)skb_put(hdlc_skb, 1) = PPP_FLAG;
522 522
523 dev_kfree_skb_any(skb); 523 dev_kfree_skb_any(skb);
524 return hdlc_skb; 524 return hdlc_skb;
@@ -561,8 +561,8 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb)
561 while (len--) { 561 while (len--) {
562 c = bitrev8(*cp++); 562 c = bitrev8(*cp++);
563 if (c == DLE_FLAG) 563 if (c == DLE_FLAG)
564 *(skb_put(iraw_skb, 1)) = c; 564 *(u8 *)skb_put(iraw_skb, 1) = c;
565 *(skb_put(iraw_skb, 1)) = c; 565 *(u8 *)skb_put(iraw_skb, 1) = c;
566 } 566 }
567 dev_kfree_skb_any(skb); 567 dev_kfree_skb_any(skb);
568 return iraw_skb; 568 return iraw_skb;
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index bc29f1d52a2f..74e250664ce9 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -511,7 +511,7 @@ static inline void hdlc_putbyte(unsigned char c, struct bc_state *bcs)
511 bcs->rx_skb = NULL; 511 bcs->rx_skb = NULL;
512 return; 512 return;
513 } 513 }
514 *__skb_put(bcs->rx_skb, 1) = c; 514 *(u8 *)__skb_put(bcs->rx_skb, 1) = c;
515} 515}
516 516
517/* hdlc_flush 517/* hdlc_flush
diff --git a/drivers/isdn/i4l/isdn_audio.c b/drivers/isdn/i4l/isdn_audio.c
index 78ce42214713..b6bcd1eca128 100644
--- a/drivers/isdn/i4l/isdn_audio.c
+++ b/drivers/isdn/i4l/isdn_audio.c
@@ -462,7 +462,7 @@ isdn_audio_goertzel(int *sample, modem_info *info)
462 info->line); 462 info->line);
463 return; 463 return;
464 } 464 }
465 result = (int *) skb_put(skb, sizeof(int) * NCOEFF); 465 result = skb_put(skb, sizeof(int) * NCOEFF);
466 for (k = 0; k < NCOEFF; k++) { 466 for (k = 0; k < NCOEFF; k++) {
467 sk = sk1 = sk2 = 0; 467 sk = sk1 = sk2 = 0;
468 for (n = 0; n < DTMF_NPOINTS; n++) { 468 for (n = 0; n < DTMF_NPOINTS; n++) {
@@ -672,7 +672,7 @@ isdn_audio_put_dle_code(modem_info *info, u_char code)
672 info->line); 672 info->line);
673 return; 673 return;
674 } 674 }
675 p = (char *) skb_put(skb, 2); 675 p = skb_put(skb, 2);
676 p[0] = 0x10; 676 p[0] = 0x10;
677 p[1] = code; 677 p[1] = code;
678 ISDN_AUDIO_SKB_DLECOUNT(skb) = 0; 678 ISDN_AUDIO_SKB_DLECOUNT(skb) = 0;
diff --git a/drivers/isdn/i4l/isdn_bsdcomp.c b/drivers/isdn/i4l/isdn_bsdcomp.c
index 8837ac5a492d..6ade0916da4e 100644
--- a/drivers/isdn/i4l/isdn_bsdcomp.c
+++ b/drivers/isdn/i4l/isdn_bsdcomp.c
@@ -472,7 +472,7 @@ static int bsd_compress(void *state, struct sk_buff *skb_in, struct sk_buff *skb
472 accm |= ((ent) << bitno); \ 472 accm |= ((ent) << bitno); \
473 do { \ 473 do { \
474 if (skb_out && skb_tailroom(skb_out) > 0) \ 474 if (skb_out && skb_tailroom(skb_out) > 0) \
475 *(skb_put(skb_out, 1)) = (unsigned char)(accm >> 24); \ 475 *(u8 *)skb_put(skb_out, 1) = (u8)(accm >> 24); \
476 accm <<= 8; \ 476 accm <<= 8; \
477 bitno += 8; \ 477 bitno += 8; \
478 } while (bitno <= 24); \ 478 } while (bitno <= 24); \
@@ -602,7 +602,7 @@ static int bsd_compress(void *state, struct sk_buff *skb_in, struct sk_buff *skb
602 * Do not emit a completely useless byte of ones. 602 * Do not emit a completely useless byte of ones.
603 */ 603 */
604 if (bitno < 32 && skb_out && skb_tailroom(skb_out) > 0) 604 if (bitno < 32 && skb_out && skb_tailroom(skb_out) > 0)
605 *(skb_put(skb_out, 1)) = (unsigned char)((accm | (0xff << (bitno - 8))) >> 24); 605 *(u8 *)skb_put(skb_out, 1) = (unsigned char)((accm | (0xff << (bitno - 8))) >> 24);
606 606
607 /* 607 /*
608 * Increase code size if we would have without the packet 608 * Increase code size if we would have without the packet
@@ -698,7 +698,7 @@ static int bsd_decompress(void *state, struct sk_buff *skb_in, struct sk_buff *s
698 db->bytes_out += ilen; 698 db->bytes_out += ilen;
699 699
700 if (skb_tailroom(skb_out) > 0) 700 if (skb_tailroom(skb_out) > 0)
701 *(skb_put(skb_out, 1)) = 0; 701 *(u8 *)skb_put(skb_out, 1) = 0;
702 else 702 else
703 return DECOMP_ERR_NOMEM; 703 return DECOMP_ERR_NOMEM;
704 704
@@ -816,7 +816,7 @@ static int bsd_decompress(void *state, struct sk_buff *skb_in, struct sk_buff *s
816#endif 816#endif
817 817
818 if (extra) /* the KwKwK case again */ 818 if (extra) /* the KwKwK case again */
819 *(skb_put(skb_out, 1)) = finchar; 819 *(u8 *)skb_put(skb_out, 1) = finchar;
820 820
821 /* 821 /*
822 * If not first code in a packet, and 822 * If not first code in a packet, and
diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
index ba60076e0b95..e33fa3073f74 100644
--- a/drivers/isdn/i4l/isdn_x25iface.c
+++ b/drivers/isdn/i4l/isdn_x25iface.c
@@ -224,7 +224,7 @@ static int isdn_x25iface_connect_ind(struct concap_proto *cprot)
224 224
225 skb = dev_alloc_skb(1); 225 skb = dev_alloc_skb(1);
226 if (skb) { 226 if (skb) {
227 *(skb_put(skb, 1)) = X25_IFACE_CONNECT; 227 *(u8 *)skb_put(skb, 1) = X25_IFACE_CONNECT;
228 skb->protocol = x25_type_trans(skb, cprot->net_dev); 228 skb->protocol = x25_type_trans(skb, cprot->net_dev);
229 netif_rx(skb); 229 netif_rx(skb);
230 return 0; 230 return 0;
@@ -253,7 +253,7 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
253 *state_p = WAN_DISCONNECTED; 253 *state_p = WAN_DISCONNECTED;
254 skb = dev_alloc_skb(1); 254 skb = dev_alloc_skb(1);
255 if (skb) { 255 if (skb) {
256 *(skb_put(skb, 1)) = X25_IFACE_DISCONNECT; 256 *(u8 *)skb_put(skb, 1) = X25_IFACE_DISCONNECT;
257 skb->protocol = x25_type_trans(skb, cprot->net_dev); 257 skb->protocol = x25_type_trans(skb, cprot->net_dev);
258 netif_rx(skb); 258 netif_rx(skb);
259 return 0; 259 return 0;
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index bbaf0a8cae8b..06b0dcc13695 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -963,7 +963,7 @@ static void dvb_net_sec(struct net_device *dev,
963 skb->dev = dev; 963 skb->dev = dev;
964 964
965 /* copy L3 payload */ 965 /* copy L3 payload */
966 eth = (u8 *) skb_put(skb, pkt_len - 12 - 4 + 14 - snap); 966 eth = skb_put(skb, pkt_len - 12 - 4 + 14 - snap);
967 memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap); 967 memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap);
968 968
969 /* create ethernet header: */ 969 /* create ethernet header: */
diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c
index c67e055a12c9..ab3428bf63fe 100644
--- a/drivers/media/radio/wl128x/fmdrv_common.c
+++ b/drivers/media/radio/wl128x/fmdrv_common.c
@@ -416,7 +416,7 @@ static int fm_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
416 if (!test_bit(FM_FW_DW_INPROGRESS, &fmdev->flag) || 416 if (!test_bit(FM_FW_DW_INPROGRESS, &fmdev->flag) ||
417 test_bit(FM_INTTASK_RUNNING, &fmdev->flag)) { 417 test_bit(FM_INTTASK_RUNNING, &fmdev->flag)) {
418 /* Fill command header info */ 418 /* Fill command header info */
419 hdr = (struct fm_cmd_msg_hdr *)skb_put(skb, FM_CMD_MSG_HDR_SIZE); 419 hdr = skb_put(skb, FM_CMD_MSG_HDR_SIZE);
420 hdr->hdr = FM_PKT_LOGICAL_CHAN_NUMBER; /* 0x08 */ 420 hdr->hdr = FM_PKT_LOGICAL_CHAN_NUMBER; /* 0x08 */
421 421
422 /* 3 (fm_opcode,rd_wr,dlen) + payload len) */ 422 /* 3 (fm_opcode,rd_wr,dlen) + payload len) */
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 5427032aa05e..f43fb2f958a5 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -857,7 +857,7 @@ static int ad_lacpdu_send(struct port *port)
857 skb->protocol = PKT_TYPE_LACPDU; 857 skb->protocol = PKT_TYPE_LACPDU;
858 skb->priority = TC_PRIO_CONTROL; 858 skb->priority = TC_PRIO_CONTROL;
859 859
860 lacpdu_header = (struct lacpdu_header *)skb_put(skb, length); 860 lacpdu_header = skb_put(skb, length);
861 861
862 ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr); 862 ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
863 /* Note: source address is set to be the member's PERMANENT address, 863 /* Note: source address is set to be the member's PERMANENT address,
@@ -899,7 +899,7 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker)
899 skb->network_header = skb->mac_header + ETH_HLEN; 899 skb->network_header = skb->mac_header + ETH_HLEN;
900 skb->protocol = PKT_TYPE_LACPDU; 900 skb->protocol = PKT_TYPE_LACPDU;
901 901
902 marker_header = (struct bond_marker_header *)skb_put(skb, length); 902 marker_header = skb_put(skb, length);
903 903
904 ether_addr_copy(marker_header->hdr.h_dest, lacpdu_mcast_addr); 904 ether_addr_copy(marker_header->hdr.h_dest, lacpdu_mcast_addr);
905 /* Note: source address is set to be the member's PERMANENT address, 905 /* Note: source address is set to be the member's PERMANENT address,
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index ae4ed03dc642..a3011c001080 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -648,7 +648,7 @@ struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
648 can_skb_prv(skb)->ifindex = dev->ifindex; 648 can_skb_prv(skb)->ifindex = dev->ifindex;
649 can_skb_prv(skb)->skbcnt = 0; 649 can_skb_prv(skb)->skbcnt = 0;
650 650
651 *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); 651 *cf = skb_put(skb, sizeof(struct can_frame));
652 memset(*cf, 0, sizeof(struct can_frame)); 652 memset(*cf, 0, sizeof(struct can_frame));
653 653
654 return skb; 654 return skb;
@@ -677,7 +677,7 @@ struct sk_buff *alloc_canfd_skb(struct net_device *dev,
677 can_skb_prv(skb)->ifindex = dev->ifindex; 677 can_skb_prv(skb)->ifindex = dev->ifindex;
678 can_skb_prv(skb)->skbcnt = 0; 678 can_skb_prv(skb)->skbcnt = 0;
679 679
680 *cfd = (struct canfd_frame *)skb_put(skb, sizeof(struct canfd_frame)); 680 *cfd = skb_put(skb, sizeof(struct canfd_frame));
681 memset(*cfd, 0, sizeof(struct canfd_frame)); 681 memset(*cfd, 0, sizeof(struct canfd_frame));
682 682
683 return skb; 683 return skb;
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index c8f4d26fc9d4..3143de45baaa 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -633,7 +633,7 @@ static void emac_rx(struct net_device *dev)
633 if (!skb) 633 if (!skb)
634 continue; 634 continue;
635 skb_reserve(skb, 2); 635 skb_reserve(skb, 2);
636 rdptr = (u8 *) skb_put(skb, rxlen - 4); 636 rdptr = skb_put(skb, rxlen - 4);
637 637
638 /* Read received packet from RX SRAM */ 638 /* Read received packet from RX SRAM */
639 if (netif_msg_rx_status(db)) 639 if (netif_msg_rx_status(db))
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 2ff6bd139c96..e1a50c87c9a9 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -471,7 +471,7 @@ static int init_tp_parity(struct adapter *adap)
471 if (!skb) 471 if (!skb)
472 goto alloc_skb_fail; 472 goto alloc_skb_fail;
473 473
474 req = (struct cpl_smt_write_req *)__skb_put(skb, sizeof(*req)); 474 req = __skb_put(skb, sizeof(*req));
475 memset(req, 0, sizeof(*req)); 475 memset(req, 0, sizeof(*req));
476 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 476 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
477 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, i)); 477 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, i));
@@ -495,7 +495,7 @@ static int init_tp_parity(struct adapter *adap)
495 if (!skb) 495 if (!skb)
496 goto alloc_skb_fail; 496 goto alloc_skb_fail;
497 497
498 req = (struct cpl_l2t_write_req *)__skb_put(skb, sizeof(*req)); 498 req = __skb_put(skb, sizeof(*req));
499 memset(req, 0, sizeof(*req)); 499 memset(req, 0, sizeof(*req));
500 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 500 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
501 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, i)); 501 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, i));
@@ -518,7 +518,7 @@ static int init_tp_parity(struct adapter *adap)
518 if (!skb) 518 if (!skb)
519 goto alloc_skb_fail; 519 goto alloc_skb_fail;
520 520
521 req = (struct cpl_rte_write_req *)__skb_put(skb, sizeof(*req)); 521 req = __skb_put(skb, sizeof(*req));
522 memset(req, 0, sizeof(*req)); 522 memset(req, 0, sizeof(*req));
523 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 523 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
524 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RTE_WRITE_REQ, i)); 524 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RTE_WRITE_REQ, i));
@@ -538,7 +538,7 @@ static int init_tp_parity(struct adapter *adap)
538 if (!skb) 538 if (!skb)
539 goto alloc_skb_fail; 539 goto alloc_skb_fail;
540 540
541 greq = (struct cpl_set_tcb_field *)__skb_put(skb, sizeof(*greq)); 541 greq = __skb_put(skb, sizeof(*greq));
542 memset(greq, 0, sizeof(*greq)); 542 memset(greq, 0, sizeof(*greq));
543 greq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 543 greq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
544 OPCODE_TID(greq) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, 0)); 544 OPCODE_TID(greq) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, 0));
@@ -909,7 +909,7 @@ static int write_smt_entry(struct adapter *adapter, int idx)
909 if (!skb) 909 if (!skb)
910 return -ENOMEM; 910 return -ENOMEM;
911 911
912 req = (struct cpl_smt_write_req *)__skb_put(skb, sizeof(*req)); 912 req = __skb_put(skb, sizeof(*req));
913 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 913 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
914 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, idx)); 914 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, idx));
915 req->mtu_idx = NMTUS - 1; /* should be 0 but there's a T3 bug */ 915 req->mtu_idx = NMTUS - 1; /* should be 0 but there's a T3 bug */
@@ -952,7 +952,7 @@ static int send_pktsched_cmd(struct adapter *adap, int sched, int qidx, int lo,
952 if (!skb) 952 if (!skb)
953 return -ENOMEM; 953 return -ENOMEM;
954 954
955 req = (struct mngt_pktsched_wr *)skb_put(skb, sizeof(*req)); 955 req = skb_put(skb, sizeof(*req));
956 req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT)); 956 req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT));
957 req->mngt_opcode = FW_MNGTOPCODE_PKTSCHED_SET; 957 req->mngt_opcode = FW_MNGTOPCODE_PKTSCHED_SET;
958 req->sched = sched; 958 req->sched = sched;
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
index fa81445e334c..50cd660732c5 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
@@ -552,7 +552,7 @@ static inline void mk_tid_release(struct sk_buff *skb, unsigned int tid)
552 struct cpl_tid_release *req; 552 struct cpl_tid_release *req;
553 553
554 skb->priority = CPL_PRIORITY_SETUP; 554 skb->priority = CPL_PRIORITY_SETUP;
555 req = (struct cpl_tid_release *)__skb_put(skb, sizeof(*req)); 555 req = __skb_put(skb, sizeof(*req));
556 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 556 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
557 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, tid)); 557 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
558} 558}
@@ -1096,7 +1096,7 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
1096 return; 1096 return;
1097 } 1097 }
1098 skb->priority = CPL_PRIORITY_CONTROL; 1098 skb->priority = CPL_PRIORITY_CONTROL;
1099 req = (struct cpl_set_tcb_field *)skb_put(skb, sizeof(*req)); 1099 req = skb_put(skb, sizeof(*req));
1100 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 1100 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1101 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); 1101 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1102 req->reply = 0; 1102 req->reply = 0;
diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.c b/drivers/net/ethernet/chelsio/cxgb3/l2t.c
index 26264125865f..248e40c6966c 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.c
@@ -96,7 +96,7 @@ static int setup_l2e_send_pending(struct t3cdev *dev, struct sk_buff *skb,
96 return -ENOMEM; 96 return -ENOMEM;
97 } 97 }
98 98
99 req = (struct cpl_l2t_write_req *)__skb_put(skb, sizeof(*req)); 99 req = __skb_put(skb, sizeof(*req));
100 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); 100 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
101 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, e->idx)); 101 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, e->idx));
102 req->params = htonl(V_L2T_W_IDX(e->idx) | V_L2T_W_IFF(e->smt_idx) | 102 req->params = htonl(V_L2T_W_IDX(e->idx) | V_L2T_W_IFF(e->smt_idx) |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index 10736738ff30..a0fab65e80e8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -190,7 +190,7 @@ static int del_filter_wr(struct adapter *adapter, int fidx)
190 if (!skb) 190 if (!skb)
191 return -ENOMEM; 191 return -ENOMEM;
192 192
193 fwr = (struct fw_filter_wr *)__skb_put(skb, len); 193 fwr = __skb_put(skb, len);
194 t4_mk_filtdelwr(f->tid, fwr, adapter->sge.fw_evtq.abs_id); 194 t4_mk_filtdelwr(f->tid, fwr, adapter->sge.fw_evtq.abs_id);
195 195
196 /* Mark the filter as "pending" and ship off the Filter Work Request. 196 /* Mark the filter as "pending" and ship off the Filter Work Request.
@@ -231,7 +231,7 @@ int set_filter_wr(struct adapter *adapter, int fidx)
231 } 231 }
232 } 232 }
233 233
234 fwr = (struct fw_filter_wr *)__skb_put(skb, sizeof(*fwr)); 234 fwr = __skb_put(skb, sizeof(*fwr));
235 memset(fwr, 0, sizeof(*fwr)); 235 memset(fwr, 0, sizeof(*fwr));
236 236
237 /* It would be nice to put most of the following in t4_hw.c but most 237 /* It would be nice to put most of the following in t4_hw.c but most
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 2c6de769f4e6..15fb284eafc0 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1175,7 +1175,7 @@ static void mk_tid_release(struct sk_buff *skb, unsigned int chan,
1175 struct cpl_tid_release *req; 1175 struct cpl_tid_release *req;
1176 1176
1177 set_wr_txq(skb, CPL_PRIORITY_SETUP, chan); 1177 set_wr_txq(skb, CPL_PRIORITY_SETUP, chan);
1178 req = (struct cpl_tid_release *)__skb_put(skb, sizeof(*req)); 1178 req = __skb_put(skb, sizeof(*req));
1179 INIT_TP_WR(req, tid); 1179 INIT_TP_WR(req, tid);
1180 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, tid)); 1180 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
1181} 1181}
@@ -1359,7 +1359,7 @@ int cxgb4_create_server(const struct net_device *dev, unsigned int stid,
1359 return -ENOMEM; 1359 return -ENOMEM;
1360 1360
1361 adap = netdev2adap(dev); 1361 adap = netdev2adap(dev);
1362 req = (struct cpl_pass_open_req *)__skb_put(skb, sizeof(*req)); 1362 req = __skb_put(skb, sizeof(*req));
1363 INIT_TP_WR(req, 0); 1363 INIT_TP_WR(req, 0);
1364 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, stid)); 1364 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, stid));
1365 req->local_port = sport; 1365 req->local_port = sport;
@@ -1400,7 +1400,7 @@ int cxgb4_create_server6(const struct net_device *dev, unsigned int stid,
1400 return -ENOMEM; 1400 return -ENOMEM;
1401 1401
1402 adap = netdev2adap(dev); 1402 adap = netdev2adap(dev);
1403 req = (struct cpl_pass_open_req6 *)__skb_put(skb, sizeof(*req)); 1403 req = __skb_put(skb, sizeof(*req));
1404 INIT_TP_WR(req, 0); 1404 INIT_TP_WR(req, 0);
1405 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ6, stid)); 1405 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ6, stid));
1406 req->local_port = sport; 1406 req->local_port = sport;
@@ -1432,7 +1432,7 @@ int cxgb4_remove_server(const struct net_device *dev, unsigned int stid,
1432 if (!skb) 1432 if (!skb)
1433 return -ENOMEM; 1433 return -ENOMEM;
1434 1434
1435 req = (struct cpl_close_listsvr_req *)__skb_put(skb, sizeof(*req)); 1435 req = __skb_put(skb, sizeof(*req));
1436 INIT_TP_WR(req, 0); 1436 INIT_TP_WR(req, 0);
1437 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, stid)); 1437 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, stid));
1438 req->reply_ctrl = htons(NO_REPLY_V(0) | (ipv6 ? LISTSVR_IPV6_V(1) : 1438 req->reply_ctrl = htons(NO_REPLY_V(0) | (ipv6 ? LISTSVR_IPV6_V(1) :
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index 6f3692db29af..f7ef8871dd0b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -146,7 +146,7 @@ static int write_l2e(struct adapter *adap, struct l2t_entry *e, int sync)
146 if (!skb) 146 if (!skb)
147 return -ENOMEM; 147 return -ENOMEM;
148 148
149 req = (struct cpl_l2t_write_req *)__skb_put(skb, sizeof(*req)); 149 req = __skb_put(skb, sizeof(*req));
150 INIT_TP_WR(req, 0); 150 INIT_TP_WR(req, 0);
151 151
152 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, 152 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ,
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
index 515b94ff9080..4b5aacc09cab 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.h
@@ -90,7 +90,7 @@ cxgb_mk_tid_release(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
90{ 90{
91 struct cpl_tid_release *req; 91 struct cpl_tid_release *req;
92 92
93 req = (struct cpl_tid_release *)__skb_put(skb, len); 93 req = __skb_put(skb, len);
94 memset(req, 0, len); 94 memset(req, 0, len);
95 95
96 INIT_TP_WR(req, tid); 96 INIT_TP_WR(req, tid);
@@ -104,7 +104,7 @@ cxgb_mk_close_con_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
104{ 104{
105 struct cpl_close_con_req *req; 105 struct cpl_close_con_req *req;
106 106
107 req = (struct cpl_close_con_req *)__skb_put(skb, len); 107 req = __skb_put(skb, len);
108 memset(req, 0, len); 108 memset(req, 0, len);
109 109
110 INIT_TP_WR(req, tid); 110 INIT_TP_WR(req, tid);
@@ -119,7 +119,7 @@ cxgb_mk_abort_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
119{ 119{
120 struct cpl_abort_req *req; 120 struct cpl_abort_req *req;
121 121
122 req = (struct cpl_abort_req *)__skb_put(skb, len); 122 req = __skb_put(skb, len);
123 memset(req, 0, len); 123 memset(req, 0, len);
124 124
125 INIT_TP_WR(req, tid); 125 INIT_TP_WR(req, tid);
@@ -134,7 +134,7 @@ cxgb_mk_abort_rpl(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
134{ 134{
135 struct cpl_abort_rpl *rpl; 135 struct cpl_abort_rpl *rpl;
136 136
137 rpl = (struct cpl_abort_rpl *)__skb_put(skb, len); 137 rpl = __skb_put(skb, len);
138 memset(rpl, 0, len); 138 memset(rpl, 0, len);
139 139
140 INIT_TP_WR(rpl, tid); 140 INIT_TP_WR(rpl, tid);
@@ -149,7 +149,7 @@ cxgb_mk_rx_data_ack(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
149{ 149{
150 struct cpl_rx_data_ack *req; 150 struct cpl_rx_data_ack *req;
151 151
152 req = (struct cpl_rx_data_ack *)__skb_put(skb, len); 152 req = __skb_put(skb, len);
153 memset(req, 0, len); 153 memset(req, 0, len);
154 154
155 INIT_TP_WR(req, tid); 155 INIT_TP_WR(req, tid);
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 008dc8161775..16fe776ddbe5 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1171,7 +1171,7 @@ dm9000_rx(struct net_device *dev)
1171 if (GoodPacket && 1171 if (GoodPacket &&
1172 ((skb = netdev_alloc_skb(dev, RxLen + 4)) != NULL)) { 1172 ((skb = netdev_alloc_skb(dev, RxLen + 4)) != NULL)) {
1173 skb_reserve(skb, 2); 1173 skb_reserve(skb, 2);
1174 rdptr = (u8 *) skb_put(skb, RxLen - 4); 1174 rdptr = skb_put(skb, RxLen - 4);
1175 1175
1176 /* Read received packet from RX SRAM */ 1176 /* Read received packet from RX SRAM */
1177 1177
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index 3e77dd863175..5a847941c46b 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -399,7 +399,7 @@ static int dnet_poll(struct napi_struct *napi, int budget)
399 * 'skb_put()' points to the start of sk_buff 399 * 'skb_put()' points to the start of sk_buff
400 * data area. 400 * data area.
401 */ 401 */
402 data_ptr = (unsigned int *)skb_put(skb, pkt_len); 402 data_ptr = skb_put(skb, pkt_len);
403 for (i = 0; i < (pkt_len + 3) >> 2; i++) 403 for (i = 0; i < (pkt_len + 3) >> 2; i++)
404 *data_ptr++ = dnet_readl(bp, RX_DATA_FIFO); 404 *data_ptr++ = dnet_readl(bp, RX_DATA_FIFO);
405 skb->protocol = eth_type_trans(skb, dev); 405 skb->protocol = eth_type_trans(skb, dev);
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index 5673b071e39d..c6164a98f257 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -1281,7 +1281,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
1281 */ 1281 */
1282 skb_reserve(ringptr->skb, 2); 1282 skb_reserve(ringptr->skb, 2);
1283 1283
1284 ringptr->skb->data = (u_char *) skb_put(ringptr->skb, MAX_ETHER_SIZE); 1284 ringptr->skb->data = skb_put(ringptr->skb, MAX_ETHER_SIZE);
1285 1285
1286 /* ringptr->pdl points to the beginning of the PDL, i.e. the PDH */ 1286 /* ringptr->pdl points to the beginning of the PDL, i.e. the PDH */
1287 /* Note: 1st Fragment is used for the 4 byte packet status 1287 /* Note: 1st Fragment is used for the 4 byte packet status
diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
index b077ef8b00fa..2d1253c5b7a1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
@@ -762,7 +762,7 @@ int i40e_fcoe_handle_offload(struct i40e_ring *rx_ring,
762 (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA)) { 762 (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA)) {
763 struct fcoe_crc_eof *crc = NULL; 763 struct fcoe_crc_eof *crc = NULL;
764 764
765 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); 765 crc = skb_put(skb, sizeof(*crc));
766 crc->fcoe_eof = FC_EOF_T; 766 crc->fcoe_eof = FC_EOF_T;
767 } else { 767 } else {
768 /* otherwise, drop the header only frame */ 768 /* otherwise, drop the header only frame */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 2a653ec954f5..a23c2b5411a0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -491,7 +491,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
491 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && 491 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
492 (fctl & FC_FC_END_SEQ)) { 492 (fctl & FC_FC_END_SEQ)) {
493 skb_linearize(skb); 493 skb_linearize(skb);
494 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); 494 crc = skb_put(skb, sizeof(*crc));
495 crc->fcoe_eof = FC_EOF_T; 495 crc->fcoe_eof = FC_EOF_T;
496 } 496 }
497 497
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
index 17112faafbcc..88699b181946 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
@@ -63,8 +63,8 @@ static int mlx4_en_test_loopback_xmit(struct mlx4_en_priv *priv)
63 63
64 skb_reserve(skb, NET_IP_ALIGN); 64 skb_reserve(skb, NET_IP_ALIGN);
65 65
66 ethh = (struct ethhdr *)skb_put(skb, sizeof(struct ethhdr)); 66 ethh = skb_put(skb, sizeof(struct ethhdr));
67 packet = (unsigned char *)skb_put(skb, packet_size); 67 packet = skb_put(skb, packet_size);
68 memcpy(ethh->h_dest, priv->dev->dev_addr, ETH_ALEN); 68 memcpy(ethh->h_dest, priv->dev->dev_addr, ETH_ALEN);
69 eth_zero_addr(ethh->h_source); 69 eth_zero_addr(ethh->h_source);
70 ethh->h_proto = htons(ETH_P_ARP); 70 ethh->h_proto = htons(ETH_P_ARP);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
index 601abf240d63..c456ca07b562 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
@@ -136,10 +136,10 @@ static struct sk_buff *mlx5e_test_get_udp_skb(struct mlx5e_priv *priv)
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);
139 iph = (struct iphdr *)skb_put(skb, sizeof(struct iphdr)); 139 iph = skb_put(skb, sizeof(struct iphdr));
140 140
141 skb_set_transport_header(skb, skb->len); 141 skb_set_transport_header(skb, skb->len);
142 udph = (struct udphdr *)skb_put(skb, sizeof(struct udphdr)); 142 udph = skb_put(skb, sizeof(struct udphdr));
143 143
144 /* Fill ETH header */ 144 /* Fill ETH header */
145 ether_addr_copy(ethh->h_dest, priv->netdev->dev_addr); 145 ether_addr_copy(ethh->h_dest, priv->netdev->dev_addr);
@@ -167,7 +167,7 @@ static struct sk_buff *mlx5e_test_get_udp_skb(struct mlx5e_priv *priv)
167 ip_send_check(iph); 167 ip_send_check(iph);
168 168
169 /* Fill test header and data */ 169 /* Fill test header and data */
170 mlxh = (struct mlx5ehdr *)skb_put(skb, sizeof(*mlxh)); 170 mlxh = skb_put(skb, sizeof(*mlxh));
171 mlxh->version = 0; 171 mlxh->version = 0;
172 mlxh->magic = cpu_to_be64(MLX5E_TEST_MAGIC); 172 mlxh->magic = cpu_to_be64(MLX5E_TEST_MAGIC);
173 strlcpy(mlxh->text, mlx5e_test_text, sizeof(mlxh->text)); 173 strlcpy(mlxh->text, mlx5e_test_text, sizeof(mlxh->text));
diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index cb0102dd7f70..e3d7c74d47bb 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -669,7 +669,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
669 ks8842_update_rx_counters(netdev, status, len); 669 ks8842_update_rx_counters(netdev, status, len);
670 670
671 if (adapter->conf_flags & KS884X_16BIT) { 671 if (adapter->conf_flags & KS884X_16BIT) {
672 u16 *data16 = (u16 *)skb_put(skb, len); 672 u16 *data16 = skb_put(skb, len);
673 ks8842_select_bank(adapter, 17); 673 ks8842_select_bank(adapter, 17);
674 while (len > 0) { 674 while (len > 0) {
675 *data16++ = ioread16(adapter->hw_addr + 675 *data16++ = ioread16(adapter->hw_addr +
@@ -679,7 +679,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
679 len -= sizeof(u32); 679 len -= sizeof(u32);
680 } 680 }
681 } else { 681 } else {
682 u32 *data = (u32 *)skb_put(skb, len); 682 u32 *data = skb_put(skb, len);
683 683
684 ks8842_select_bank(adapter, 17); 684 ks8842_select_bank(adapter, 17);
685 while (len > 0) { 685 while (len > 0) {
diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c
index 92bc34c91547..55c0fbbc4fb8 100644
--- a/drivers/net/ethernet/sfc/falcon/selftest.c
+++ b/drivers/net/ethernet/sfc/falcon/selftest.c
@@ -431,8 +431,7 @@ static int ef4_begin_loopback(struct ef4_tx_queue *tx_queue)
431 431
432 /* Copy the payload in, incrementing the source address to 432 /* Copy the payload in, incrementing the source address to
433 * exercise the rss vectors */ 433 * exercise the rss vectors */
434 payload = ((struct ef4_loopback_payload *) 434 payload = skb_put(skb, sizeof(state->payload));
435 skb_put(skb, sizeof(state->payload)));
436 memcpy(payload, &state->payload, sizeof(state->payload)); 435 memcpy(payload, &state->payload, sizeof(state->payload));
437 payload->ip.saddr = htonl(INADDR_LOOPBACK | (i << 2)); 436 payload->ip.saddr = htonl(INADDR_LOOPBACK | (i << 2));
438 437
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index dab286a337a6..f6936949fc85 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -431,8 +431,7 @@ static int efx_begin_loopback(struct efx_tx_queue *tx_queue)
431 431
432 /* Copy the payload in, incrementing the source address to 432 /* Copy the payload in, incrementing the source address to
433 * exercise the rss vectors */ 433 * exercise the rss vectors */
434 payload = ((struct efx_loopback_payload *) 434 payload = skb_put(skb, sizeof(state->payload));
435 skb_put(skb, sizeof(state->payload)));
436 memcpy(payload, &state->payload, sizeof(state->payload)); 435 memcpy(payload, &state->payload, sizeof(state->payload));
437 payload->ip.saddr = htonl(INADDR_LOOPBACK | (i << 2)); 436 payload->ip.saddr = htonl(INADDR_LOOPBACK | (i << 2));
438 437
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 6754cd01c605..140a209f22ab 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -540,7 +540,7 @@ static inline void scc_rxint(struct scc_channel *scc)
540 } 540 }
541 541
542 scc->rx_buff = skb; 542 scc->rx_buff = skb;
543 *(skb_put(skb, 1)) = 0; /* KISS data */ 543 *(u8 *)skb_put(skb, 1) = 0; /* KISS data */
544 } 544 }
545 545
546 if (skb->len >= scc->stat.bufsize) 546 if (skb->len >= scc->stat.bufsize)
@@ -555,7 +555,7 @@ static inline void scc_rxint(struct scc_channel *scc)
555 return; 555 return;
556 } 556 }
557 557
558 *(skb_put(skb, 1)) = Inb(scc->data); 558 *(u8 *)skb_put(skb, 1) = Inb(scc->data);
559} 559}
560 560
561 561
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index d7e405268983..4e1da1645b15 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -877,7 +877,7 @@ static int pppoe_sendmsg(struct socket *sock, struct msghdr *m,
877 skb->priority = sk->sk_priority; 877 skb->priority = sk->sk_priority;
878 skb->protocol = cpu_to_be16(ETH_P_PPP_SES); 878 skb->protocol = cpu_to_be16(ETH_P_PPP_SES);
879 879
880 ph = (struct pppoe_hdr *)skb_put(skb, total_len + sizeof(struct pppoe_hdr)); 880 ph = skb_put(skb, total_len + sizeof(struct pppoe_hdr));
881 start = (char *)&ph->tag[0]; 881 start = (char *)&ph->tag[0];
882 882
883 error = memcpy_from_msg(start, m, total_len); 883 error = memcpy_from_msg(start, m, total_len);
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 8a4c8a1b9dd3..4d4837a0645b 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1250,7 +1250,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign)
1250 skb_put_zero(skb_out, padding_count); 1250 skb_put_zero(skb_out, padding_count);
1251 } else if (skb_out->len < ctx->tx_max && 1251 } else if (skb_out->len < ctx->tx_max &&
1252 (skb_out->len % dev->maxpacket) == 0) { 1252 (skb_out->len % dev->maxpacket) == 0) {
1253 *skb_put(skb_out, 1) = 0; /* force short packet */ 1253 *(u8 *)skb_put(skb_out, 1) = 0; /* force short packet */
1254 } 1254 }
1255 1255
1256 /* set final frame length */ 1256 /* set final frame length */
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index 3202c19df83d..861ff45f0b09 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -473,8 +473,8 @@ encapsulate:
473 473
474 /* maybe pad; then trailer */ 474 /* maybe pad; then trailer */
475 if (!((skb->len + sizeof *trailer) & 0x01)) 475 if (!((skb->len + sizeof *trailer) & 0x01))
476 *skb_put(skb, 1) = PAD_BYTE; 476 *(u8 *)skb_put(skb, 1) = PAD_BYTE;
477 trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); 477 trailer = skb_put(skb, sizeof *trailer);
478 put_unaligned(header->packet_id, &trailer->packet_id); 478 put_unaligned(header->packet_id, &trailer->packet_id);
479#if 0 479#if 0
480 netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n", 480 netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n",
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
index 6aaa6eb9df72..dc3cd03763af 100644
--- a/drivers/net/usb/zaurus.c
+++ b/drivers/net/usb/zaurus.c
@@ -74,10 +74,10 @@ done:
74 fcs = crc32_le(~0, skb->data, skb->len); 74 fcs = crc32_le(~0, skb->data, skb->len);
75 fcs = ~fcs; 75 fcs = ~fcs;
76 76
77 *skb_put (skb, 1) = fcs & 0xff; 77 *(u8 *)skb_put(skb, 1) = fcs & 0xff;
78 *skb_put (skb, 1) = (fcs>> 8) & 0xff; 78 *(u8 *)skb_put(skb, 1) = (fcs>> 8) & 0xff;
79 *skb_put (skb, 1) = (fcs>>16) & 0xff; 79 *(u8 *)skb_put(skb, 1) = (fcs>>16) & 0xff;
80 *skb_put (skb, 1) = (fcs>>24) & 0xff; 80 *(u8 *)skb_put(skb, 1) = (fcs>>24) & 0xff;
81 } 81 }
82 return skb; 82 return skb;
83} 83}
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index f5b4ad45831a..fa3460a0dbbe 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -228,7 +228,7 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code,
228 } 228 }
229 skb_reserve(skb, sizeof(struct hdlc_header)); 229 skb_reserve(skb, sizeof(struct hdlc_header));
230 230
231 cp = (struct cp_header *)skb_put(skb, sizeof(struct cp_header)); 231 cp = skb_put(skb, sizeof(struct cp_header));
232 cp->code = code; 232 cp->code = code;
233 cp->id = id; 233 cp->id = id;
234 cp->len = htons(sizeof(struct cp_header) + magic_len + len); 234 cp->len = htons(sizeof(struct cp_header) + magic_len + len);
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index e2b7809d7886..1eea6c23976f 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -348,7 +348,7 @@ void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len)
348 if (!skb) 348 if (!skb)
349 return; 349 return;
350 350
351 slot = (struct ath6kl_fwlog_slot *) skb_put(skb, slot_len); 351 slot = skb_put(skb, slot_len);
352 slot->timestamp = cpu_to_le32(jiffies); 352 slot->timestamp = cpu_to_le32(jiffies);
353 slot->length = cpu_to_le32(len); 353 slot->length = cpu_to_le32(len);
354 memcpy(slot->payload, buf, len); 354 memcpy(slot->payload, buf, len);
diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index d127a08d60df..b13d61111072 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -1274,8 +1274,7 @@ static int ath6kl_htc_pipe_conn_service(struct htc_target *target,
1274 length = sizeof(struct htc_conn_service_msg); 1274 length = sizeof(struct htc_conn_service_msg);
1275 1275
1276 /* assemble connect service message */ 1276 /* assemble connect service message */
1277 conn_msg = (struct htc_conn_service_msg *) skb_put(skb, 1277 conn_msg = skb_put(skb, length);
1278 length);
1279 if (conn_msg == NULL) { 1278 if (conn_msg == NULL) {
1280 WARN_ON_ONCE(1); 1279 WARN_ON_ONCE(1);
1281 status = -EINVAL; 1280 status = -EINVAL;
@@ -1504,8 +1503,7 @@ static int ath6kl_htc_pipe_start(struct htc_target *target)
1504 skb = packet->skb; 1503 skb = packet->skb;
1505 1504
1506 /* assemble setup complete message */ 1505 /* assemble setup complete message */
1507 setup = (struct htc_setup_comp_ext_msg *) skb_put(skb, 1506 setup = skb_put(skb, sizeof(*setup));
1508 sizeof(*setup));
1509 memset(setup, 0, sizeof(struct htc_setup_comp_ext_msg)); 1507 memset(setup, 0, sizeof(struct htc_setup_comp_ext_msg));
1510 setup->msg_id = cpu_to_le16(HTC_MSG_SETUP_COMPLETE_EX_ID); 1508 setup->msg_id = cpu_to_le16(HTC_MSG_SETUP_COMPLETE_EX_ID);
1511 1509
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 8e6dae23669b..9fa8970a1f7d 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -156,8 +156,7 @@ static int htc_config_pipe_credits(struct htc_target *target)
156 } 156 }
157 skb_reserve(skb, sizeof(struct htc_frame_hdr)); 157 skb_reserve(skb, sizeof(struct htc_frame_hdr));
158 158
159 cp_msg = (struct htc_config_pipe_msg *) 159 cp_msg = skb_put(skb, sizeof(struct htc_config_pipe_msg));
160 skb_put(skb, sizeof(struct htc_config_pipe_msg));
161 160
162 cp_msg->message_id = cpu_to_be16(HTC_MSG_CONFIG_PIPE_ID); 161 cp_msg->message_id = cpu_to_be16(HTC_MSG_CONFIG_PIPE_ID);
163 cp_msg->pipe_id = USB_WLAN_TX_PIPE; 162 cp_msg->pipe_id = USB_WLAN_TX_PIPE;
@@ -195,8 +194,7 @@ static int htc_setup_complete(struct htc_target *target)
195 } 194 }
196 skb_reserve(skb, sizeof(struct htc_frame_hdr)); 195 skb_reserve(skb, sizeof(struct htc_frame_hdr));
197 196
198 comp_msg = (struct htc_comp_msg *) 197 comp_msg = skb_put(skb, sizeof(struct htc_comp_msg));
199 skb_put(skb, sizeof(struct htc_comp_msg));
200 comp_msg->msg_id = cpu_to_be16(HTC_MSG_SETUP_COMPLETE_ID); 198 comp_msg->msg_id = cpu_to_be16(HTC_MSG_SETUP_COMPLETE_ID);
201 199
202 target->htc_flags |= HTC_OP_START_WAIT; 200 target->htc_flags |= HTC_OP_START_WAIT;
@@ -265,8 +263,7 @@ int htc_connect_service(struct htc_target *target,
265 263
266 skb_reserve(skb, sizeof(struct htc_frame_hdr)); 264 skb_reserve(skb, sizeof(struct htc_frame_hdr));
267 265
268 conn_msg = (struct htc_conn_svc_msg *) 266 conn_msg = skb_put(skb, sizeof(struct htc_conn_svc_msg));
269 skb_put(skb, sizeof(struct htc_conn_svc_msg));
270 conn_msg->service_id = cpu_to_be16(service_connreq->service_id); 267 conn_msg->service_id = cpu_to_be16(service_connreq->service_id);
271 conn_msg->msg_id = cpu_to_be16(HTC_MSG_CONNECT_SERVICE_ID); 268 conn_msg->msg_id = cpu_to_be16(HTC_MSG_CONNECT_SERVICE_ID);
272 conn_msg->con_flags = cpu_to_be16(service_connreq->con_flags); 269 conn_msg->con_flags = cpu_to_be16(service_connreq->con_flags);
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index cff9c585972f..0a5020f31de1 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -677,7 +677,7 @@ static void wmi_evt_eapol_rx(struct wil6210_priv *wil, int id,
677 return; 677 return;
678 } 678 }
679 679
680 eth = (struct ethhdr *)skb_put(skb, ETH_HLEN); 680 eth = skb_put(skb, ETH_HLEN);
681 ether_addr_copy(eth->h_dest, ndev->dev_addr); 681 ether_addr_copy(eth->h_dest, ndev->dev_addr);
682 ether_addr_copy(eth->h_source, evt->src_mac); 682 ether_addr_copy(eth->h_source, evt->src_mac);
683 eth->h_proto = cpu_to_be16(ETH_P_PAE); 683 eth->h_proto = cpu_to_be16(ETH_P_PAE);
diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c
index 1b7e125a28e2..4623155ec36e 100644
--- a/drivers/net/wireless/cisco/airo.c
+++ b/drivers/net/wireless/cisco/airo.c
@@ -3330,7 +3330,7 @@ static void airo_handle_rx(struct airo_info *ai)
3330 } 3330 }
3331 3331
3332 skb_reserve(skb, 2); /* This way the IP header is aligned */ 3332 skb_reserve(skb, 2); /* This way the IP header is aligned */
3333 buffer = (__le16 *) skb_put(skb, len + hdrlen); 3333 buffer = skb_put(skb, len + hdrlen);
3334 if (test_bit(FLAG_802_11, &ai->flags)) { 3334 if (test_bit(FLAG_802_11, &ai->flags)) {
3335 buffer[0] = fc; 3335 buffer[0] = fc;
3336 bap_read(ai, buffer + 1, hdrlen - 2, BAP0); 3336 bap_read(ai, buffer + 1, hdrlen - 2, BAP0);
@@ -3734,7 +3734,7 @@ static void mpi_receive_802_11(struct airo_info *ai)
3734 ai->dev->stats.rx_dropped++; 3734 ai->dev->stats.rx_dropped++;
3735 goto badrx; 3735 goto badrx;
3736 } 3736 }
3737 buffer = (u16*)skb_put (skb, len + hdrlen); 3737 buffer = skb_put(skb, len + hdrlen);
3738 memcpy ((char *)buffer, ptr, hdrlen); 3738 memcpy ((char *)buffer, ptr, hdrlen);
3739 ptr += hdrlen; 3739 ptr += hdrlen;
3740 if (hdrlen == 24) 3740 if (hdrlen == 24)
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index e0c690b48d4e..5e4ce4abd62e 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -10371,7 +10371,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10371 if (!dst) 10371 if (!dst)
10372 continue; 10372 continue;
10373 10373
10374 rt_hdr = (void *)skb_put(dst, sizeof(*rt_hdr)); 10374 rt_hdr = skb_put(dst, sizeof(*rt_hdr));
10375 10375
10376 rt_hdr->it_version = PKTHDR_RADIOTAP_VERSION; 10376 rt_hdr->it_version = PKTHDR_RADIOTAP_VERSION;
10377 rt_hdr->it_pad = 0; 10377 rt_hdr->it_pad = 0;
diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
index 5339d1eeb2f7..84205aa508df 100644
--- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
@@ -439,8 +439,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
439 439
440 if (rts_required) { 440 if (rts_required) {
441 skb_frag = txb->fragments[0]; 441 skb_frag = txb->fragments[0];
442 frag_hdr = 442 frag_hdr = skb_put(skb_frag, hdr_len);
443 (struct libipw_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
444 443
445 /* 444 /*
446 * Set header frame_ctl to the RTS. 445 * Set header frame_ctl to the RTS.
diff --git a/drivers/net/wireless/intersil/hostap/hostap_ap.c b/drivers/net/wireless/intersil/hostap/hostap_ap.c
index 91757defb9be..eb9cd6fa9c4d 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_ap.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_ap.c
@@ -2361,7 +2361,7 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2361 return; 2361 return;
2362 } 2362 }
2363 2363
2364 hdr = (struct ieee80211_hdr *) skb_put(skb, 16); 2364 hdr = skb_put(skb, 16);
2365 2365
2366 /* Generate a fake pspoll frame to start packet delivery */ 2366 /* Generate a fake pspoll frame to start packet delivery */
2367 hdr->frame_control = cpu_to_le16( 2367 hdr->frame_control = cpu_to_le16(
diff --git a/drivers/net/wireless/intersil/p54/fwio.c b/drivers/net/wireless/intersil/p54/fwio.c
index 3076f646c829..52c095c7765f 100644
--- a/drivers/net/wireless/intersil/p54/fwio.c
+++ b/drivers/net/wireless/intersil/p54/fwio.c
@@ -206,7 +206,7 @@ static struct sk_buff *p54_alloc_skb(struct p54_common *priv, u16 hdr_flags,
206 return NULL; 206 return NULL;
207 skb_reserve(skb, priv->tx_hdr_len); 207 skb_reserve(skb, priv->tx_hdr_len);
208 208
209 hdr = (struct p54_hdr *) skb_put(skb, sizeof(*hdr)); 209 hdr = skb_put(skb, sizeof(*hdr));
210 hdr->flags = cpu_to_le16(hdr_flags); 210 hdr->flags = cpu_to_le16(hdr_flags);
211 hdr->len = cpu_to_le16(payload_len); 211 hdr->len = cpu_to_le16(payload_len);
212 hdr->type = cpu_to_le16(type); 212 hdr->type = cpu_to_le16(type);
@@ -236,8 +236,7 @@ int p54_download_eeprom(struct p54_common *priv, void *buf,
236 236
237 mutex_lock(&priv->eeprom_mutex); 237 mutex_lock(&priv->eeprom_mutex);
238 priv->eeprom = buf; 238 priv->eeprom = buf;
239 eeprom_hdr = (struct p54_eeprom_lm86 *) skb_put(skb, 239 eeprom_hdr = skb_put(skb, eeprom_hdr_size + len);
240 eeprom_hdr_size + len);
241 240
242 if (priv->fw_var < 0x509) { 241 if (priv->fw_var < 0x509) {
243 eeprom_hdr->v1.offset = cpu_to_le16(offset); 242 eeprom_hdr->v1.offset = cpu_to_le16(offset);
@@ -273,7 +272,7 @@ int p54_update_beacon_tim(struct p54_common *priv, u16 aid, bool set)
273 if (unlikely(!skb)) 272 if (unlikely(!skb))
274 return -ENOMEM; 273 return -ENOMEM;
275 274
276 tim = (struct p54_tim *) skb_put(skb, sizeof(*tim)); 275 tim = skb_put(skb, sizeof(*tim));
277 tim->count = 1; 276 tim->count = 1;
278 tim->entry[0] = cpu_to_le16(set ? (aid | 0x8000) : aid); 277 tim->entry[0] = cpu_to_le16(set ? (aid | 0x8000) : aid);
279 p54_tx(priv, skb); 278 p54_tx(priv, skb);
@@ -290,7 +289,7 @@ int p54_sta_unlock(struct p54_common *priv, u8 *addr)
290 if (unlikely(!skb)) 289 if (unlikely(!skb))
291 return -ENOMEM; 290 return -ENOMEM;
292 291
293 sta = (struct p54_sta_unlock *)skb_put(skb, sizeof(*sta)); 292 sta = skb_put(skb, sizeof(*sta));
294 memcpy(sta->addr, addr, ETH_ALEN); 293 memcpy(sta->addr, addr, ETH_ALEN);
295 p54_tx(priv, skb); 294 p54_tx(priv, skb);
296 return 0; 295 return 0;
@@ -310,7 +309,7 @@ int p54_tx_cancel(struct p54_common *priv, __le32 req_id)
310 if (unlikely(!skb)) 309 if (unlikely(!skb))
311 return -ENOMEM; 310 return -ENOMEM;
312 311
313 cancel = (struct p54_txcancel *)skb_put(skb, sizeof(*cancel)); 312 cancel = skb_put(skb, sizeof(*cancel));
314 cancel->req_id = req_id; 313 cancel->req_id = req_id;
315 p54_tx(priv, skb); 314 p54_tx(priv, skb);
316 return 0; 315 return 0;
@@ -327,7 +326,7 @@ int p54_setup_mac(struct p54_common *priv)
327 if (!skb) 326 if (!skb)
328 return -ENOMEM; 327 return -ENOMEM;
329 328
330 setup = (struct p54_setup_mac *) skb_put(skb, sizeof(*setup)); 329 setup = skb_put(skb, sizeof(*setup));
331 if (!(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) { 330 if (!(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) {
332 switch (priv->mode) { 331 switch (priv->mode) {
333 case NL80211_IFTYPE_STATION: 332 case NL80211_IFTYPE_STATION:
@@ -413,18 +412,18 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
413 if (!skb) 412 if (!skb)
414 return -ENOMEM; 413 return -ENOMEM;
415 414
416 head = (struct p54_scan_head *) skb_put(skb, sizeof(*head)); 415 head = skb_put(skb, sizeof(*head));
417 memset(head->scan_params, 0, sizeof(head->scan_params)); 416 memset(head->scan_params, 0, sizeof(head->scan_params));
418 head->mode = cpu_to_le16(mode); 417 head->mode = cpu_to_le16(mode);
419 head->dwell = cpu_to_le16(dwell); 418 head->dwell = cpu_to_le16(dwell);
420 head->freq = freq; 419 head->freq = freq;
421 420
422 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { 421 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) {
423 __le16 *pa_power_points = (__le16 *) skb_put(skb, 2); 422 __le16 *pa_power_points = skb_put(skb, 2);
424 *pa_power_points = cpu_to_le16(0x0c); 423 *pa_power_points = cpu_to_le16(0x0c);
425 } 424 }
426 425
427 iq_autocal = (void *) skb_put(skb, sizeof(*iq_autocal)); 426 iq_autocal = skb_put(skb, sizeof(*iq_autocal));
428 for (i = 0; i < priv->iq_autocal_len; i++) { 427 for (i = 0; i < priv->iq_autocal_len; i++) {
429 if (priv->iq_autocal[i].freq != freq) 428 if (priv->iq_autocal[i].freq != freq)
430 continue; 429 continue;
@@ -437,9 +436,9 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
437 goto err; 436 goto err;
438 437
439 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) 438 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW)
440 body = (void *) skb_put(skb, sizeof(body->longbow)); 439 body = skb_put(skb, sizeof(body->longbow));
441 else 440 else
442 body = (void *) skb_put(skb, sizeof(body->normal)); 441 body = skb_put(skb, sizeof(body->normal));
443 442
444 for (i = 0; i < priv->output_limit->entries; i++) { 443 for (i = 0; i < priv->output_limit->entries; i++) {
445 __le16 *entry_freq = (void *) (priv->output_limit->data + 444 __le16 *entry_freq = (void *) (priv->output_limit->data +
@@ -500,25 +499,25 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
500 goto err; 499 goto err;
501 500
502 if ((priv->fw_var >= 0x500) && (priv->fw_var < 0x509)) { 501 if ((priv->fw_var >= 0x500) && (priv->fw_var < 0x509)) {
503 rate = (void *) skb_put(skb, sizeof(*rate)); 502 rate = skb_put(skb, sizeof(*rate));
504 rate->basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); 503 rate->basic_rate_mask = cpu_to_le32(priv->basic_rate_mask);
505 for (i = 0; i < sizeof(rate->rts_rates); i++) 504 for (i = 0; i < sizeof(rate->rts_rates); i++)
506 rate->rts_rates[i] = i; 505 rate->rts_rates[i] = i;
507 } 506 }
508 507
509 rssi = (struct pda_rssi_cal_entry *) skb_put(skb, sizeof(*rssi)); 508 rssi = skb_put(skb, sizeof(*rssi));
510 rssi_data = p54_rssi_find(priv, le16_to_cpu(freq)); 509 rssi_data = p54_rssi_find(priv, le16_to_cpu(freq));
511 rssi->mul = cpu_to_le16(rssi_data->mul); 510 rssi->mul = cpu_to_le16(rssi_data->mul);
512 rssi->add = cpu_to_le16(rssi_data->add); 511 rssi->add = cpu_to_le16(rssi_data->add);
513 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { 512 if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) {
514 /* Longbow frontend needs ever more */ 513 /* Longbow frontend needs ever more */
515 rssi = (void *) skb_put(skb, sizeof(*rssi)); 514 rssi = skb_put(skb, sizeof(*rssi));
516 rssi->mul = cpu_to_le16(rssi_data->longbow_unkn); 515 rssi->mul = cpu_to_le16(rssi_data->longbow_unkn);
517 rssi->add = cpu_to_le16(rssi_data->longbow_unk2); 516 rssi->add = cpu_to_le16(rssi_data->longbow_unk2);
518 } 517 }
519 518
520 if (priv->fw_var >= 0x509) { 519 if (priv->fw_var >= 0x509) {
521 rate = (void *) skb_put(skb, sizeof(*rate)); 520 rate = skb_put(skb, sizeof(*rate));
522 rate->basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); 521 rate->basic_rate_mask = cpu_to_le32(priv->basic_rate_mask);
523 for (i = 0; i < sizeof(rate->rts_rates); i++) 522 for (i = 0; i < sizeof(rate->rts_rates); i++)
524 rate->rts_rates[i] = i; 523 rate->rts_rates[i] = i;
@@ -550,7 +549,7 @@ int p54_set_leds(struct p54_common *priv)
550 if (unlikely(!skb)) 549 if (unlikely(!skb))
551 return -ENOMEM; 550 return -ENOMEM;
552 551
553 led = (struct p54_led *) skb_put(skb, sizeof(*led)); 552 led = skb_put(skb, sizeof(*led));
554 led->flags = cpu_to_le16(0x0003); 553 led->flags = cpu_to_le16(0x0003);
555 led->mask[0] = led->mask[1] = cpu_to_le16(priv->softled_state); 554 led->mask[0] = led->mask[1] = cpu_to_le16(priv->softled_state);
556 led->delay[0] = cpu_to_le16(1); 555 led->delay[0] = cpu_to_le16(1);
@@ -570,7 +569,7 @@ int p54_set_edcf(struct p54_common *priv)
570 if (unlikely(!skb)) 569 if (unlikely(!skb))
571 return -ENOMEM; 570 return -ENOMEM;
572 571
573 edcf = (struct p54_edcf *)skb_put(skb, sizeof(*edcf)); 572 edcf = skb_put(skb, sizeof(*edcf));
574 if (priv->use_short_slot) { 573 if (priv->use_short_slot) {
575 edcf->slottime = 9; 574 edcf->slottime = 9;
576 edcf->sifs = 0x10; 575 edcf->sifs = 0x10;
@@ -615,7 +614,7 @@ int p54_set_ps(struct p54_common *priv)
615 if (!skb) 614 if (!skb)
616 return -ENOMEM; 615 return -ENOMEM;
617 616
618 psm = (struct p54_psm *)skb_put(skb, sizeof(*psm)); 617 psm = skb_put(skb, sizeof(*psm));
619 psm->mode = cpu_to_le16(mode); 618 psm->mode = cpu_to_le16(mode);
620 psm->aid = cpu_to_le16(priv->aid); 619 psm->aid = cpu_to_le16(priv->aid);
621 for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) { 620 for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) {
@@ -644,7 +643,7 @@ int p54_init_xbow_synth(struct p54_common *priv)
644 if (unlikely(!skb)) 643 if (unlikely(!skb))
645 return -ENOMEM; 644 return -ENOMEM;
646 645
647 xbow = (struct p54_xbow_synth *)skb_put(skb, sizeof(*xbow)); 646 xbow = skb_put(skb, sizeof(*xbow));
648 xbow->magic1 = cpu_to_le16(0x1); 647 xbow->magic1 = cpu_to_le16(0x1);
649 xbow->magic2 = cpu_to_le16(0x2); 648 xbow->magic2 = cpu_to_le16(0x2);
650 xbow->freq = cpu_to_le16(5390); 649 xbow->freq = cpu_to_le16(5390);
@@ -664,7 +663,7 @@ int p54_upload_key(struct p54_common *priv, u8 algo, int slot, u8 idx, u8 len,
664 if (unlikely(!skb)) 663 if (unlikely(!skb))
665 return -ENOMEM; 664 return -ENOMEM;
666 665
667 rxkey = (struct p54_keycache *)skb_put(skb, sizeof(*rxkey)); 666 rxkey = skb_put(skb, sizeof(*rxkey));
668 rxkey->entry = slot; 667 rxkey->entry = slot;
669 rxkey->key_id = idx; 668 rxkey->key_id = idx;
670 rxkey->key_type = algo; 669 rxkey->key_type = algo;
@@ -744,7 +743,7 @@ int p54_set_groupfilter(struct p54_common *priv)
744 if (!skb) 743 if (!skb)
745 return -ENOMEM; 744 return -ENOMEM;
746 745
747 grp = (struct p54_group_address_table *)skb_put(skb, sizeof(*grp)); 746 grp = skb_put(skb, sizeof(*grp));
748 747
749 on = !(priv->filter_flags & FIF_ALLMULTI) && 748 on = !(priv->filter_flags & FIF_ALLMULTI) &&
750 (priv->mc_maclist_num > 0 && 749 (priv->mc_maclist_num > 0 &&
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 1d6e180052b8..7418088e296f 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -650,7 +650,7 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
650 skb = dev_alloc_skb(sizeof(*pspoll)); 650 skb = dev_alloc_skb(sizeof(*pspoll));
651 if (!skb) 651 if (!skb)
652 return; 652 return;
653 pspoll = (void *) skb_put(skb, sizeof(*pspoll)); 653 pspoll = skb_put(skb, sizeof(*pspoll));
654 pspoll->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | 654 pspoll->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
655 IEEE80211_STYPE_PSPOLL | 655 IEEE80211_STYPE_PSPOLL |
656 IEEE80211_FCTL_PM); 656 IEEE80211_FCTL_PM);
@@ -681,7 +681,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
681 skb = dev_alloc_skb(sizeof(*hdr)); 681 skb = dev_alloc_skb(sizeof(*hdr));
682 if (!skb) 682 if (!skb)
683 return; 683 return;
684 hdr = (void *) skb_put(skb, sizeof(*hdr) - ETH_ALEN); 684 hdr = skb_put(skb, sizeof(*hdr) - ETH_ALEN);
685 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA | 685 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
686 IEEE80211_STYPE_NULLFUNC | 686 IEEE80211_STYPE_NULLFUNC |
687 (ps ? IEEE80211_FCTL_PM : 0)); 687 (ps ? IEEE80211_FCTL_PM : 0));
@@ -892,7 +892,7 @@ static void mac80211_hwsim_monitor_ack(struct ieee80211_channel *chan,
892 if (skb == NULL) 892 if (skb == NULL)
893 return; 893 return;
894 894
895 hdr = (struct hwsim_radiotap_ack_hdr *) skb_put(skb, sizeof(*hdr)); 895 hdr = skb_put(skb, sizeof(*hdr));
896 hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION; 896 hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION;
897 hdr->hdr.it_pad = 0; 897 hdr->hdr.it_pad = 0;
898 hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr)); 898 hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr));
@@ -904,7 +904,7 @@ static void mac80211_hwsim_monitor_ack(struct ieee80211_channel *chan,
904 flags = IEEE80211_CHAN_2GHZ; 904 flags = IEEE80211_CHAN_2GHZ;
905 hdr->rt_chbitmask = cpu_to_le16(flags); 905 hdr->rt_chbitmask = cpu_to_le16(flags);
906 906
907 hdr11 = (struct ieee80211_hdr *) skb_put(skb, 10); 907 hdr11 = skb_put(skb, 10);
908 hdr11->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | 908 hdr11->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
909 IEEE80211_STYPE_ACK); 909 IEEE80211_STYPE_ACK);
910 hdr11->duration_id = cpu_to_le16(0); 910 hdr11->duration_id = cpu_to_le16(0);
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
index bc12c37e7501..042a1d07f686 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
@@ -62,7 +62,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
62 }; 62 };
63 struct tx_packet_hdr *tx_header; 63 struct tx_packet_hdr *tx_header;
64 64
65 tx_header = (void *)skb_put(skb_aggr, sizeof(*tx_header)); 65 tx_header = skb_put(skb_aggr, sizeof(*tx_header));
66 66
67 /* Copy DA and SA */ 67 /* Copy DA and SA */
68 dt_offset = 2 * ETH_ALEN; 68 dt_offset = 2 * ETH_ALEN;
diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c
index d38555fe4284..39cd677d4159 100644
--- a/drivers/net/wireless/marvell/mwifiex/tdls.c
+++ b/drivers/net/wireless/marvell/mwifiex/tdls.c
@@ -158,7 +158,7 @@ static void mwifiex_tdls_add_aid(struct mwifiex_private *priv,
158 u8 *pos; 158 u8 *pos;
159 159
160 assoc_rsp = (struct ieee_types_assoc_rsp *)&priv->assoc_rsp_buf; 160 assoc_rsp = (struct ieee_types_assoc_rsp *)&priv->assoc_rsp_buf;
161 pos = (void *)skb_put(skb, 4); 161 pos = skb_put(skb, 4);
162 *pos++ = WLAN_EID_AID; 162 *pos++ = WLAN_EID_AID;
163 *pos++ = 2; 163 *pos++ = 2;
164 memcpy(pos, &assoc_rsp->a_id, sizeof(assoc_rsp->a_id)); 164 memcpy(pos, &assoc_rsp->a_id, sizeof(assoc_rsp->a_id));
@@ -172,7 +172,7 @@ static int mwifiex_tdls_add_vht_capab(struct mwifiex_private *priv,
172 struct ieee80211_vht_cap vht_cap; 172 struct ieee80211_vht_cap vht_cap;
173 u8 *pos; 173 u8 *pos;
174 174
175 pos = (void *)skb_put(skb, sizeof(struct ieee80211_vht_cap) + 2); 175 pos = skb_put(skb, sizeof(struct ieee80211_vht_cap) + 2);
176 *pos++ = WLAN_EID_VHT_CAPABILITY; 176 *pos++ = WLAN_EID_VHT_CAPABILITY;
177 *pos++ = sizeof(struct ieee80211_vht_cap); 177 *pos++ = sizeof(struct ieee80211_vht_cap);
178 178
@@ -207,7 +207,7 @@ mwifiex_tdls_add_ht_oper(struct mwifiex_private *priv, const u8 *mac,
207 return 0; 207 return 0;
208 } 208 }
209 209
210 pos = (void *)skb_put(skb, sizeof(struct ieee80211_ht_operation) + 2); 210 pos = skb_put(skb, sizeof(struct ieee80211_ht_operation) + 2);
211 *pos++ = WLAN_EID_HT_OPERATION; 211 *pos++ = WLAN_EID_HT_OPERATION;
212 *pos++ = sizeof(struct ieee80211_ht_operation); 212 *pos++ = sizeof(struct ieee80211_ht_operation);
213 ht_oper = (void *)pos; 213 ht_oper = (void *)pos;
@@ -272,7 +272,7 @@ static int mwifiex_tdls_add_vht_oper(struct mwifiex_private *priv,
272 ap_vht_cap = bss_desc->bcn_vht_cap; 272 ap_vht_cap = bss_desc->bcn_vht_cap;
273 } 273 }
274 274
275 pos = (void *)skb_put(skb, sizeof(struct ieee80211_vht_operation) + 2); 275 pos = skb_put(skb, sizeof(struct ieee80211_vht_operation) + 2);
276 *pos++ = WLAN_EID_VHT_OPERATION; 276 *pos++ = WLAN_EID_VHT_OPERATION;
277 *pos++ = sizeof(struct ieee80211_vht_operation); 277 *pos++ = sizeof(struct ieee80211_vht_operation);
278 vht_oper = (struct ieee80211_vht_operation *)pos; 278 vht_oper = (struct ieee80211_vht_operation *)pos;
@@ -359,7 +359,7 @@ static void mwifiex_tdls_add_ext_capab(struct mwifiex_private *priv,
359{ 359{
360 struct ieee_types_extcap *extcap; 360 struct ieee_types_extcap *extcap;
361 361
362 extcap = (void *)skb_put(skb, sizeof(struct ieee_types_extcap)); 362 extcap = skb_put(skb, sizeof(struct ieee_types_extcap));
363 extcap->ieee_hdr.element_id = WLAN_EID_EXT_CAPABILITY; 363 extcap->ieee_hdr.element_id = WLAN_EID_EXT_CAPABILITY;
364 extcap->ieee_hdr.len = 8; 364 extcap->ieee_hdr.len = 8;
365 memset(extcap->ext_capab, 0, 8); 365 memset(extcap->ext_capab, 0, 8);
@@ -372,7 +372,7 @@ static void mwifiex_tdls_add_ext_capab(struct mwifiex_private *priv,
372 372
373static void mwifiex_tdls_add_qos_capab(struct sk_buff *skb) 373static void mwifiex_tdls_add_qos_capab(struct sk_buff *skb)
374{ 374{
375 u8 *pos = (void *)skb_put(skb, 3); 375 u8 *pos = skb_put(skb, 3);
376 376
377 *pos++ = WLAN_EID_QOS_CAPA; 377 *pos++ = WLAN_EID_QOS_CAPA;
378 *pos++ = 1; 378 *pos++ = 1;
@@ -413,8 +413,8 @@ mwifiex_add_wmm_info_ie(struct mwifiex_private *priv, struct sk_buff *skb,
413{ 413{
414 u8 *buf; 414 u8 *buf;
415 415
416 buf = (void *)skb_put(skb, MWIFIEX_TDLS_WMM_INFO_SIZE + 416 buf = skb_put(skb,
417 sizeof(struct ieee_types_header)); 417 MWIFIEX_TDLS_WMM_INFO_SIZE + sizeof(struct ieee_types_header));
418 418
419 *buf++ = WLAN_EID_VENDOR_SPECIFIC; 419 *buf++ = WLAN_EID_VENDOR_SPECIFIC;
420 *buf++ = 7; /* len */ 420 *buf++ = 7; /* len */
@@ -431,7 +431,7 @@ static void mwifiex_tdls_add_bss_co_2040(struct sk_buff *skb)
431{ 431{
432 struct ieee_types_bss_co_2040 *bssco; 432 struct ieee_types_bss_co_2040 *bssco;
433 433
434 bssco = (void *)skb_put(skb, sizeof(struct ieee_types_bss_co_2040)); 434 bssco = skb_put(skb, sizeof(struct ieee_types_bss_co_2040));
435 bssco->ieee_hdr.element_id = WLAN_EID_BSS_COEX_2040; 435 bssco->ieee_hdr.element_id = WLAN_EID_BSS_COEX_2040;
436 bssco->ieee_hdr.len = sizeof(struct ieee_types_bss_co_2040) - 436 bssco->ieee_hdr.len = sizeof(struct ieee_types_bss_co_2040) -
437 sizeof(struct ieee_types_header); 437 sizeof(struct ieee_types_header);
@@ -443,8 +443,8 @@ static void mwifiex_tdls_add_supported_chan(struct sk_buff *skb)
443 struct ieee_types_generic *supp_chan; 443 struct ieee_types_generic *supp_chan;
444 u8 chan_supp[] = {1, 11}; 444 u8 chan_supp[] = {1, 11};
445 445
446 supp_chan = (void *)skb_put(skb, (sizeof(struct ieee_types_header) + 446 supp_chan = skb_put(skb,
447 sizeof(chan_supp))); 447 (sizeof(struct ieee_types_header) + sizeof(chan_supp)));
448 supp_chan->ieee_hdr.element_id = WLAN_EID_SUPPORTED_CHANNELS; 448 supp_chan->ieee_hdr.element_id = WLAN_EID_SUPPORTED_CHANNELS;
449 supp_chan->ieee_hdr.len = sizeof(chan_supp); 449 supp_chan->ieee_hdr.len = sizeof(chan_supp);
450 memcpy(supp_chan->data, chan_supp, sizeof(chan_supp)); 450 memcpy(supp_chan->data, chan_supp, sizeof(chan_supp));
@@ -455,8 +455,8 @@ static void mwifiex_tdls_add_oper_class(struct sk_buff *skb)
455 struct ieee_types_generic *reg_class; 455 struct ieee_types_generic *reg_class;
456 u8 rc_list[] = {1, 456 u8 rc_list[] = {1,
457 1, 2, 3, 4, 12, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33}; 457 1, 2, 3, 4, 12, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33};
458 reg_class = (void *)skb_put(skb, (sizeof(struct ieee_types_header) + 458 reg_class = skb_put(skb,
459 sizeof(rc_list))); 459 (sizeof(struct ieee_types_header) + sizeof(rc_list)));
460 reg_class->ieee_hdr.element_id = WLAN_EID_SUPPORTED_REGULATORY_CLASSES; 460 reg_class->ieee_hdr.element_id = WLAN_EID_SUPPORTED_REGULATORY_CLASSES;
461 reg_class->ieee_hdr.len = sizeof(rc_list); 461 reg_class->ieee_hdr.len = sizeof(rc_list);
462 memcpy(reg_class->data, rc_list, sizeof(rc_list)); 462 memcpy(reg_class->data, rc_list, sizeof(rc_list));
@@ -475,7 +475,7 @@ static int mwifiex_prep_tdls_encap_data(struct mwifiex_private *priv,
475 475
476 capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap; 476 capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap;
477 477
478 tf = (void *)skb_put(skb, offsetof(struct ieee80211_tdls_data, u)); 478 tf = skb_put(skb, offsetof(struct ieee80211_tdls_data, u));
479 memcpy(tf->da, peer, ETH_ALEN); 479 memcpy(tf->da, peer, ETH_ALEN);
480 memcpy(tf->sa, priv->curr_addr, ETH_ALEN); 480 memcpy(tf->sa, priv->curr_addr, ETH_ALEN);
481 tf->ether_type = cpu_to_be16(ETH_P_TDLS); 481 tf->ether_type = cpu_to_be16(ETH_P_TDLS);
@@ -494,7 +494,7 @@ static int mwifiex_prep_tdls_encap_data(struct mwifiex_private *priv,
494 return ret; 494 return ret;
495 } 495 }
496 496
497 pos = (void *)skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); 497 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
498 *pos++ = WLAN_EID_HT_CAPABILITY; 498 *pos++ = WLAN_EID_HT_CAPABILITY;
499 *pos++ = sizeof(struct ieee80211_ht_cap); 499 *pos++ = sizeof(struct ieee80211_ht_cap);
500 ht_cap = (void *)pos; 500 ht_cap = (void *)pos;
@@ -534,7 +534,7 @@ static int mwifiex_prep_tdls_encap_data(struct mwifiex_private *priv,
534 return ret; 534 return ret;
535 } 535 }
536 536
537 pos = (void *)skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); 537 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
538 *pos++ = WLAN_EID_HT_CAPABILITY; 538 *pos++ = WLAN_EID_HT_CAPABILITY;
539 *pos++ = sizeof(struct ieee80211_ht_cap); 539 *pos++ = sizeof(struct ieee80211_ht_cap);
540 ht_cap = (void *)pos; 540 ht_cap = (void *)pos;
@@ -616,7 +616,7 @@ mwifiex_tdls_add_link_ie(struct sk_buff *skb, const u8 *src_addr,
616{ 616{
617 struct ieee80211_tdls_lnkie *lnkid; 617 struct ieee80211_tdls_lnkie *lnkid;
618 618
619 lnkid = (void *)skb_put(skb, sizeof(struct ieee80211_tdls_lnkie)); 619 lnkid = skb_put(skb, sizeof(struct ieee80211_tdls_lnkie));
620 lnkid->ie_type = WLAN_EID_LINK_ID; 620 lnkid->ie_type = WLAN_EID_LINK_ID;
621 lnkid->ie_len = sizeof(struct ieee80211_tdls_lnkie) - 621 lnkid->ie_len = sizeof(struct ieee80211_tdls_lnkie) -
622 sizeof(struct ieee_types_header); 622 sizeof(struct ieee_types_header);
@@ -741,7 +741,7 @@ mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv,
741 741
742 capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap; 742 capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap;
743 743
744 mgmt = (void *)skb_put(skb, offsetof(struct ieee80211_mgmt, u)); 744 mgmt = skb_put(skb, offsetof(struct ieee80211_mgmt, u));
745 745
746 memset(mgmt, 0, 24); 746 memset(mgmt, 0, 24);
747 memcpy(mgmt->da, peer, ETH_ALEN); 747 memcpy(mgmt->da, peer, ETH_ALEN);
@@ -775,7 +775,7 @@ mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv,
775 return ret; 775 return ret;
776 } 776 }
777 777
778 pos = (void *)skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); 778 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
779 *pos++ = WLAN_EID_HT_CAPABILITY; 779 *pos++ = WLAN_EID_HT_CAPABILITY;
780 *pos++ = sizeof(struct ieee80211_ht_cap); 780 *pos++ = sizeof(struct ieee80211_ht_cap);
781 ht_cap = (void *)pos; 781 ht_cap = (void *)pos;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
index 9844ff0add2b..f6ac39973b5d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
@@ -26,7 +26,7 @@ static inline void qtnf_cmd_skb_put_action(struct sk_buff *skb, u16 action)
26{ 26{
27 __le16 *buf_ptr; 27 __le16 *buf_ptr;
28 28
29 buf_ptr = (__le16 *)skb_put(skb, sizeof(action)); 29 buf_ptr = skb_put(skb, sizeof(action));
30 *buf_ptr = cpu_to_le16(action); 30 *buf_ptr = cpu_to_le16(action);
31} 31}
32 32
@@ -42,8 +42,7 @@ static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb,
42 u16 tlv_id, const u8 arr[], 42 u16 tlv_id, const u8 arr[],
43 size_t arr_len) 43 size_t arr_len)
44{ 44{
45 struct qlink_tlv_hdr *hdr = 45 struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + arr_len);
46 (void *)skb_put(skb, sizeof(*hdr) + arr_len);
47 46
48 hdr->type = cpu_to_le16(tlv_id); 47 hdr->type = cpu_to_le16(tlv_id);
49 hdr->len = cpu_to_le16(arr_len); 48 hdr->len = cpu_to_le16(arr_len);
@@ -53,8 +52,7 @@ static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb,
53static inline void qtnf_cmd_skb_put_tlv_u8(struct sk_buff *skb, u16 tlv_id, 52static inline void qtnf_cmd_skb_put_tlv_u8(struct sk_buff *skb, u16 tlv_id,
54 u8 value) 53 u8 value)
55{ 54{
56 struct qlink_tlv_hdr *hdr = 55 struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + sizeof(value));
57 (void *)skb_put(skb, sizeof(*hdr) + sizeof(value));
58 56
59 hdr->type = cpu_to_le16(tlv_id); 57 hdr->type = cpu_to_le16(tlv_id);
60 hdr->len = cpu_to_le16(sizeof(value)); 58 hdr->len = cpu_to_le16(sizeof(value));
@@ -64,8 +62,7 @@ static inline void qtnf_cmd_skb_put_tlv_u8(struct sk_buff *skb, u16 tlv_id,
64static inline void qtnf_cmd_skb_put_tlv_u16(struct sk_buff *skb, 62static inline void qtnf_cmd_skb_put_tlv_u16(struct sk_buff *skb,
65 u16 tlv_id, u16 value) 63 u16 tlv_id, u16 value)
66{ 64{
67 struct qlink_tlv_hdr *hdr = 65 struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + sizeof(value));
68 (void *)skb_put(skb, sizeof(*hdr) + sizeof(value));
69 __le16 tmp = cpu_to_le16(value); 66 __le16 tmp = cpu_to_le16(value);
70 67
71 hdr->type = cpu_to_le16(tlv_id); 68 hdr->type = cpu_to_le16(tlv_id);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
index b70985e126bf..51520a0e2138 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
@@ -188,7 +188,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
188 return; 188 return;
189 } 189 }
190 190
191 dump_hdr = (struct rt2x00dump_hdr *)skb_put(skbcopy, sizeof(*dump_hdr)); 191 dump_hdr = skb_put(skbcopy, sizeof(*dump_hdr));
192 dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION); 192 dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION);
193 dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr)); 193 dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr));
194 dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len); 194 dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index dd3ba4810e7d..e7b1d7c0f542 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -462,7 +462,7 @@ static u32 _rtl92s_fill_h2c_cmd(struct sk_buff *skb, u32 h2cbufferlen,
462 break; 462 break;
463 463
464 /* Clear content */ 464 /* Clear content */
465 ph2c_buffer = (u8 *)skb_put(skb, (u32)len); 465 ph2c_buffer = skb_put(skb, (u32)len);
466 memset((ph2c_buffer + totallen + tx_desclen), 0, len); 466 memset((ph2c_buffer + totallen + tx_desclen), 0, len);
467 467
468 /* CMD len */ 468 /* CMD len */
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 0877e2283f35..97f003e84381 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -86,7 +86,7 @@ static void fdp_nci_i2c_add_len_lrc(struct sk_buff *skb)
86 for (i = 0; i < len + 2; i++) 86 for (i = 0; i < len + 2; i++)
87 lrc ^= skb->data[i]; 87 lrc ^= skb->data[i];
88 88
89 *skb_put(skb, 1) = lrc; 89 *(u8 *)skb_put(skb, 1) = lrc;
90} 90}
91 91
92static void fdp_nci_i2c_remove_len_lrc(struct sk_buff *skb) 92static void fdp_nci_i2c_remove_len_lrc(struct sk_buff *skb)
diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c
index e0e8afd27849..8e328c36a816 100644
--- a/drivers/nfc/microread/i2c.c
+++ b/drivers/nfc/microread/i2c.c
@@ -75,7 +75,7 @@ static void microread_i2c_add_len_crc(struct sk_buff *skb)
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];
77 77
78 *skb_put(skb, 1) = crc; 78 *(u8 *)skb_put(skb, 1) = crc;
79} 79}
80 80
81static void microread_i2c_remove_len_crc(struct sk_buff *skb) 81static void microread_i2c_remove_len_crc(struct sk_buff *skb)
@@ -173,7 +173,7 @@ static int microread_i2c_read(struct microread_i2c_phy *phy,
173 goto flush; 173 goto flush;
174 } 174 }
175 175
176 *skb_put(*skb, 1) = len; 176 *(u8 *)skb_put(*skb, 1) = len;
177 177
178 r = i2c_master_recv(client, skb_put(*skb, len), len); 178 r = i2c_master_recv(client, skb_put(*skb, len), len);
179 if (r != len) { 179 if (r != len) {
diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
index f454dc68cc03..9d0dd1be0923 100644
--- a/drivers/nfc/microread/microread.c
+++ b/drivers/nfc/microread/microread.c
@@ -441,8 +441,8 @@ static int microread_im_transceive(struct nfc_hci_dev *hdev,
441 441
442 crc = crc_ccitt(0xffff, skb->data, skb->len); 442 crc = crc_ccitt(0xffff, skb->data, skb->len);
443 crc = ~crc; 443 crc = ~crc;
444 *skb_put(skb, 1) = crc & 0xff; 444 *(u8 *)skb_put(skb, 1) = crc & 0xff;
445 *skb_put(skb, 1) = crc >> 8; 445 *(u8 *)skb_put(skb, 1) = crc >> 8;
446 break; 446 break;
447 case MICROREAD_GATE_ID_MREAD_NFC_T3: 447 case MICROREAD_GATE_ID_MREAD_NFC_T3:
448 control_bits = 0xDB; 448 control_bits = 0xDB;
diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
index 7c710458568e..788599de9d8a 100644
--- a/drivers/nfc/nfcmrvl/fw_dnld.c
+++ b/drivers/nfc/nfcmrvl/fw_dnld.c
@@ -92,7 +92,7 @@ static struct sk_buff *alloc_lc_skb(struct nfcmrvl_private *priv, uint8_t plen)
92 return NULL; 92 return NULL;
93 } 93 }
94 94
95 hdr = (struct nci_data_hdr *) skb_put(skb, NCI_DATA_HDR_SIZE); 95 hdr = skb_put(skb, NCI_DATA_HDR_SIZE);
96 hdr->conn_id = NCI_CORE_LC_CONNID_PROP_FW_DL; 96 hdr->conn_id = NCI_CORE_LC_CONNID_PROP_FW_DL;
97 hdr->rfu = 0; 97 hdr->rfu = 0;
98 hdr->plen = plen; 98 hdr->plen = plen;
@@ -292,7 +292,7 @@ static int process_state_fw_dnld(struct nfcmrvl_private *priv,
292 out_skb = alloc_lc_skb(priv, 1); 292 out_skb = alloc_lc_skb(priv, 1);
293 if (!out_skb) 293 if (!out_skb)
294 return -ENOMEM; 294 return -ENOMEM;
295 *skb_put(out_skb, 1) = 0xBF; 295 *(u8 *)skb_put(out_skb, 1) = 0xBF;
296 nci_send_frame(priv->ndev, out_skb); 296 nci_send_frame(priv->ndev, out_skb);
297 priv->fw_dnld.substate = SUBSTATE_WAIT_NACK_CREDIT; 297 priv->fw_dnld.substate = SUBSTATE_WAIT_NACK_CREDIT;
298 return 0; 298 return 0;
@@ -301,7 +301,7 @@ static int process_state_fw_dnld(struct nfcmrvl_private *priv,
301 out_skb = alloc_lc_skb(priv, 1); 301 out_skb = alloc_lc_skb(priv, 1);
302 if (!out_skb) 302 if (!out_skb)
303 return -ENOMEM; 303 return -ENOMEM;
304 *skb_put(out_skb, 1) = HELPER_ACK_PACKET_FORMAT; 304 *(u8 *)skb_put(out_skb, 1) = HELPER_ACK_PACKET_FORMAT;
305 nci_send_frame(priv->ndev, out_skb); 305 nci_send_frame(priv->ndev, out_skb);
306 priv->fw_dnld.substate = SUBSTATE_WAIT_ACK_CREDIT; 306 priv->fw_dnld.substate = SUBSTATE_WAIT_ACK_CREDIT;
307 break; 307 break;
diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index 9200bb308e42..68a3cd0287f6 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -1032,7 +1032,7 @@ static struct sk_buff *pn533_alloc_poll_tg_frame(struct pn533 *dev)
1032 return NULL; 1032 return NULL;
1033 1033
1034 /* DEP support only */ 1034 /* DEP support only */
1035 *skb_put(skb, 1) = PN533_INIT_TARGET_DEP; 1035 *(u8 *)skb_put(skb, 1) = PN533_INIT_TARGET_DEP;
1036 1036
1037 /* MIFARE params */ 1037 /* MIFARE params */
1038 skb_put_data(skb, mifare_params, 6); 1038 skb_put_data(skb, mifare_params, 6);
@@ -1046,12 +1046,12 @@ static struct sk_buff *pn533_alloc_poll_tg_frame(struct pn533 *dev)
1046 memcpy(nfcid3, felica, 8); 1046 memcpy(nfcid3, felica, 8);
1047 1047
1048 /* General bytes */ 1048 /* General bytes */
1049 *skb_put(skb, 1) = gbytes_len; 1049 *(u8 *)skb_put(skb, 1) = gbytes_len;
1050 1050
1051 gb = skb_put_data(skb, gbytes, gbytes_len); 1051 gb = skb_put_data(skb, gbytes, gbytes_len);
1052 1052
1053 /* Len Tk */ 1053 /* Len Tk */
1054 *skb_put(skb, 1) = 0; 1054 *(u8 *)skb_put(skb, 1) = 0;
1055 1055
1056 return skb; 1056 return skb;
1057} 1057}
@@ -1280,8 +1280,8 @@ static void pn533_wq_rf(struct work_struct *work)
1280 if (!skb) 1280 if (!skb)
1281 return; 1281 return;
1282 1282
1283 *skb_put(skb, 1) = PN533_CFGITEM_RF_FIELD; 1283 *(u8 *)skb_put(skb, 1) = PN533_CFGITEM_RF_FIELD;
1284 *skb_put(skb, 1) = PN533_CFGITEM_RF_FIELD_AUTO_RFCA; 1284 *(u8 *)skb_put(skb, 1) = PN533_CFGITEM_RF_FIELD_AUTO_RFCA;
1285 1285
1286 rc = pn533_send_cmd_async(dev, PN533_CMD_RF_CONFIGURATION, skb, 1286 rc = pn533_send_cmd_async(dev, PN533_CMD_RF_CONFIGURATION, skb,
1287 pn533_rf_complete, NULL); 1287 pn533_rf_complete, NULL);
@@ -1375,8 +1375,8 @@ static int pn533_poll_dep(struct nfc_dev *nfc_dev)
1375 if (!skb) 1375 if (!skb)
1376 return -ENOMEM; 1376 return -ENOMEM;
1377 1377
1378 *skb_put(skb, 1) = 0x01; /* Active */ 1378 *(u8 *)skb_put(skb, 1) = 0x01; /* Active */
1379 *skb_put(skb, 1) = 0x02; /* 424 kbps */ 1379 *(u8 *)skb_put(skb, 1) = 0x02; /* 424 kbps */
1380 1380
1381 next = skb_put(skb, 1); /* Next */ 1381 next = skb_put(skb, 1); /* Next */
1382 *next = 0; 1382 *next = 0;
@@ -1620,8 +1620,8 @@ static int pn533_activate_target_nfcdep(struct pn533 *dev)
1620 if (!skb) 1620 if (!skb)
1621 return -ENOMEM; 1621 return -ENOMEM;
1622 1622
1623 *skb_put(skb, sizeof(u8)) = 1; /* TG */ 1623 *(u8 *)skb_put(skb, sizeof(u8)) = 1; /* TG */
1624 *skb_put(skb, sizeof(u8)) = 0; /* Next */ 1624 *(u8 *)skb_put(skb, sizeof(u8)) = 0; /* Next */
1625 1625
1626 resp = pn533_send_cmd_sync(dev, PN533_CMD_IN_ATR, skb); 1626 resp = pn533_send_cmd_sync(dev, PN533_CMD_IN_ATR, skb);
1627 if (IS_ERR(resp)) 1627 if (IS_ERR(resp))
@@ -1737,7 +1737,7 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
1737 if (!skb) 1737 if (!skb)
1738 return; 1738 return;
1739 1739
1740 *skb_put(skb, 1) = 1; /* TG*/ 1740 *(u8 *)skb_put(skb, 1) = 1; /* TG*/
1741 1741
1742 rc = pn533_send_cmd_async(dev, PN533_CMD_IN_RELEASE, skb, 1742 rc = pn533_send_cmd_async(dev, PN533_CMD_IN_RELEASE, skb,
1743 pn533_deactivate_target_complete, NULL); 1743 pn533_deactivate_target_complete, NULL);
@@ -1848,8 +1848,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1848 if (!skb) 1848 if (!skb)
1849 return -ENOMEM; 1849 return -ENOMEM;
1850 1850
1851 *skb_put(skb, 1) = !comm_mode; /* ActPass */ 1851 *(u8 *)skb_put(skb, 1) = !comm_mode; /* ActPass */
1852 *skb_put(skb, 1) = 0x02; /* 424 kbps */ 1852 *(u8 *)skb_put(skb, 1) = 0x02; /* 424 kbps */
1853 1853
1854 next = skb_put(skb, 1); /* Next */ 1854 next = skb_put(skb, 1); /* Next */
1855 *next = 0; 1855 *next = 0;
@@ -2274,7 +2274,7 @@ static void pn533_wq_mi_recv(struct work_struct *work)
2274 break; 2274 break;
2275 } 2275 }
2276 default: 2276 default:
2277 *skb_put(skb, sizeof(u8)) = 1; /*TG*/ 2277 *(u8 *)skb_put(skb, sizeof(u8)) = 1; /*TG*/
2278 2278
2279 rc = pn533_send_cmd_direct_async(dev, 2279 rc = pn533_send_cmd_direct_async(dev,
2280 PN533_CMD_IN_DATA_EXCHANGE, 2280 PN533_CMD_IN_DATA_EXCHANGE,
@@ -2370,7 +2370,7 @@ static int pn533_set_configuration(struct pn533 *dev, u8 cfgitem, u8 *cfgdata,
2370 if (!skb) 2370 if (!skb)
2371 return -ENOMEM; 2371 return -ENOMEM;
2372 2372
2373 *skb_put(skb, sizeof(cfgitem)) = cfgitem; 2373 *(u8 *)skb_put(skb, sizeof(cfgitem)) = cfgitem;
2374 skb_put_data(skb, cfgdata, cfgdata_len); 2374 skb_put_data(skb, cfgdata, cfgdata_len);
2375 2375
2376 resp = pn533_send_cmd_sync(dev, PN533_CMD_RF_CONFIGURATION, skb); 2376 resp = pn533_send_cmd_sync(dev, PN533_CMD_RF_CONFIGURATION, skb);
@@ -2415,7 +2415,7 @@ static int pn533_pasori_fw_reset(struct pn533 *dev)
2415 if (!skb) 2415 if (!skb)
2416 return -ENOMEM; 2416 return -ENOMEM;
2417 2417
2418 *skb_put(skb, sizeof(u8)) = 0x1; 2418 *(u8 *)skb_put(skb, sizeof(u8)) = 0x1;
2419 2419
2420 resp = pn533_send_cmd_sync(dev, 0x18, skb); 2420 resp = pn533_send_cmd_sync(dev, 0x18, skb);
2421 if (IS_ERR(resp)) 2421 if (IS_ERR(resp))
@@ -2454,7 +2454,7 @@ static int pn532_sam_configuration(struct nfc_dev *nfc_dev)
2454 if (!skb) 2454 if (!skb)
2455 return -ENOMEM; 2455 return -ENOMEM;
2456 2456
2457 *skb_put(skb, 1) = 0x01; 2457 *(u8 *)skb_put(skb, 1) = 0x01;
2458 2458
2459 resp = pn533_send_cmd_sync(dev, PN533_CMD_SAM_CONFIGURATION, skb); 2459 resp = pn533_send_cmd_sync(dev, PN533_CMD_SAM_CONFIGURATION, skb);
2460 if (IS_ERR(resp)) 2460 if (IS_ERR(resp))
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 71ac0836c9f4..dc1e3768cee6 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -287,8 +287,8 @@ static void pn544_hci_i2c_add_len_crc(struct sk_buff *skb)
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;
290 *skb_put(skb, 1) = crc & 0xff; 290 *(u8 *)skb_put(skb, 1) = crc & 0xff;
291 *skb_put(skb, 1) = crc >> 8; 291 *(u8 *)skb_put(skb, 1) = crc >> 8;
292} 292}
293 293
294static void pn544_hci_i2c_remove_len_crc(struct sk_buff *skb) 294static void pn544_hci_i2c_remove_len_crc(struct sk_buff *skb)
@@ -391,7 +391,7 @@ static int pn544_hci_i2c_read(struct pn544_i2c_phy *phy, struct sk_buff **skb)
391 goto flush; 391 goto flush;
392 } 392 }
393 393
394 *skb_put(*skb, 1) = len; 394 *(u8 *)skb_put(*skb, 1) = len;
395 395
396 r = i2c_master_recv(client, skb_put(*skb, len), len); 396 r = i2c_master_recv(client, skb_put(*skb, len), len);
397 if (r != len) { 397 if (r != len) {
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index e1260da73d45..5fa3cf0fabd6 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -991,7 +991,7 @@ static int port100_set_command_type(struct port100 *dev, u8 command_type)
991 if (!skb) 991 if (!skb)
992 return -ENOMEM; 992 return -ENOMEM;
993 993
994 *skb_put(skb, sizeof(u8)) = command_type; 994 *(u8 *)skb_put(skb, sizeof(u8)) = command_type;
995 995
996 resp = port100_send_cmd_sync(dev, PORT100_CMD_SET_COMMAND_TYPE, skb); 996 resp = port100_send_cmd_sync(dev, PORT100_CMD_SET_COMMAND_TYPE, skb);
997 if (IS_ERR(resp)) 997 if (IS_ERR(resp))
@@ -1059,7 +1059,7 @@ static int port100_switch_rf(struct nfc_digital_dev *ddev, bool on)
1059 if (!skb) 1059 if (!skb)
1060 return -ENOMEM; 1060 return -ENOMEM;
1061 1061
1062 *skb_put(skb, 1) = on ? 1 : 0; 1062 *(u8 *)skb_put(skb, 1) = on ? 1 : 0;
1063 1063
1064 /* Cancel the last command if the device is being switched off */ 1064 /* Cancel the last command if the device is being switched off */
1065 if (!on) 1065 if (!on)
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 94d0b913b627..c36f0e0afdfd 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -177,10 +177,10 @@ static void st21nfca_hci_add_len_crc(struct sk_buff *skb)
177 crc = ~crc; 177 crc = ~crc;
178 178
179 tmp = crc & 0x00ff; 179 tmp = crc & 0x00ff;
180 *skb_put(skb, 1) = tmp; 180 *(u8 *)skb_put(skb, 1) = tmp;
181 181
182 tmp = (crc >> 8) & 0x00ff; 182 tmp = (crc >> 8) & 0x00ff;
183 *skb_put(skb, 1) = tmp; 183 *(u8 *)skb_put(skb, 1) = tmp;
184} 184}
185 185
186static void st21nfca_hci_remove_len_crc(struct sk_buff *skb) 186static void st21nfca_hci_remove_len_crc(struct sk_buff *skb)
@@ -214,7 +214,7 @@ static int st21nfca_hci_i2c_write(void *phy_id, struct sk_buff *skb)
214 st21nfca_hci_add_len_crc(skb); 214 st21nfca_hci_add_len_crc(skb);
215 215
216 /* add ST21NFCA_SOF_EOF on tail */ 216 /* add ST21NFCA_SOF_EOF on tail */
217 *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 *skb_push(skb, 1) = ST21NFCA_SOF_EOF;
220 220
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index c2840e412962..168adcc46cb8 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -949,7 +949,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
949 switch (stcontext->current_rf_tech) { 949 switch (stcontext->current_rf_tech) {
950 case NFC_DIGITAL_RF_TECH_106A: 950 case NFC_DIGITAL_RF_TECH_106A:
951 len_data_to_tag = skb->len + 1; 951 len_data_to_tag = skb->len + 1;
952 *skb_put(skb, 1) = stcontext->sendrcv_trflag; 952 *(u8 *)skb_put(skb, 1) = stcontext->sendrcv_trflag;
953 break; 953 break;
954 case NFC_DIGITAL_RF_TECH_106B: 954 case NFC_DIGITAL_RF_TECH_106B:
955 case NFC_DIGITAL_RF_TECH_ISO15693: 955 case NFC_DIGITAL_RF_TECH_ISO15693:
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 902722dc4ce3..b025ee5da1ba 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -351,7 +351,7 @@ static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp)
351 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1]; 351 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
352 cp = kmap_atomic(skb_frag_page(frag)) + frag->page_offset; 352 cp = kmap_atomic(skb_frag_page(frag)) + frag->page_offset;
353 } else { 353 } else {
354 cp = (struct fcoe_crc_eof *)skb_put(skb, tlen); 354 cp = skb_put(skb, tlen);
355 } 355 }
356 356
357 memset(cp, 0, sizeof(*cp)); 357 memset(cp, 0, sizeof(*cp));
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 90939f66bc0d..539e23ec0e59 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1543,7 +1543,7 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
1543 cp = kmap_atomic(skb_frag_page(frag)) 1543 cp = kmap_atomic(skb_frag_page(frag))
1544 + frag->page_offset; 1544 + frag->page_offset;
1545 } else { 1545 } else {
1546 cp = (struct fcoe_crc_eof *)skb_put(skb, tlen); 1546 cp = skb_put(skb, tlen);
1547 } 1547 }
1548 1548
1549 memset(cp, 0, sizeof(*cp)); 1549 memset(cp, 0, sizeof(*cp));
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index b97405ed6cae..da0fcce6f842 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -874,7 +874,7 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp)
874 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1]; 874 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
875 cp = kmap_atomic(skb_frag_page(frag)) + frag->page_offset; 875 cp = kmap_atomic(skb_frag_page(frag)) + frag->page_offset;
876 } else { 876 } else {
877 cp = (struct fcoe_crc_eof *)skb_put(skb, tlen); 877 cp = skb_put(skb, tlen);
878 } 878 }
879 879
880 memset(cp, 0, sizeof(*cp)); 880 memset(cp, 0, sizeof(*cp));
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 1d3963136295..1720e1b6ae04 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -95,8 +95,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
95 95
96 skb_reserve(skb, ieee->tx_headroom); 96 skb_reserve(skb, ieee->tx_headroom);
97 97
98 BAReq = (struct rtllib_hdr_3addr *)skb_put(skb, 98 BAReq = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
99 sizeof(struct rtllib_hdr_3addr));
100 99
101 ether_addr_copy(BAReq->addr1, Dst); 100 ether_addr_copy(BAReq->addr1, Dst);
102 ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr); 101 ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr);
@@ -104,7 +103,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
104 ether_addr_copy(BAReq->addr3, ieee->current_network.bssid); 103 ether_addr_copy(BAReq->addr3, ieee->current_network.bssid);
105 BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); 104 BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
106 105
107 tag = (u8 *)skb_put(skb, 9); 106 tag = skb_put(skb, 9);
108 *tag++ = ACT_CAT_BA; 107 *tag++ = ACT_CAT_BA;
109 *tag++ = type; 108 *tag++ = type;
110 *tag++ = pBA->DialogToken; 109 *tag++ = pBA->DialogToken;
@@ -159,15 +158,14 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
159 158
160 skb_reserve(skb, ieee->tx_headroom); 159 skb_reserve(skb, ieee->tx_headroom);
161 160
162 Delba = (struct rtllib_hdr_3addr *) skb_put(skb, 161 Delba = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
163 sizeof(struct rtllib_hdr_3addr));
164 162
165 ether_addr_copy(Delba->addr1, dst); 163 ether_addr_copy(Delba->addr1, dst);
166 ether_addr_copy(Delba->addr2, ieee->dev->dev_addr); 164 ether_addr_copy(Delba->addr2, ieee->dev->dev_addr);
167 ether_addr_copy(Delba->addr3, ieee->current_network.bssid); 165 ether_addr_copy(Delba->addr3, ieee->current_network.bssid);
168 Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); 166 Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
169 167
170 tag = (u8 *)skb_put(skb, 6); 168 tag = skb_put(skb, 6);
171 169
172 *tag++ = ACT_CAT_BA; 170 *tag++ = ACT_CAT_BA;
173 *tag++ = ACT_DELBA; 171 *tag++ = ACT_DELBA;
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 60d07d0bb4eb..5f2751d4d464 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -351,8 +351,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
351 351
352 skb_reserve(skb, ieee->tx_headroom); 352 skb_reserve(skb, ieee->tx_headroom);
353 353
354 req = (struct rtllib_probe_request *) skb_put(skb, 354 req = skb_put(skb, sizeof(struct rtllib_probe_request));
355 sizeof(struct rtllib_probe_request));
356 req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ); 355 req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
357 req->header.duration_id = 0; 356 req->header.duration_id = 0;
358 357
@@ -360,7 +359,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
360 ether_addr_copy(req->header.addr2, ieee->dev->dev_addr); 359 ether_addr_copy(req->header.addr2, ieee->dev->dev_addr);
361 eth_broadcast_addr(req->header.addr3); 360 eth_broadcast_addr(req->header.addr3);
362 361
363 tag = (u8 *) skb_put(skb, len + 2 + rate_len); 362 tag = skb_put(skb, len + 2 + rate_len);
364 363
365 *tag++ = MFIE_TYPE_SSID; 364 *tag++ = MFIE_TYPE_SSID;
366 *tag++ = len; 365 *tag++ = len;
@@ -789,8 +788,7 @@ rtllib_authentication_req(struct rtllib_network *beacon,
789 788
790 skb_reserve(skb, ieee->tx_headroom); 789 skb_reserve(skb, ieee->tx_headroom);
791 790
792 auth = (struct rtllib_authentication *) 791 auth = skb_put(skb, sizeof(struct rtllib_authentication));
793 skb_put(skb, sizeof(struct rtllib_authentication));
794 792
795 auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH); 793 auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH);
796 if (challengelen) 794 if (challengelen)
@@ -889,8 +887,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
889 887
890 skb_reserve(skb, ieee->tx_headroom); 888 skb_reserve(skb, ieee->tx_headroom);
891 889
892 beacon_buf = (struct rtllib_probe_response *) skb_put(skb, 890 beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom));
893 (beacon_size - ieee->tx_headroom));
894 ether_addr_copy(beacon_buf->header.addr1, dest); 891 ether_addr_copy(beacon_buf->header.addr1, dest);
895 ether_addr_copy(beacon_buf->header.addr2, ieee->dev->dev_addr); 892 ether_addr_copy(beacon_buf->header.addr2, ieee->dev->dev_addr);
896 ether_addr_copy(beacon_buf->header.addr3, ieee->current_network.bssid); 893 ether_addr_copy(beacon_buf->header.addr3, ieee->current_network.bssid);
@@ -984,8 +981,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
984 981
985 skb_reserve(skb, ieee->tx_headroom); 982 skb_reserve(skb, ieee->tx_headroom);
986 983
987 assoc = (struct rtllib_assoc_response_frame *) 984 assoc = skb_put(skb, sizeof(struct rtllib_assoc_response_frame));
988 skb_put(skb, sizeof(struct rtllib_assoc_response_frame));
989 985
990 assoc->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_RESP); 986 assoc->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_RESP);
991 ether_addr_copy(assoc->header.addr1, dest); 987 ether_addr_copy(assoc->header.addr1, dest);
@@ -1016,7 +1012,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
1016 else 1012 else
1017 ieee->assoc_id++; 1013 ieee->assoc_id++;
1018 1014
1019 tag = (u8 *) skb_put(skb, rate_len); 1015 tag = skb_put(skb, rate_len);
1020 rtllib_MFIE_Brate(ieee, &tag); 1016 rtllib_MFIE_Brate(ieee, &tag);
1021 rtllib_MFIE_Grate(ieee, &tag); 1017 rtllib_MFIE_Grate(ieee, &tag);
1022 1018
@@ -1038,8 +1034,7 @@ static struct sk_buff *rtllib_auth_resp(struct rtllib_device *ieee, int status,
1038 1034
1039 skb_reserve(skb, ieee->tx_headroom); 1035 skb_reserve(skb, ieee->tx_headroom);
1040 1036
1041 auth = (struct rtllib_authentication *) 1037 auth = skb_put(skb, sizeof(struct rtllib_authentication));
1042 skb_put(skb, sizeof(struct rtllib_authentication));
1043 1038
1044 auth->status = cpu_to_le16(status); 1039 auth->status = cpu_to_le16(status);
1045 auth->transaction = cpu_to_le16(2); 1040 auth->transaction = cpu_to_le16(2);
@@ -1065,8 +1060,7 @@ static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr)
1065 1060
1066 skb_reserve(skb, ieee->tx_headroom); 1061 skb_reserve(skb, ieee->tx_headroom);
1067 1062
1068 hdr = (struct rtllib_hdr_3addr *)skb_put(skb, 1063 hdr = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
1069 sizeof(struct rtllib_hdr_3addr));
1070 1064
1071 ether_addr_copy(hdr->addr1, ieee->current_network.bssid); 1065 ether_addr_copy(hdr->addr1, ieee->current_network.bssid);
1072 ether_addr_copy(hdr->addr2, ieee->dev->dev_addr); 1066 ether_addr_copy(hdr->addr2, ieee->dev->dev_addr);
@@ -1092,8 +1086,7 @@ static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee)
1092 1086
1093 skb_reserve(skb, ieee->tx_headroom); 1087 skb_reserve(skb, ieee->tx_headroom);
1094 1088
1095 hdr = (struct rtllib_pspoll_hdr *)skb_put(skb, 1089 hdr = skb_put(skb, sizeof(struct rtllib_pspoll_hdr));
1096 sizeof(struct rtllib_pspoll_hdr));
1097 1090
1098 ether_addr_copy(hdr->bssid, ieee->current_network.bssid); 1091 ether_addr_copy(hdr->bssid, ieee->current_network.bssid);
1099 ether_addr_copy(hdr->ta, ieee->dev->dev_addr); 1092 ether_addr_copy(hdr->ta, ieee->dev->dev_addr);
@@ -1243,8 +1236,7 @@ rtllib_association_req(struct rtllib_network *beacon,
1243 1236
1244 skb_reserve(skb, ieee->tx_headroom); 1237 skb_reserve(skb, ieee->tx_headroom);
1245 1238
1246 hdr = (struct rtllib_assoc_request_frame *) 1239 hdr = skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2);
1247 skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2);
1248 1240
1249 1241
1250 hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ); 1242 hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ);
@@ -3414,8 +3406,7 @@ rtllib_disauth_skb(struct rtllib_network *beacon,
3414 3406
3415 skb_reserve(skb, ieee->tx_headroom); 3407 skb_reserve(skb, ieee->tx_headroom);
3416 3408
3417 disauth = (struct rtllib_disauth *) skb_put(skb, 3409 disauth = skb_put(skb, sizeof(struct rtllib_disauth));
3418 sizeof(struct rtllib_disauth));
3419 disauth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DEAUTH); 3410 disauth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DEAUTH);
3420 disauth->header.duration_id = 0; 3411 disauth->header.duration_id = 0;
3421 3412
@@ -3442,8 +3433,7 @@ rtllib_disassociate_skb(struct rtllib_network *beacon,
3442 3433
3443 skb_reserve(skb, ieee->tx_headroom); 3434 skb_reserve(skb, ieee->tx_headroom);
3444 3435
3445 disass = (struct rtllib_disassoc *) skb_put(skb, 3436 disass = skb_put(skb, sizeof(struct rtllib_disassoc));
3446 sizeof(struct rtllib_disassoc));
3447 disass->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DISASSOC); 3437 disass->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DISASSOC);
3448 disass->header.duration_id = 0; 3438 disass->header.duration_id = 0;
3449 3439
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 903a1d0269df..107069180ed2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -341,7 +341,7 @@ static inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
341 341
342 skb_reserve(skb, ieee->tx_headroom); 342 skb_reserve(skb, ieee->tx_headroom);
343 343
344 req = (struct ieee80211_probe_request *) skb_put(skb,sizeof(struct ieee80211_probe_request)); 344 req = skb_put(skb, sizeof(struct ieee80211_probe_request));
345 req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ); 345 req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
346 req->header.duration_id = 0; /* FIXME: is this OK? */ 346 req->header.duration_id = 0; /* FIXME: is this OK? */
347 347
@@ -349,7 +349,7 @@ static inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
349 memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN); 349 memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
350 eth_broadcast_addr(req->header.addr3); 350 eth_broadcast_addr(req->header.addr3);
351 351
352 tag = (u8 *) skb_put(skb,len+2+rate_len); 352 tag = skb_put(skb, len + 2 + rate_len);
353 353
354 *tag++ = MFIE_TYPE_SSID; 354 *tag++ = MFIE_TYPE_SSID;
355 *tag++ = len; 355 *tag++ = len;
@@ -659,8 +659,7 @@ ieee80211_authentication_req(struct ieee80211_network *beacon,
659 if (!skb) return NULL; 659 if (!skb) return NULL;
660 660
661 skb_reserve(skb, ieee->tx_headroom); 661 skb_reserve(skb, ieee->tx_headroom);
662 auth = (struct ieee80211_authentication *) 662 auth = skb_put(skb, sizeof(struct ieee80211_authentication));
663 skb_put(skb, sizeof(struct ieee80211_authentication));
664 663
665 if (challengelen) 664 if (challengelen)
666 auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH 665 auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH
@@ -768,7 +767,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
768 if (!skb) 767 if (!skb)
769 return NULL; 768 return NULL;
770 skb_reserve(skb, ieee->tx_headroom); 769 skb_reserve(skb, ieee->tx_headroom);
771 beacon_buf = (struct ieee80211_probe_response *) skb_put(skb, (beacon_size - ieee->tx_headroom)); 770 beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom));
772 memcpy (beacon_buf->header.addr1, dest,ETH_ALEN); 771 memcpy (beacon_buf->header.addr1, dest,ETH_ALEN);
773 memcpy (beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN); 772 memcpy (beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
774 memcpy (beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN); 773 memcpy (beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN);
@@ -864,8 +863,7 @@ static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
864 863
865 skb_reserve(skb, ieee->tx_headroom); 864 skb_reserve(skb, ieee->tx_headroom);
866 865
867 assoc = (struct ieee80211_assoc_response_frame *) 866 assoc = skb_put(skb, sizeof(struct ieee80211_assoc_response_frame));
868 skb_put(skb, sizeof(struct ieee80211_assoc_response_frame));
869 867
870 assoc->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP); 868 assoc->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP);
871 memcpy(assoc->header.addr1, dest,ETH_ALEN); 869 memcpy(assoc->header.addr1, dest,ETH_ALEN);
@@ -892,7 +890,7 @@ static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
892 if (ieee->assoc_id == 0x2007) ieee->assoc_id=0; 890 if (ieee->assoc_id == 0x2007) ieee->assoc_id=0;
893 else ieee->assoc_id++; 891 else ieee->assoc_id++;
894 892
895 tag = (u8 *) skb_put(skb, rate_len); 893 tag = skb_put(skb, rate_len);
896 894
897 ieee80211_MFIE_Brate(ieee, &tag); 895 ieee80211_MFIE_Brate(ieee, &tag);
898 ieee80211_MFIE_Grate(ieee, &tag); 896 ieee80211_MFIE_Grate(ieee, &tag);
@@ -940,7 +938,7 @@ static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee,
940 if (!skb) 938 if (!skb)
941 return NULL; 939 return NULL;
942 940
943 hdr = (struct rtl_80211_hdr_3addr *)skb_put(skb,sizeof(struct rtl_80211_hdr_3addr)); 941 hdr = skb_put(skb, sizeof(struct rtl_80211_hdr_3addr));
944 942
945 memcpy(hdr->addr1, ieee->current_network.bssid, ETH_ALEN); 943 memcpy(hdr->addr1, ieee->current_network.bssid, ETH_ALEN);
946 memcpy(hdr->addr2, ieee->dev->dev_addr, ETH_ALEN); 944 memcpy(hdr->addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -1086,8 +1084,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
1086 1084
1087 skb_reserve(skb, ieee->tx_headroom); 1085 skb_reserve(skb, ieee->tx_headroom);
1088 1086
1089 hdr = (struct ieee80211_assoc_request_frame *) 1087 hdr = skb_put(skb, sizeof(struct ieee80211_assoc_request_frame) + 2);
1090 skb_put(skb, sizeof(struct ieee80211_assoc_request_frame)+2);
1091 1088
1092 1089
1093 hdr->header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ; 1090 hdr->header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ;
@@ -3110,7 +3107,7 @@ static inline struct sk_buff *ieee80211_disassociate_skb(
3110 if (!skb) 3107 if (!skb)
3111 return NULL; 3108 return NULL;
3112 3109
3113 disass = (struct ieee80211_disassoc *) skb_put(skb, sizeof(struct ieee80211_disassoc)); 3110 disass = skb_put(skb, sizeof(struct ieee80211_disassoc));
3114 disass->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_DISASSOC); 3111 disass->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_DISASSOC);
3115 disass->header.duration_id = 0; 3112 disass->header.duration_id = 0;
3116 3113
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index e82b5073c3f1..8aa38dcf0dfd 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -125,7 +125,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
125 memset(skb->data, 0, sizeof( struct rtl_80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb. 125 memset(skb->data, 0, sizeof( struct rtl_80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb.
126 skb_reserve(skb, ieee->tx_headroom); 126 skb_reserve(skb, ieee->tx_headroom);
127 127
128 BAReq = ( struct rtl_80211_hdr_3addr *) skb_put(skb,sizeof( struct rtl_80211_hdr_3addr)); 128 BAReq = skb_put(skb, sizeof(struct rtl_80211_hdr_3addr));
129 129
130 memcpy(BAReq->addr1, Dst, ETH_ALEN); 130 memcpy(BAReq->addr1, Dst, ETH_ALEN);
131 memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN); 131 memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -135,7 +135,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
135 BAReq->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame 135 BAReq->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame
136 136
137 //tag += sizeof( struct rtl_80211_hdr_3addr); //move to action field 137 //tag += sizeof( struct rtl_80211_hdr_3addr); //move to action field
138 tag = (u8 *)skb_put(skb, 9); 138 tag = skb_put(skb, 9);
139 *tag ++= ACT_CAT_BA; 139 *tag ++= ACT_CAT_BA;
140 *tag ++= type; 140 *tag ++= type;
141 // Dialog Token 141 // Dialog Token
@@ -209,14 +209,14 @@ static struct sk_buff *ieee80211_DELBA(
209// memset(skb->data, 0, len+sizeof( struct rtl_80211_hdr_3addr)); 209// memset(skb->data, 0, len+sizeof( struct rtl_80211_hdr_3addr));
210 skb_reserve(skb, ieee->tx_headroom); 210 skb_reserve(skb, ieee->tx_headroom);
211 211
212 Delba = ( struct rtl_80211_hdr_3addr *) skb_put(skb,sizeof( struct rtl_80211_hdr_3addr)); 212 Delba = skb_put(skb, sizeof(struct rtl_80211_hdr_3addr));
213 213
214 memcpy(Delba->addr1, dst, ETH_ALEN); 214 memcpy(Delba->addr1, dst, ETH_ALEN);
215 memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN); 215 memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
216 memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN); 216 memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN);
217 Delba->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame 217 Delba->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame
218 218
219 tag = (u8 *)skb_put(skb, 6); 219 tag = skb_put(skb, 6);
220 220
221 *tag ++= ACT_CAT_BA; 221 *tag ++= ACT_CAT_BA;
222 *tag ++= ACT_DELBA; 222 *tag ++= ACT_DELBA;
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
index 939c6ec51e4d..15cd1e33b16b 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
@@ -1085,7 +1085,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
1085 return; 1085 return;
1086 } 1086 }
1087 1087
1088 rpl5 = (struct cpl_t5_pass_accept_rpl *)__skb_put(skb, len); 1088 rpl5 = __skb_put(skb, len);
1089 memset(rpl5, 0, len); 1089 memset(rpl5, 0, len);
1090 1090
1091 INIT_TP_WR(rpl5, csk->tid); 1091 INIT_TP_WR(rpl5, csk->tid);
@@ -1367,7 +1367,7 @@ u32 cxgbit_send_tx_flowc_wr(struct cxgbit_sock *csk)
1367 flowclen16 = cxgbit_tx_flowc_wr_credits(csk, &nparams, &flowclen); 1367 flowclen16 = cxgbit_tx_flowc_wr_credits(csk, &nparams, &flowclen);
1368 1368
1369 skb = __skb_dequeue(&csk->skbq); 1369 skb = __skb_dequeue(&csk->skbq);
1370 flowc = (struct fw_flowc_wr *)__skb_put(skb, flowclen); 1370 flowc = __skb_put(skb, flowclen);
1371 memset(flowc, 0, flowclen); 1371 memset(flowc, 0, flowclen);
1372 1372
1373 flowc->op_to_nparams = cpu_to_be32(FW_WR_OP_V(FW_FLOWC_WR) | 1373 flowc->op_to_nparams = cpu_to_be32(FW_WR_OP_V(FW_FLOWC_WR) |
@@ -1439,7 +1439,7 @@ int cxgbit_setup_conn_digest(struct cxgbit_sock *csk)
1439 return -ENOMEM; 1439 return -ENOMEM;
1440 1440
1441 /* set up ulp submode */ 1441 /* set up ulp submode */
1442 req = (struct cpl_set_tcb_field *)__skb_put(skb, len); 1442 req = __skb_put(skb, len);
1443 memset(req, 0, len); 1443 memset(req, 0, len);
1444 1444
1445 INIT_TP_WR(req, csk->tid); 1445 INIT_TP_WR(req, csk->tid);
@@ -1476,7 +1476,7 @@ int cxgbit_setup_conn_pgidx(struct cxgbit_sock *csk, u32 pg_idx)
1476 if (!skb) 1476 if (!skb)
1477 return -ENOMEM; 1477 return -ENOMEM;
1478 1478
1479 req = (struct cpl_set_tcb_field *)__skb_put(skb, len); 1479 req = __skb_put(skb, len);
1480 memset(req, 0, len); 1480 memset(req, 0, len);
1481 1481
1482 INIT_TP_WR(req, csk->tid); 1482 INIT_TP_WR(req, csk->tid);
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
index 5d78bdb7fc64..5fdb57cac968 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
@@ -79,7 +79,7 @@ cxgbit_ppod_init_idata(struct cxgbit_device *cdev, struct cxgbi_ppm *ppm,
79 if (!skb) 79 if (!skb)
80 return NULL; 80 return NULL;
81 81
82 req = (struct ulp_mem_io *)__skb_put(skb, wr_len); 82 req = __skb_put(skb, wr_len);
83 INIT_ULPTX_WR(req, wr_len, 0, tid); 83 INIT_ULPTX_WR(req, wr_len, 0, tid);
84 req->wr.wr_hi = htonl(FW_WR_OP_V(FW_ULPTX_WR) | 84 req->wr.wr_hi = htonl(FW_WR_OP_V(FW_ULPTX_WR) |
85 FW_WR_ATOMIC_V(0)); 85 FW_WR_ATOMIC_V(0));
diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 630616aaa861..a9c28c72c1c7 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -1047,7 +1047,7 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port,
1047 crc = ~crc32_le(~0, 1047 crc = ~crc32_le(~0,
1048 skb->data, 1048 skb->data,
1049 skb->len); 1049 skb->len);
1050 crc_pos = (void *) skb_put(skb, sizeof(uint32_t)); 1050 crc_pos = skb_put(skb, sizeof(uint32_t));
1051 put_unaligned_le32(crc, crc_pos); 1051 put_unaligned_le32(crc, crc_pos);
1052 } 1052 }
1053 1053
@@ -1097,8 +1097,7 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port,
1097 goto err; 1097 goto err;
1098 1098
1099 ncm->skb_tx_ndp->dev = ncm->netdev; 1099 ncm->skb_tx_ndp->dev = ncm->netdev;
1100 ntb_ndp = (void *) skb_put(ncm->skb_tx_ndp, 1100 ntb_ndp = skb_put(ncm->skb_tx_ndp, opts->ndp_size);
1101 opts->ndp_size);
1102 memset(ntb_ndp, 0, ncb_len); 1101 memset(ntb_ndp, 0, ncb_len);
1103 /* dwSignature */ 1102 /* dwSignature */
1104 put_unaligned_le32(ncm->ndp_sign, ntb_ndp); 1103 put_unaligned_le32(ncm->ndp_sign, ntb_ndp);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5af5385a0e72..454ea37dddbb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1893,11 +1893,11 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
1893/* 1893/*
1894 * Add data to an sk_buff 1894 * Add data to an sk_buff
1895 */ 1895 */
1896unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); 1896void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len);
1897unsigned char *skb_put(struct sk_buff *skb, unsigned int len); 1897void *skb_put(struct sk_buff *skb, unsigned int len);
1898static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) 1898static inline void *__skb_put(struct sk_buff *skb, unsigned int len)
1899{ 1899{
1900 unsigned char *tmp = skb_tail_pointer(skb); 1900 void *tmp = skb_tail_pointer(skb);
1901 SKB_LINEAR_ASSERT(skb); 1901 SKB_LINEAR_ASSERT(skb);
1902 skb->tail += len; 1902 skb->tail += len;
1903 skb->len += len; 1903 skb->len += len;
diff --git a/lib/nlattr.c b/lib/nlattr.c
index ab15a6c095d3..a0c738aa6a79 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -352,7 +352,7 @@ struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen)
352{ 352{
353 struct nlattr *nla; 353 struct nlattr *nla;
354 354
355 nla = (struct nlattr *) skb_put(skb, nla_total_size(attrlen)); 355 nla = skb_put(skb, nla_total_size(attrlen));
356 nla->nla_type = attrtype; 356 nla->nla_type = attrtype;
357 nla->nla_len = nla_attr_size(attrlen); 357 nla->nla_len = nla_attr_size(attrlen);
358 358
diff --git a/net/802/garp.c b/net/802/garp.c
index b38ee6dcba45..a9a266569293 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -221,7 +221,7 @@ static int garp_pdu_init(struct garp_applicant *app)
221 skb->protocol = htons(ETH_P_802_2); 221 skb->protocol = htons(ETH_P_802_2);
222 skb_reserve(skb, LL_RESERVED_SPACE(app->dev) + LLC_RESERVE); 222 skb_reserve(skb, LL_RESERVED_SPACE(app->dev) + LLC_RESERVE);
223 223
224 gp = (struct garp_pdu_hdr *)__skb_put(skb, sizeof(*gp)); 224 gp = __skb_put(skb, sizeof(*gp));
225 put_unaligned(htons(GARP_PROTOCOL_ID), &gp->protocol); 225 put_unaligned(htons(GARP_PROTOCOL_ID), &gp->protocol);
226 226
227 app->pdu = skb; 227 app->pdu = skb;
@@ -268,7 +268,7 @@ static int garp_pdu_append_msg(struct garp_applicant *app, u8 attrtype)
268 268
269 if (skb_tailroom(app->pdu) < sizeof(*gm)) 269 if (skb_tailroom(app->pdu) < sizeof(*gm))
270 return -1; 270 return -1;
271 gm = (struct garp_msg_hdr *)__skb_put(app->pdu, sizeof(*gm)); 271 gm = __skb_put(app->pdu, sizeof(*gm));
272 gm->attrtype = attrtype; 272 gm->attrtype = attrtype;
273 garp_cb(app->pdu)->cur_type = attrtype; 273 garp_cb(app->pdu)->cur_type = attrtype;
274 return 0; 274 return 0;
@@ -299,7 +299,7 @@ again:
299 len = sizeof(*ga) + attr->dlen; 299 len = sizeof(*ga) + attr->dlen;
300 if (skb_tailroom(app->pdu) < len) 300 if (skb_tailroom(app->pdu) < len)
301 goto queue; 301 goto queue;
302 ga = (struct garp_attr_hdr *)__skb_put(app->pdu, len); 302 ga = __skb_put(app->pdu, len);
303 ga->len = len; 303 ga->len = len;
304 ga->event = event; 304 ga->event = event;
305 memcpy(ga->data, attr->data, attr->dlen); 305 memcpy(ga->data, attr->data, attr->dlen);
diff --git a/net/802/mrp.c b/net/802/mrp.c
index 72db2785ef2c..be4dd3165347 100644
--- a/net/802/mrp.c
+++ b/net/802/mrp.c
@@ -311,7 +311,7 @@ static int mrp_pdu_init(struct mrp_applicant *app)
311 skb_reset_network_header(skb); 311 skb_reset_network_header(skb);
312 skb_reset_transport_header(skb); 312 skb_reset_transport_header(skb);
313 313
314 ph = (struct mrp_pdu_hdr *)__skb_put(skb, sizeof(*ph)); 314 ph = __skb_put(skb, sizeof(*ph));
315 ph->version = app->app->version; 315 ph->version = app->app->version;
316 316
317 app->pdu = skb; 317 app->pdu = skb;
@@ -324,7 +324,7 @@ static int mrp_pdu_append_end_mark(struct mrp_applicant *app)
324 324
325 if (skb_tailroom(app->pdu) < sizeof(*endmark)) 325 if (skb_tailroom(app->pdu) < sizeof(*endmark))
326 return -1; 326 return -1;
327 endmark = (__be16 *)__skb_put(app->pdu, sizeof(*endmark)); 327 endmark = __skb_put(app->pdu, sizeof(*endmark));
328 put_unaligned(MRP_END_MARK, endmark); 328 put_unaligned(MRP_END_MARK, endmark);
329 return 0; 329 return 0;
330} 330}
@@ -368,7 +368,7 @@ static int mrp_pdu_append_msg_hdr(struct mrp_applicant *app,
368 368
369 if (skb_tailroom(app->pdu) < sizeof(*mh)) 369 if (skb_tailroom(app->pdu) < sizeof(*mh))
370 return -1; 370 return -1;
371 mh = (struct mrp_msg_hdr *)__skb_put(app->pdu, sizeof(*mh)); 371 mh = __skb_put(app->pdu, sizeof(*mh));
372 mh->attrtype = attrtype; 372 mh->attrtype = attrtype;
373 mh->attrlen = attrlen; 373 mh->attrlen = attrlen;
374 mrp_cb(app->pdu)->mh = mh; 374 mrp_cb(app->pdu)->mh = mh;
@@ -382,8 +382,7 @@ static int mrp_pdu_append_vecattr_hdr(struct mrp_applicant *app,
382 382
383 if (skb_tailroom(app->pdu) < sizeof(*vah) + attrlen) 383 if (skb_tailroom(app->pdu) < sizeof(*vah) + attrlen)
384 return -1; 384 return -1;
385 vah = (struct mrp_vecattr_hdr *)__skb_put(app->pdu, 385 vah = __skb_put(app->pdu, sizeof(*vah) + attrlen);
386 sizeof(*vah) + attrlen);
387 put_unaligned(0, &vah->lenflags); 386 put_unaligned(0, &vah->lenflags);
388 memcpy(vah->firstattrvalue, firstattrvalue, attrlen); 387 memcpy(vah->firstattrvalue, firstattrvalue, attrlen);
389 mrp_cb(app->pdu)->vah = vah; 388 mrp_cb(app->pdu)->vah = vah;
@@ -435,7 +434,7 @@ again:
435 if (!pos) { 434 if (!pos) {
436 if (skb_tailroom(app->pdu) < sizeof(u8)) 435 if (skb_tailroom(app->pdu) < sizeof(u8))
437 goto queue; 436 goto queue;
438 vaevents = (u8 *)__skb_put(app->pdu, sizeof(u8)); 437 vaevents = __skb_put(app->pdu, sizeof(u8));
439 } else { 438 } else {
440 vaevents = (u8 *)(skb_tail_pointer(app->pdu) - sizeof(u8)); 439 vaevents = (u8 *)(skb_tail_pointer(app->pdu) - sizeof(u8));
441 } 440 }
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 465cc24b41e5..c7af6dc70fa2 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1647,7 +1647,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
1647 1647
1648 SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk); 1648 SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk);
1649 1649
1650 ddp = (struct ddpehdr *)skb_put(skb, sizeof(struct ddpehdr)); 1650 ddp = skb_put(skb, sizeof(struct ddpehdr));
1651 ddp->deh_len_hops = htons(len + sizeof(*ddp)); 1651 ddp->deh_len_hops = htons(len + sizeof(*ddp));
1652 ddp->deh_dnet = usat->sat_addr.s_net; 1652 ddp->deh_dnet = usat->sat_addr.s_net;
1653 ddp->deh_snet = at->src_net; 1653 ddp->deh_snet = at->src_net;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index ec527b62f79d..a7e4018370b4 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -60,7 +60,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
60 skb = alloc_skb(sizeof(struct atmarp_ctrl), GFP_ATOMIC); 60 skb = alloc_skb(sizeof(struct atmarp_ctrl), GFP_ATOMIC);
61 if (!skb) 61 if (!skb)
62 return -ENOMEM; 62 return -ENOMEM;
63 ctrl = (struct atmarp_ctrl *)skb_put(skb, sizeof(struct atmarp_ctrl)); 63 ctrl = skb_put(skb, sizeof(struct atmarp_ctrl));
64 ctrl->type = type; 64 ctrl->type = type;
65 ctrl->itf_num = itf; 65 ctrl->itf_num = itf;
66 ctrl->ip = ip; 66 ctrl->ip = ip;
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 6308c9f0fd96..8ead292886d1 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -207,7 +207,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
207 207
208 skb->priority = TC_PRIO_CONTROL; 208 skb->priority = TC_PRIO_CONTROL;
209 skb_reserve(skb, ETH_HLEN); 209 skb_reserve(skb, ETH_HLEN);
210 icmp_header = (struct batadv_icmp_header *)skb_put(skb, packet_len); 210 icmp_header = skb_put(skb, packet_len);
211 211
212 if (copy_from_user(icmp_header, buff, packet_len)) { 212 if (copy_from_user(icmp_header, buff, packet_len)) {
213 len = -EFAULT; 213 len = -EFAULT;
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index e3e2585d0977..bfe8effe9238 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -595,7 +595,7 @@ static int batadv_tp_send_msg(struct batadv_tp_vars *tp_vars, const u8 *src,
595 return BATADV_TP_REASON_MEMORY_ERROR; 595 return BATADV_TP_REASON_MEMORY_ERROR;
596 596
597 skb_reserve(skb, ETH_HLEN); 597 skb_reserve(skb, ETH_HLEN);
598 icmp = (struct batadv_icmp_tp_packet *)skb_put(skb, sizeof(*icmp)); 598 icmp = skb_put(skb, sizeof(*icmp));
599 599
600 /* fill the icmp header */ 600 /* fill the icmp header */
601 ether_addr_copy(icmp->dst, orig_node->orig); 601 ether_addr_copy(icmp->dst, orig_node->orig);
@@ -612,7 +612,7 @@ static int batadv_tp_send_msg(struct batadv_tp_vars *tp_vars, const u8 *src,
612 icmp->timestamp = htonl(timestamp); 612 icmp->timestamp = htonl(timestamp);
613 613
614 data_len = len - sizeof(*icmp); 614 data_len = len - sizeof(*icmp);
615 data = (u8 *)skb_put(skb, data_len); 615 data = skb_put(skb, data_len);
616 batadv_tp_fill_prerandom(tp_vars, data, data_len); 616 batadv_tp_fill_prerandom(tp_vars, data, data_len);
617 617
618 r = batadv_send_skb_to_orig(skb, orig_node, NULL); 618 r = batadv_send_skb_to_orig(skb, orig_node, NULL);
@@ -1190,7 +1190,7 @@ static int batadv_tp_send_ack(struct batadv_priv *bat_priv, const u8 *dst,
1190 } 1190 }
1191 1191
1192 skb_reserve(skb, ETH_HLEN); 1192 skb_reserve(skb, ETH_HLEN);
1193 icmp = (struct batadv_icmp_tp_packet *)skb_put(skb, sizeof(*icmp)); 1193 icmp = skb_put(skb, sizeof(*icmp));
1194 icmp->packet_type = BATADV_ICMP; 1194 icmp->packet_type = BATADV_ICMP;
1195 icmp->version = BATADV_COMPAT_VERSION; 1195 icmp->version = BATADV_COMPAT_VERSION;
1196 icmp->ttl = BATADV_TTL; 1196 icmp->ttl = BATADV_TTL;
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 4e4105a932bd..b73ac149de34 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -299,7 +299,7 @@ struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen,
299 if (!skb) 299 if (!skb)
300 return NULL; 300 return NULL;
301 301
302 hdr = (struct hci_command_hdr *) skb_put(skb, HCI_COMMAND_HDR_SIZE); 302 hdr = skb_put(skb, HCI_COMMAND_HDR_SIZE);
303 hdr->opcode = cpu_to_le16(opcode); 303 hdr->opcode = cpu_to_le16(opcode);
304 hdr->plen = plen; 304 hdr->plen = plen;
305 305
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 083e87f26a0f..1301a8786d8d 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -410,7 +410,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)
410 if (!skb) 410 if (!skb)
411 return NULL; 411 return NULL;
412 412
413 ni = (void *)skb_put(skb, HCI_MON_NEW_INDEX_SIZE); 413 ni = skb_put(skb, HCI_MON_NEW_INDEX_SIZE);
414 ni->type = hdev->dev_type; 414 ni->type = hdev->dev_type;
415 ni->bus = hdev->bus; 415 ni->bus = hdev->bus;
416 bacpy(&ni->bdaddr, &hdev->bdaddr); 416 bacpy(&ni->bdaddr, &hdev->bdaddr);
@@ -438,7 +438,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)
438 if (!skb) 438 if (!skb)
439 return NULL; 439 return NULL;
440 440
441 ii = (void *)skb_put(skb, HCI_MON_INDEX_INFO_SIZE); 441 ii = skb_put(skb, HCI_MON_INDEX_INFO_SIZE);
442 bacpy(&ii->bdaddr, &hdev->bdaddr); 442 bacpy(&ii->bdaddr, &hdev->bdaddr);
443 ii->manufacturer = cpu_to_le16(hdev->manufacturer); 443 ii->manufacturer = cpu_to_le16(hdev->manufacturer);
444 444
@@ -517,7 +517,7 @@ static struct sk_buff *create_monitor_ctrl_open(struct sock *sk)
517 put_unaligned_le16(format, skb_put(skb, 2)); 517 put_unaligned_le16(format, skb_put(skb, 2));
518 skb_put_data(skb, ver, sizeof(ver)); 518 skb_put_data(skb, ver, sizeof(ver));
519 put_unaligned_le32(flags, skb_put(skb, 4)); 519 put_unaligned_le32(flags, skb_put(skb, 4));
520 *skb_put(skb, 1) = TASK_COMM_LEN; 520 *(u8 *)skb_put(skb, 1) = TASK_COMM_LEN;
521 skb_put_data(skb, hci_pi(sk)->comm, TASK_COMM_LEN); 521 skb_put_data(skb, hci_pi(sk)->comm, TASK_COMM_LEN);
522 522
523 __net_timestamp(skb); 523 __net_timestamp(skb);
@@ -616,7 +616,7 @@ send_monitor_note(struct sock *sk, const char *fmt, ...)
616 616
617 va_start(args, fmt); 617 va_start(args, fmt);
618 vsprintf(skb_put(skb, len), fmt, args); 618 vsprintf(skb_put(skb, len), fmt, args);
619 *skb_put(skb, 1) = 0; 619 *(u8 *)skb_put(skb, 1) = 0;
620 va_end(args); 620 va_end(args);
621 621
622 __net_timestamp(skb); 622 __net_timestamp(skb);
@@ -703,11 +703,11 @@ static void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
703 if (!skb) 703 if (!skb)
704 return; 704 return;
705 705
706 hdr = (void *)skb_put(skb, HCI_EVENT_HDR_SIZE); 706 hdr = skb_put(skb, HCI_EVENT_HDR_SIZE);
707 hdr->evt = HCI_EV_STACK_INTERNAL; 707 hdr->evt = HCI_EV_STACK_INTERNAL;
708 hdr->plen = sizeof(*ev) + dlen; 708 hdr->plen = sizeof(*ev) + dlen;
709 709
710 ev = (void *)skb_put(skb, sizeof(*ev) + dlen); 710 ev = skb_put(skb, sizeof(*ev) + dlen);
711 ev->type = type; 711 ev->type = type;
712 memcpy(ev->data, data, dlen); 712 memcpy(ev->data, data, dlen);
713 713
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 9e83713262e8..c0d0832a023d 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -112,7 +112,7 @@ static int hidp_send_message(struct hidp_session *session, struct socket *sock,
112 return -ENOMEM; 112 return -ENOMEM;
113 } 113 }
114 114
115 *skb_put(skb, 1) = hdr; 115 *(u8 *)skb_put(skb, 1) = hdr;
116 if (data && size > 0) 116 if (data && size > 0)
117 skb_put_data(skb, data, size); 117 skb_put_data(skb, data, size);
118 118
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index fe6a5529bdf5..303c779bfe38 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1048,7 +1048,7 @@ static struct sk_buff *l2cap_create_sframe_pdu(struct l2cap_chan *chan,
1048 if (!skb) 1048 if (!skb)
1049 return ERR_PTR(-ENOMEM); 1049 return ERR_PTR(-ENOMEM);
1050 1050
1051 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 1051 lh = skb_put(skb, L2CAP_HDR_SIZE);
1052 lh->len = cpu_to_le16(hlen - L2CAP_HDR_SIZE); 1052 lh->len = cpu_to_le16(hlen - L2CAP_HDR_SIZE);
1053 lh->cid = cpu_to_le16(chan->dcid); 1053 lh->cid = cpu_to_le16(chan->dcid);
1054 1054
@@ -2182,7 +2182,7 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
2182 return skb; 2182 return skb;
2183 2183
2184 /* Create L2CAP header */ 2184 /* Create L2CAP header */
2185 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 2185 lh = skb_put(skb, L2CAP_HDR_SIZE);
2186 lh->cid = cpu_to_le16(chan->dcid); 2186 lh->cid = cpu_to_le16(chan->dcid);
2187 lh->len = cpu_to_le16(len + L2CAP_PSMLEN_SIZE); 2187 lh->len = cpu_to_le16(len + L2CAP_PSMLEN_SIZE);
2188 put_unaligned(chan->psm, (__le16 *) skb_put(skb, L2CAP_PSMLEN_SIZE)); 2188 put_unaligned(chan->psm, (__le16 *) skb_put(skb, L2CAP_PSMLEN_SIZE));
@@ -2213,7 +2213,7 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
2213 return skb; 2213 return skb;
2214 2214
2215 /* Create L2CAP header */ 2215 /* Create L2CAP header */
2216 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 2216 lh = skb_put(skb, L2CAP_HDR_SIZE);
2217 lh->cid = cpu_to_le16(chan->dcid); 2217 lh->cid = cpu_to_le16(chan->dcid);
2218 lh->len = cpu_to_le16(len); 2218 lh->len = cpu_to_le16(len);
2219 2219
@@ -2255,7 +2255,7 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
2255 return skb; 2255 return skb;
2256 2256
2257 /* Create L2CAP header */ 2257 /* Create L2CAP header */
2258 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 2258 lh = skb_put(skb, L2CAP_HDR_SIZE);
2259 lh->cid = cpu_to_le16(chan->dcid); 2259 lh->cid = cpu_to_le16(chan->dcid);
2260 lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE)); 2260 lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
2261 2261
@@ -2373,7 +2373,7 @@ static struct sk_buff *l2cap_create_le_flowctl_pdu(struct l2cap_chan *chan,
2373 return skb; 2373 return skb;
2374 2374
2375 /* Create L2CAP header */ 2375 /* Create L2CAP header */
2376 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 2376 lh = skb_put(skb, L2CAP_HDR_SIZE);
2377 lh->cid = cpu_to_le16(chan->dcid); 2377 lh->cid = cpu_to_le16(chan->dcid);
2378 lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE)); 2378 lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
2379 2379
@@ -2908,7 +2908,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
2908 if (!skb) 2908 if (!skb)
2909 return NULL; 2909 return NULL;
2910 2910
2911 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 2911 lh = skb_put(skb, L2CAP_HDR_SIZE);
2912 lh->len = cpu_to_le16(L2CAP_CMD_HDR_SIZE + dlen); 2912 lh->len = cpu_to_le16(L2CAP_CMD_HDR_SIZE + dlen);
2913 2913
2914 if (conn->hcon->type == LE_LINK) 2914 if (conn->hcon->type == LE_LINK)
@@ -2916,7 +2916,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
2916 else 2916 else
2917 lh->cid = cpu_to_le16(L2CAP_CID_SIGNALING); 2917 lh->cid = cpu_to_le16(L2CAP_CID_SIGNALING);
2918 2918
2919 cmd = (struct l2cap_cmd_hdr *) skb_put(skb, L2CAP_CMD_HDR_SIZE); 2919 cmd = skb_put(skb, L2CAP_CMD_HDR_SIZE);
2920 cmd->code = code; 2920 cmd->code = code;
2921 cmd->ident = ident; 2921 cmd->ident = ident;
2922 cmd->len = cpu_to_le16(dlen); 2922 cmd->len = cpu_to_le16(dlen);
diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c
index 11d0ca64402b..d057113e0d4b 100644
--- a/net/bluetooth/mgmt_util.c
+++ b/net/bluetooth/mgmt_util.c
@@ -66,7 +66,7 @@ int mgmt_send_event(u16 event, struct hci_dev *hdev, unsigned short channel,
66 if (!skb) 66 if (!skb)
67 return -ENOMEM; 67 return -ENOMEM;
68 68
69 hdr = (void *) skb_put(skb, sizeof(*hdr)); 69 hdr = skb_put(skb, sizeof(*hdr));
70 hdr->opcode = cpu_to_le16(event); 70 hdr->opcode = cpu_to_le16(event);
71 if (hdev) 71 if (hdev)
72 hdr->index = cpu_to_le16(hdev->id); 72 hdr->index = cpu_to_le16(hdev->id);
@@ -103,13 +103,13 @@ int mgmt_cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status)
103 if (!skb) 103 if (!skb)
104 return -ENOMEM; 104 return -ENOMEM;
105 105
106 hdr = (void *) skb_put(skb, sizeof(*hdr)); 106 hdr = skb_put(skb, sizeof(*hdr));
107 107
108 hdr->opcode = cpu_to_le16(MGMT_EV_CMD_STATUS); 108 hdr->opcode = cpu_to_le16(MGMT_EV_CMD_STATUS);
109 hdr->index = cpu_to_le16(index); 109 hdr->index = cpu_to_le16(index);
110 hdr->len = cpu_to_le16(sizeof(*ev)); 110 hdr->len = cpu_to_le16(sizeof(*ev));
111 111
112 ev = (void *) skb_put(skb, sizeof(*ev)); 112 ev = skb_put(skb, sizeof(*ev));
113 ev->status = status; 113 ev->status = status;
114 ev->opcode = cpu_to_le16(cmd); 114 ev->opcode = cpu_to_le16(cmd);
115 115
@@ -147,13 +147,13 @@ int mgmt_cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status,
147 if (!skb) 147 if (!skb)
148 return -ENOMEM; 148 return -ENOMEM;
149 149
150 hdr = (void *) skb_put(skb, sizeof(*hdr)); 150 hdr = skb_put(skb, sizeof(*hdr));
151 151
152 hdr->opcode = cpu_to_le16(MGMT_EV_CMD_COMPLETE); 152 hdr->opcode = cpu_to_le16(MGMT_EV_CMD_COMPLETE);
153 hdr->index = cpu_to_le16(index); 153 hdr->index = cpu_to_le16(index);
154 hdr->len = cpu_to_le16(sizeof(*ev) + rp_len); 154 hdr->len = cpu_to_le16(sizeof(*ev) + rp_len);
155 155
156 ev = (void *) skb_put(skb, sizeof(*ev) + rp_len); 156 ev = skb_put(skb, sizeof(*ev) + rp_len);
157 ev->opcode = cpu_to_le16(cmd); 157 ev->opcode = cpu_to_le16(cmd);
158 ev->status = status; 158 ev->status = status;
159 159
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 8ebca9033d60..1a9b906c5a35 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -863,7 +863,7 @@ static int rfcomm_queue_disc(struct rfcomm_dlc *d)
863 if (!skb) 863 if (!skb)
864 return -ENOMEM; 864 return -ENOMEM;
865 865
866 cmd = (void *) __skb_put(skb, sizeof(*cmd)); 866 cmd = __skb_put(skb, sizeof(*cmd));
867 cmd->addr = d->addr; 867 cmd->addr = d->addr;
868 cmd->ctrl = __ctrl(RFCOMM_DISC, 1); 868 cmd->ctrl = __ctrl(RFCOMM_DISC, 1);
869 cmd->len = __len8(0); 869 cmd->len = __len8(0);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 8860ad985d68..b8bcf9021329 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2714,7 +2714,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
2714 struct timeval timestamp; 2714 struct timeval timestamp;
2715 struct pktgen_hdr *pgh; 2715 struct pktgen_hdr *pgh;
2716 2716
2717 pgh = (struct pktgen_hdr *)skb_put(skb, sizeof(*pgh)); 2717 pgh = skb_put(skb, sizeof(*pgh));
2718 datalen -= sizeof(*pgh); 2718 datalen -= sizeof(*pgh);
2719 2719
2720 if (pkt_dev->nfrags <= 0) { 2720 if (pkt_dev->nfrags <= 0) {
@@ -2845,33 +2845,34 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
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 = (__u8 *) skb_push(skb, 14);
2848 mpls = (__be32 *)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);
2851 2851
2852 if (pkt_dev->vlan_id != 0xffff) { 2852 if (pkt_dev->vlan_id != 0xffff) {
2853 if (pkt_dev->svlan_id != 0xffff) { 2853 if (pkt_dev->svlan_id != 0xffff) {
2854 svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2854 svlan_tci = skb_put(skb, sizeof(__be16));
2855 *svlan_tci = build_tci(pkt_dev->svlan_id, 2855 *svlan_tci = build_tci(pkt_dev->svlan_id,
2856 pkt_dev->svlan_cfi, 2856 pkt_dev->svlan_cfi,
2857 pkt_dev->svlan_p); 2857 pkt_dev->svlan_p);
2858 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2858 svlan_encapsulated_proto = skb_put(skb,
2859 sizeof(__be16));
2859 *svlan_encapsulated_proto = htons(ETH_P_8021Q); 2860 *svlan_encapsulated_proto = htons(ETH_P_8021Q);
2860 } 2861 }
2861 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2862 vlan_tci = skb_put(skb, sizeof(__be16));
2862 *vlan_tci = build_tci(pkt_dev->vlan_id, 2863 *vlan_tci = build_tci(pkt_dev->vlan_id,
2863 pkt_dev->vlan_cfi, 2864 pkt_dev->vlan_cfi,
2864 pkt_dev->vlan_p); 2865 pkt_dev->vlan_p);
2865 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2866 vlan_encapsulated_proto = skb_put(skb, sizeof(__be16));
2866 *vlan_encapsulated_proto = htons(ETH_P_IP); 2867 *vlan_encapsulated_proto = htons(ETH_P_IP);
2867 } 2868 }
2868 2869
2869 skb_reset_mac_header(skb); 2870 skb_reset_mac_header(skb);
2870 skb_set_network_header(skb, skb->len); 2871 skb_set_network_header(skb, skb->len);
2871 iph = (struct iphdr *) skb_put(skb, sizeof(struct iphdr)); 2872 iph = skb_put(skb, sizeof(struct iphdr));
2872 2873
2873 skb_set_transport_header(skb, skb->len); 2874 skb_set_transport_header(skb, skb->len);
2874 udph = (struct udphdr *) skb_put(skb, sizeof(struct udphdr)); 2875 udph = skb_put(skb, sizeof(struct udphdr));
2875 skb_set_queue_mapping(skb, queue_map); 2876 skb_set_queue_mapping(skb, queue_map);
2876 skb->priority = pkt_dev->skb_priority; 2877 skb->priority = pkt_dev->skb_priority;
2877 2878
@@ -2972,33 +2973,34 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2972 2973
2973 /* Reserve for ethernet and IP header */ 2974 /* Reserve for ethernet and IP header */
2974 eth = (__u8 *) skb_push(skb, 14); 2975 eth = (__u8 *) skb_push(skb, 14);
2975 mpls = (__be32 *)skb_put(skb, pkt_dev->nr_labels*sizeof(__u32)); 2976 mpls = skb_put(skb, pkt_dev->nr_labels * sizeof(__u32));
2976 if (pkt_dev->nr_labels) 2977 if (pkt_dev->nr_labels)
2977 mpls_push(mpls, pkt_dev); 2978 mpls_push(mpls, pkt_dev);
2978 2979
2979 if (pkt_dev->vlan_id != 0xffff) { 2980 if (pkt_dev->vlan_id != 0xffff) {
2980 if (pkt_dev->svlan_id != 0xffff) { 2981 if (pkt_dev->svlan_id != 0xffff) {
2981 svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2982 svlan_tci = skb_put(skb, sizeof(__be16));
2982 *svlan_tci = build_tci(pkt_dev->svlan_id, 2983 *svlan_tci = build_tci(pkt_dev->svlan_id,
2983 pkt_dev->svlan_cfi, 2984 pkt_dev->svlan_cfi,
2984 pkt_dev->svlan_p); 2985 pkt_dev->svlan_p);
2985 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2986 svlan_encapsulated_proto = skb_put(skb,
2987 sizeof(__be16));
2986 *svlan_encapsulated_proto = htons(ETH_P_8021Q); 2988 *svlan_encapsulated_proto = htons(ETH_P_8021Q);
2987 } 2989 }
2988 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2990 vlan_tci = skb_put(skb, sizeof(__be16));
2989 *vlan_tci = build_tci(pkt_dev->vlan_id, 2991 *vlan_tci = build_tci(pkt_dev->vlan_id,
2990 pkt_dev->vlan_cfi, 2992 pkt_dev->vlan_cfi,
2991 pkt_dev->vlan_p); 2993 pkt_dev->vlan_p);
2992 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2994 vlan_encapsulated_proto = skb_put(skb, sizeof(__be16));
2993 *vlan_encapsulated_proto = htons(ETH_P_IPV6); 2995 *vlan_encapsulated_proto = htons(ETH_P_IPV6);
2994 } 2996 }
2995 2997
2996 skb_reset_mac_header(skb); 2998 skb_reset_mac_header(skb);
2997 skb_set_network_header(skb, skb->len); 2999 skb_set_network_header(skb, skb->len);
2998 iph = (struct ipv6hdr *) skb_put(skb, sizeof(struct ipv6hdr)); 3000 iph = skb_put(skb, sizeof(struct ipv6hdr));
2999 3001
3000 skb_set_transport_header(skb, skb->len); 3002 skb_set_transport_header(skb, skb->len);
3001 udph = (struct udphdr *) skb_put(skb, sizeof(struct udphdr)); 3003 udph = skb_put(skb, sizeof(struct udphdr));
3002 skb_set_queue_mapping(skb, queue_map); 3004 skb_set_queue_mapping(skb, queue_map);
3003 skb->priority = pkt_dev->skb_priority; 3005 skb->priority = pkt_dev->skb_priority;
3004 3006
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c4d2c1f824bb..0baa7f2dd8ef 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1421,7 +1421,7 @@ EXPORT_SYMBOL(skb_pad);
1421 * returned. 1421 * returned.
1422 */ 1422 */
1423 1423
1424unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len) 1424void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
1425{ 1425{
1426 if (tail != skb) { 1426 if (tail != skb) {
1427 skb->data_len += len; 1427 skb->data_len += len;
@@ -1440,9 +1440,9 @@ EXPORT_SYMBOL_GPL(pskb_put);
1440 * exceed the total buffer size the kernel will panic. A pointer to the 1440 * exceed the total buffer size the kernel will panic. A pointer to the
1441 * first byte of the extra data is returned. 1441 * first byte of the extra data is returned.
1442 */ 1442 */
1443unsigned char *skb_put(struct sk_buff *skb, unsigned int len) 1443void *skb_put(struct sk_buff *skb, unsigned int len)
1444{ 1444{
1445 unsigned char *tmp = skb_tail_pointer(skb); 1445 void *tmp = skb_tail_pointer(skb);
1446 SKB_LINEAR_ASSERT(skb); 1446 SKB_LINEAR_ASSERT(skb);
1447 skb->tail += len; 1447 skb->tail += len;
1448 skb->len += len; 1448 skb->len += len;
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 9017a9a73ab5..1d84f6dae315 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -846,7 +846,7 @@ static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa)
846 846
847 skb->dev = dev; 847 skb->dev = dev;
848 848
849 msg = (struct endnode_hello_message *)skb_put(skb,sizeof(*msg)); 849 msg = skb_put(skb, sizeof(*msg));
850 850
851 msg->msgflg = 0x0D; 851 msg->msgflg = 0x0D;
852 memcpy(msg->tiver, dn_eco_version, 3); 852 memcpy(msg->tiver, dn_eco_version, 3);
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index b8a558715395..7e054b2f270a 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -484,7 +484,7 @@ void dn_send_conn_ack (struct sock *sk)
484 if ((skb = dn_alloc_skb(sk, 3, sk->sk_allocation)) == NULL) 484 if ((skb = dn_alloc_skb(sk, 3, sk->sk_allocation)) == NULL)
485 return; 485 return;
486 486
487 msg = (struct nsp_conn_ack_msg *)skb_put(skb, 3); 487 msg = skb_put(skb, 3);
488 msg->msgflg = 0x24; 488 msg->msgflg = 0x24;
489 msg->dstaddr = scp->addrrem; 489 msg->dstaddr = scp->addrrem;
490 490
@@ -522,7 +522,7 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
522 if ((skb = dn_alloc_skb(sk, 50 + len, gfp)) == NULL) 522 if ((skb = dn_alloc_skb(sk, 50 + len, gfp)) == NULL)
523 return; 523 return;
524 524
525 msg = (struct nsp_conn_init_msg *)skb_put(skb, sizeof(*msg)); 525 msg = skb_put(skb, sizeof(*msg));
526 msg->msgflg = 0x28; 526 msg->msgflg = 0x28;
527 msg->dstaddr = scp->addrrem; 527 msg->dstaddr = scp->addrrem;
528 msg->srcaddr = scp->addrloc; 528 msg->srcaddr = scp->addrloc;
@@ -530,7 +530,7 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
530 msg->info = scp->info_loc; 530 msg->info = scp->info_loc;
531 msg->segsize = cpu_to_le16(scp->segsize_loc); 531 msg->segsize = cpu_to_le16(scp->segsize_loc);
532 532
533 *skb_put(skb,1) = len; 533 *(u8 *)skb_put(skb, 1) = len;
534 534
535 if (len > 0) 535 if (len > 0)
536 skb_put_data(skb, scp->conndata_out.opt_data, len); 536 skb_put_data(skb, scp->conndata_out.opt_data, len);
@@ -662,7 +662,7 @@ void dn_nsp_send_conninit(struct sock *sk, unsigned char msgflg)
662 return; 662 return;
663 663
664 cb = DN_SKB_CB(skb); 664 cb = DN_SKB_CB(skb);
665 msg = (struct nsp_conn_init_msg *)skb_put(skb,sizeof(*msg)); 665 msg = skb_put(skb, sizeof(*msg));
666 666
667 msg->msgflg = msgflg; 667 msg->msgflg = msgflg;
668 msg->dstaddr = 0x0000; /* Remote Node will assign it*/ 668 msg->dstaddr = 0x0000; /* Remote Node will assign it*/
@@ -686,25 +686,25 @@ void dn_nsp_send_conninit(struct sock *sk, unsigned char msgflg)
686 if (scp->peer.sdn_flags & SDF_UICPROXY) 686 if (scp->peer.sdn_flags & SDF_UICPROXY)
687 menuver |= DN_MENUVER_UIC; 687 menuver |= DN_MENUVER_UIC;
688 688
689 *skb_put(skb, 1) = menuver; /* Menu Version */ 689 *(u8 *)skb_put(skb, 1) = menuver; /* Menu Version */
690 690
691 aux = scp->accessdata.acc_userl; 691 aux = scp->accessdata.acc_userl;
692 *skb_put(skb, 1) = aux; 692 *(u8 *)skb_put(skb, 1) = aux;
693 if (aux > 0) 693 if (aux > 0)
694 skb_put_data(skb, scp->accessdata.acc_user, aux); 694 skb_put_data(skb, scp->accessdata.acc_user, aux);
695 695
696 aux = scp->accessdata.acc_passl; 696 aux = scp->accessdata.acc_passl;
697 *skb_put(skb, 1) = aux; 697 *(u8 *)skb_put(skb, 1) = aux;
698 if (aux > 0) 698 if (aux > 0)
699 skb_put_data(skb, scp->accessdata.acc_pass, aux); 699 skb_put_data(skb, scp->accessdata.acc_pass, aux);
700 700
701 aux = scp->accessdata.acc_accl; 701 aux = scp->accessdata.acc_accl;
702 *skb_put(skb, 1) = aux; 702 *(u8 *)skb_put(skb, 1) = aux;
703 if (aux > 0) 703 if (aux > 0)
704 skb_put_data(skb, scp->accessdata.acc_acc, aux); 704 skb_put_data(skb, scp->accessdata.acc_acc, aux);
705 705
706 aux = (__u8)le16_to_cpu(scp->conndata_out.opt_optl); 706 aux = (__u8)le16_to_cpu(scp->conndata_out.opt_optl);
707 *skb_put(skb, 1) = aux; 707 *(u8 *)skb_put(skb, 1) = aux;
708 if (aux > 0) 708 if (aux > 0)
709 skb_put_data(skb, scp->conndata_out.opt_data, aux); 709 skb_put_data(skb, scp->conndata_out.opt_data, aux);
710 710
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index a651c53260ec..8b52179ddc6e 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -539,7 +539,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
539 539
540 skb_reserve(skb, hlen); 540 skb_reserve(skb, hlen);
541 skb_reset_network_header(skb); 541 skb_reset_network_header(skb);
542 arp = (struct arphdr *) skb_put(skb, arp_hdr_len(dev)); 542 arp = skb_put(skb, arp_hdr_len(dev));
543 skb->dev = dev; 543 skb->dev = dev;
544 skb->protocol = htons(ETH_P_ARP); 544 skb->protocol = htons(ETH_P_ARP);
545 if (!src_hw) 545 if (!src_hw)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 8f6b5bbcbf69..2202edf31884 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -414,7 +414,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc,
414 skb = igmpv3_newpack(dev, dev->mtu); 414 skb = igmpv3_newpack(dev, dev->mtu);
415 if (!skb) 415 if (!skb)
416 return NULL; 416 return NULL;
417 pgr = (struct igmpv3_grec *)skb_put(skb, sizeof(struct igmpv3_grec)); 417 pgr = skb_put(skb, sizeof(struct igmpv3_grec));
418 pgr->grec_type = type; 418 pgr->grec_type = type;
419 pgr->grec_auxwords = 0; 419 pgr->grec_auxwords = 0;
420 pgr->grec_nsrcs = 0; 420 pgr->grec_nsrcs = 0;
@@ -508,7 +508,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
508 } 508 }
509 if (!skb) 509 if (!skb)
510 return NULL; 510 return NULL;
511 psrc = (__be32 *)skb_put(skb, sizeof(__be32)); 511 psrc = skb_put(skb, sizeof(__be32));
512 *psrc = psf->sf_inaddr; 512 *psrc = psf->sf_inaddr;
513 scount++; stotal++; 513 scount++; stotal++;
514 if ((type == IGMPV3_ALLOW_NEW_SOURCES || 514 if ((type == IGMPV3_ALLOW_NEW_SOURCES ||
@@ -742,7 +742,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
742 ((u8 *)&iph[1])[2] = 0; 742 ((u8 *)&iph[1])[2] = 0;
743 ((u8 *)&iph[1])[3] = 0; 743 ((u8 *)&iph[1])[3] = 0;
744 744
745 ih = (struct igmphdr *)skb_put(skb, sizeof(struct igmphdr)); 745 ih = skb_put(skb, sizeof(struct igmphdr));
746 ih->type = type; 746 ih->type = type;
747 ih->code = 0; 747 ih->code = 0;
748 ih->csum = 0; 748 ih->csum = 0;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a1199895b8a6..abbd7c992960 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1044,7 +1044,7 @@ static int ipmr_cache_report(struct mr_table *mrt,
1044 msg->im_vif = vifi; 1044 msg->im_vif = vifi;
1045 skb_dst_set(skb, dst_clone(skb_dst(pkt))); 1045 skb_dst_set(skb, dst_clone(skb_dst(pkt)));
1046 /* Add our header */ 1046 /* Add our header */
1047 igmp = (struct igmphdr *)skb_put(skb, sizeof(struct igmphdr)); 1047 igmp = skb_put(skb, sizeof(struct igmphdr));
1048 igmp->type = assert; 1048 igmp->type = assert;
1049 msg->im_msgtype = assert; 1049 msg->im_msgtype = assert;
1050 igmp->code = 0; 1050 igmp->code = 0;
diff --git a/net/ipv4/netfilter/ipt_SYNPROXY.c b/net/ipv4/netfilter/ipt_SYNPROXY.c
index af2b69b6895f..f1528f7175a8 100644
--- a/net/ipv4/netfilter/ipt_SYNPROXY.c
+++ b/net/ipv4/netfilter/ipt_SYNPROXY.c
@@ -24,7 +24,7 @@ synproxy_build_ip(struct net *net, struct sk_buff *skb, __be32 saddr,
24 struct iphdr *iph; 24 struct iphdr *iph;
25 25
26 skb_reset_network_header(skb); 26 skb_reset_network_header(skb);
27 iph = (struct iphdr *)skb_put(skb, sizeof(*iph)); 27 iph = skb_put(skb, sizeof(*iph));
28 iph->version = 4; 28 iph->version = 4;
29 iph->ihl = sizeof(*iph) / 4; 29 iph->ihl = sizeof(*iph) / 4;
30 iph->tos = 0; 30 iph->tos = 0;
@@ -91,7 +91,7 @@ synproxy_send_client_synack(struct net *net,
91 niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr); 91 niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr);
92 92
93 skb_reset_transport_header(nskb); 93 skb_reset_transport_header(nskb);
94 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 94 nth = skb_put(nskb, tcp_hdr_size);
95 nth->source = th->dest; 95 nth->source = th->dest;
96 nth->dest = th->source; 96 nth->dest = th->source;
97 nth->seq = htonl(__cookie_v4_init_sequence(iph, th, &mss)); 97 nth->seq = htonl(__cookie_v4_init_sequence(iph, th, &mss));
@@ -133,7 +133,7 @@ synproxy_send_server_syn(struct net *net,
133 niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr); 133 niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr);
134 134
135 skb_reset_transport_header(nskb); 135 skb_reset_transport_header(nskb);
136 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 136 nth = skb_put(nskb, tcp_hdr_size);
137 nth->source = th->source; 137 nth->source = th->source;
138 nth->dest = th->dest; 138 nth->dest = th->dest;
139 nth->seq = htonl(recv_seq - 1); 139 nth->seq = htonl(recv_seq - 1);
@@ -178,7 +178,7 @@ synproxy_send_server_ack(struct net *net,
178 niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr); 178 niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr);
179 179
180 skb_reset_transport_header(nskb); 180 skb_reset_transport_header(nskb);
181 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 181 nth = skb_put(nskb, tcp_hdr_size);
182 nth->source = th->dest; 182 nth->source = th->dest;
183 nth->dest = th->source; 183 nth->dest = th->source;
184 nth->seq = htonl(ntohl(th->ack_seq)); 184 nth->seq = htonl(ntohl(th->ack_seq));
@@ -216,7 +216,7 @@ synproxy_send_client_ack(struct net *net,
216 niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr); 216 niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr);
217 217
218 skb_reset_transport_header(nskb); 218 skb_reset_transport_header(nskb);
219 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 219 nth = skb_put(nskb, tcp_hdr_size);
220 nth->source = th->source; 220 nth->source = th->source;
221 nth->dest = th->dest; 221 nth->dest = th->dest;
222 nth->seq = htonl(ntohl(th->seq) + 1); 222 nth->seq = htonl(ntohl(th->seq) + 1);
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index 52b7dcc5aaf3..eeacbdaf7cdf 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -51,7 +51,7 @@ struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb,
51 struct iphdr *niph, *oiph = ip_hdr(oldskb); 51 struct iphdr *niph, *oiph = ip_hdr(oldskb);
52 52
53 skb_reset_network_header(nskb); 53 skb_reset_network_header(nskb);
54 niph = (struct iphdr *)skb_put(nskb, sizeof(struct iphdr)); 54 niph = skb_put(nskb, sizeof(struct iphdr));
55 niph->version = 4; 55 niph->version = 4;
56 niph->ihl = sizeof(struct iphdr) / 4; 56 niph->ihl = sizeof(struct iphdr) / 4;
57 niph->tos = 0; 57 niph->tos = 0;
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index b64046ccae69..e2221135858b 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1692,7 +1692,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1692 skb = mld_newpack(pmc->idev, dev->mtu); 1692 skb = mld_newpack(pmc->idev, dev->mtu);
1693 if (!skb) 1693 if (!skb)
1694 return NULL; 1694 return NULL;
1695 pgr = (struct mld2_grec *)skb_put(skb, sizeof(struct mld2_grec)); 1695 pgr = skb_put(skb, sizeof(struct mld2_grec));
1696 pgr->grec_type = type; 1696 pgr->grec_type = type;
1697 pgr->grec_auxwords = 0; 1697 pgr->grec_auxwords = 0;
1698 pgr->grec_nsrcs = 0; 1698 pgr->grec_nsrcs = 0;
@@ -1784,7 +1784,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1784 } 1784 }
1785 if (!skb) 1785 if (!skb)
1786 return NULL; 1786 return NULL;
1787 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); 1787 psrc = skb_put(skb, sizeof(*psrc));
1788 *psrc = psf->sf_addr; 1788 *psrc = psf->sf_addr;
1789 scount++; stotal++; 1789 scount++; stotal++;
1790 if ((type == MLD2_ALLOW_NEW_SOURCES || 1790 if ((type == MLD2_ALLOW_NEW_SOURCES ||
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d310dc41209a..0327c1f2e6fc 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -528,7 +528,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
528 if (!skb) 528 if (!skb)
529 return; 529 return;
530 530
531 msg = (struct nd_msg *)skb_put(skb, sizeof(*msg)); 531 msg = skb_put(skb, sizeof(*msg));
532 *msg = (struct nd_msg) { 532 *msg = (struct nd_msg) {
533 .icmph = { 533 .icmph = {
534 .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT, 534 .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT,
@@ -597,7 +597,7 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
597 if (!skb) 597 if (!skb)
598 return; 598 return;
599 599
600 msg = (struct nd_msg *)skb_put(skb, sizeof(*msg)); 600 msg = skb_put(skb, sizeof(*msg));
601 *msg = (struct nd_msg) { 601 *msg = (struct nd_msg) {
602 .icmph = { 602 .icmph = {
603 .icmp6_type = NDISC_NEIGHBOUR_SOLICITATION, 603 .icmp6_type = NDISC_NEIGHBOUR_SOLICITATION,
@@ -657,7 +657,7 @@ void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
657 if (!skb) 657 if (!skb)
658 return; 658 return;
659 659
660 msg = (struct rs_msg *)skb_put(skb, sizeof(*msg)); 660 msg = skb_put(skb, sizeof(*msg));
661 *msg = (struct rs_msg) { 661 *msg = (struct rs_msg) {
662 .icmph = { 662 .icmph = {
663 .icmp6_type = NDISC_ROUTER_SOLICITATION, 663 .icmp6_type = NDISC_ROUTER_SOLICITATION,
@@ -1633,7 +1633,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1633 if (!buff) 1633 if (!buff)
1634 goto release; 1634 goto release;
1635 1635
1636 msg = (struct rd_msg *)skb_put(buff, sizeof(*msg)); 1636 msg = skb_put(buff, sizeof(*msg));
1637 *msg = (struct rd_msg) { 1637 *msg = (struct rd_msg) {
1638 .icmph = { 1638 .icmph = {
1639 .icmp6_type = NDISC_REDIRECT, 1639 .icmp6_type = NDISC_REDIRECT,
diff --git a/net/ipv6/netfilter/ip6t_SYNPROXY.c b/net/ipv6/netfilter/ip6t_SYNPROXY.c
index d3c4daa708b9..ce203dd729e0 100644
--- a/net/ipv6/netfilter/ip6t_SYNPROXY.c
+++ b/net/ipv6/netfilter/ip6t_SYNPROXY.c
@@ -27,7 +27,7 @@ synproxy_build_ip(struct net *net, struct sk_buff *skb,
27 struct ipv6hdr *iph; 27 struct ipv6hdr *iph;
28 28
29 skb_reset_network_header(skb); 29 skb_reset_network_header(skb);
30 iph = (struct ipv6hdr *)skb_put(skb, sizeof(*iph)); 30 iph = skb_put(skb, sizeof(*iph));
31 ip6_flow_hdr(iph, 0, 0); 31 ip6_flow_hdr(iph, 0, 0);
32 iph->hop_limit = net->ipv6.devconf_all->hop_limit; 32 iph->hop_limit = net->ipv6.devconf_all->hop_limit;
33 iph->nexthdr = IPPROTO_TCP; 33 iph->nexthdr = IPPROTO_TCP;
@@ -105,7 +105,7 @@ synproxy_send_client_synack(struct net *net,
105 niph = synproxy_build_ip(net, nskb, &iph->daddr, &iph->saddr); 105 niph = synproxy_build_ip(net, nskb, &iph->daddr, &iph->saddr);
106 106
107 skb_reset_transport_header(nskb); 107 skb_reset_transport_header(nskb);
108 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 108 nth = skb_put(nskb, tcp_hdr_size);
109 nth->source = th->dest; 109 nth->source = th->dest;
110 nth->dest = th->source; 110 nth->dest = th->source;
111 nth->seq = htonl(__cookie_v6_init_sequence(iph, th, &mss)); 111 nth->seq = htonl(__cookie_v6_init_sequence(iph, th, &mss));
@@ -147,7 +147,7 @@ synproxy_send_server_syn(struct net *net,
147 niph = synproxy_build_ip(net, nskb, &iph->saddr, &iph->daddr); 147 niph = synproxy_build_ip(net, nskb, &iph->saddr, &iph->daddr);
148 148
149 skb_reset_transport_header(nskb); 149 skb_reset_transport_header(nskb);
150 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 150 nth = skb_put(nskb, tcp_hdr_size);
151 nth->source = th->source; 151 nth->source = th->source;
152 nth->dest = th->dest; 152 nth->dest = th->dest;
153 nth->seq = htonl(recv_seq - 1); 153 nth->seq = htonl(recv_seq - 1);
@@ -192,7 +192,7 @@ synproxy_send_server_ack(struct net *net,
192 niph = synproxy_build_ip(net, nskb, &iph->daddr, &iph->saddr); 192 niph = synproxy_build_ip(net, nskb, &iph->daddr, &iph->saddr);
193 193
194 skb_reset_transport_header(nskb); 194 skb_reset_transport_header(nskb);
195 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 195 nth = skb_put(nskb, tcp_hdr_size);
196 nth->source = th->dest; 196 nth->source = th->dest;
197 nth->dest = th->source; 197 nth->dest = th->source;
198 nth->seq = htonl(ntohl(th->ack_seq)); 198 nth->seq = htonl(ntohl(th->ack_seq));
@@ -230,7 +230,7 @@ synproxy_send_client_ack(struct net *net,
230 niph = synproxy_build_ip(net, nskb, &iph->saddr, &iph->daddr); 230 niph = synproxy_build_ip(net, nskb, &iph->saddr, &iph->daddr);
231 231
232 skb_reset_transport_header(nskb); 232 skb_reset_transport_header(nskb);
233 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size); 233 nth = skb_put(nskb, tcp_hdr_size);
234 nth->source = th->source; 234 nth->source = th->source;
235 nth->dest = th->dest; 235 nth->dest = th->dest;
236 nth->seq = htonl(ntohl(th->seq) + 1); 236 nth->seq = htonl(ntohl(th->seq) + 1);
diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index f63b18e05c69..24858402e374 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -95,7 +95,7 @@ void nf_reject_ip6_tcphdr_put(struct sk_buff *nskb,
95 int needs_ack; 95 int needs_ack;
96 96
97 skb_reset_transport_header(nskb); 97 skb_reset_transport_header(nskb);
98 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); 98 tcph = skb_put(nskb, sizeof(struct tcphdr));
99 /* Truncate to length (no data) */ 99 /* Truncate to length (no data) */
100 tcph->doff = sizeof(struct tcphdr)/4; 100 tcph->doff = sizeof(struct tcphdr)/4;
101 tcph->source = oth->dest; 101 tcph->source = oth->dest;
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index bf56ac7dba96..82e71e5622c2 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -133,7 +133,7 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos)
133 if (!tx_skb) 133 if (!tx_skb)
134 return; 134 return;
135 135
136 frame = (struct snrm_frame *) skb_put(tx_skb, 2); 136 frame = skb_put(tx_skb, 2);
137 137
138 /* Insert connection address field */ 138 /* Insert connection address field */
139 if (qos) 139 if (qos)
@@ -228,7 +228,7 @@ void irlap_send_ua_response_frame(struct irlap_cb *self, struct qos_info *qos)
228 if (!tx_skb) 228 if (!tx_skb)
229 return; 229 return;
230 230
231 frame = (struct ua_frame *) skb_put(tx_skb, 10); 231 frame = skb_put(tx_skb, 10);
232 232
233 /* Build UA response */ 233 /* Build UA response */
234 frame->caddr = self->caddr; 234 frame->caddr = self->caddr;
@@ -268,7 +268,7 @@ void irlap_send_dm_frame( struct irlap_cb *self)
268 if (!tx_skb) 268 if (!tx_skb)
269 return; 269 return;
270 270
271 frame = (struct dm_frame *)skb_put(tx_skb, 2); 271 frame = skb_put(tx_skb, 2);
272 272
273 if (self->state == LAP_NDM) 273 if (self->state == LAP_NDM)
274 frame->caddr = CBROADCAST; 274 frame->caddr = CBROADCAST;
@@ -298,7 +298,7 @@ void irlap_send_disc_frame(struct irlap_cb *self)
298 if (!tx_skb) 298 if (!tx_skb)
299 return; 299 return;
300 300
301 frame = (struct disc_frame *)skb_put(tx_skb, 2); 301 frame = skb_put(tx_skb, 2);
302 302
303 frame->caddr = self->caddr | CMD_FRAME; 303 frame->caddr = self->caddr | CMD_FRAME;
304 frame->control = DISC_CMD | PF_BIT; 304 frame->control = DISC_CMD | PF_BIT;
@@ -587,7 +587,7 @@ void irlap_send_rr_frame(struct irlap_cb *self, int command)
587 if (!tx_skb) 587 if (!tx_skb)
588 return; 588 return;
589 589
590 frame = (struct rr_frame *)skb_put(tx_skb, 2); 590 frame = skb_put(tx_skb, 2);
591 591
592 frame->caddr = self->caddr; 592 frame->caddr = self->caddr;
593 frame->caddr |= (command) ? CMD_FRAME : 0; 593 frame->caddr |= (command) ? CMD_FRAME : 0;
@@ -612,7 +612,7 @@ void irlap_send_rd_frame(struct irlap_cb *self)
612 if (!tx_skb) 612 if (!tx_skb)
613 return; 613 return;
614 614
615 frame = (struct rd_frame *)skb_put(tx_skb, 2); 615 frame = skb_put(tx_skb, 2);
616 616
617 frame->caddr = self->caddr; 617 frame->caddr = self->caddr;
618 frame->control = RD_RSP | PF_BIT; 618 frame->control = RD_RSP | PF_BIT;
@@ -1202,14 +1202,13 @@ void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
1202 1202
1203 /* Broadcast frames must include saddr and daddr fields */ 1203 /* Broadcast frames must include saddr and daddr fields */
1204 if (caddr == CBROADCAST) { 1204 if (caddr == CBROADCAST) {
1205 frame = (struct test_frame *) 1205 frame = skb_put(tx_skb, sizeof(struct test_frame));
1206 skb_put(tx_skb, sizeof(struct test_frame));
1207 1206
1208 /* Insert the swapped addresses */ 1207 /* Insert the swapped addresses */
1209 frame->saddr = cpu_to_le32(self->saddr); 1208 frame->saddr = cpu_to_le32(self->saddr);
1210 frame->daddr = cpu_to_le32(daddr); 1209 frame->daddr = cpu_to_le32(daddr);
1211 } else 1210 } else
1212 frame = (struct test_frame *) skb_put(tx_skb, LAP_ADDR_HEADER + LAP_CTRL_HEADER); 1211 frame = skb_put(tx_skb, LAP_ADDR_HEADER + LAP_CTRL_HEADER);
1213 1212
1214 frame->caddr = caddr; 1213 frame->caddr = caddr;
1215 frame->control = TEST_RSP | PF_BIT; 1214 frame->control = TEST_RSP | PF_BIT;
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 3ebb4268973b..daa4e90dc4db 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -349,7 +349,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk)
349 err = EINVAL; 349 err = EINVAL;
350 BUG_ON(err <= 0 || err >= 256); 350 BUG_ON(err <= 0 || err >= 256);
351 351
352 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 352 hdr = skb_put(skb, sizeof(struct sadb_msg));
353 pfkey_hdr_dup(hdr, orig); 353 pfkey_hdr_dup(hdr, orig);
354 hdr->sadb_msg_errno = (uint8_t) err; 354 hdr->sadb_msg_errno = (uint8_t) err;
355 hdr->sadb_msg_len = (sizeof(struct sadb_msg) / 355 hdr->sadb_msg_len = (sizeof(struct sadb_msg) /
@@ -810,12 +810,12 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
810 return ERR_PTR(-ENOBUFS); 810 return ERR_PTR(-ENOBUFS);
811 811
812 /* call should fill header later */ 812 /* call should fill header later */
813 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 813 hdr = skb_put(skb, sizeof(struct sadb_msg));
814 memset(hdr, 0, size); /* XXX do we need this ? */ 814 memset(hdr, 0, size); /* XXX do we need this ? */
815 hdr->sadb_msg_len = size / sizeof(uint64_t); 815 hdr->sadb_msg_len = size / sizeof(uint64_t);
816 816
817 /* sa */ 817 /* sa */
818 sa = (struct sadb_sa *) skb_put(skb, sizeof(struct sadb_sa)); 818 sa = skb_put(skb, sizeof(struct sadb_sa));
819 sa->sadb_sa_len = sizeof(struct sadb_sa)/sizeof(uint64_t); 819 sa->sadb_sa_len = sizeof(struct sadb_sa)/sizeof(uint64_t);
820 sa->sadb_sa_exttype = SADB_EXT_SA; 820 sa->sadb_sa_exttype = SADB_EXT_SA;
821 sa->sadb_sa_spi = x->id.spi; 821 sa->sadb_sa_spi = x->id.spi;
@@ -862,8 +862,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
862 862
863 /* hard time */ 863 /* hard time */
864 if (hsc & 2) { 864 if (hsc & 2) {
865 lifetime = (struct sadb_lifetime *) skb_put(skb, 865 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
866 sizeof(struct sadb_lifetime));
867 lifetime->sadb_lifetime_len = 866 lifetime->sadb_lifetime_len =
868 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 867 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
869 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD; 868 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD;
@@ -874,8 +873,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
874 } 873 }
875 /* soft time */ 874 /* soft time */
876 if (hsc & 1) { 875 if (hsc & 1) {
877 lifetime = (struct sadb_lifetime *) skb_put(skb, 876 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
878 sizeof(struct sadb_lifetime));
879 lifetime->sadb_lifetime_len = 877 lifetime->sadb_lifetime_len =
880 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 878 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
881 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_SOFT; 879 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_SOFT;
@@ -885,8 +883,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
885 lifetime->sadb_lifetime_usetime = x->lft.soft_use_expires_seconds; 883 lifetime->sadb_lifetime_usetime = x->lft.soft_use_expires_seconds;
886 } 884 }
887 /* current time */ 885 /* current time */
888 lifetime = (struct sadb_lifetime *) skb_put(skb, 886 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
889 sizeof(struct sadb_lifetime));
890 lifetime->sadb_lifetime_len = 887 lifetime->sadb_lifetime_len =
891 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 888 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
892 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT; 889 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT;
@@ -895,8 +892,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
895 lifetime->sadb_lifetime_addtime = x->curlft.add_time; 892 lifetime->sadb_lifetime_addtime = x->curlft.add_time;
896 lifetime->sadb_lifetime_usetime = x->curlft.use_time; 893 lifetime->sadb_lifetime_usetime = x->curlft.use_time;
897 /* src address */ 894 /* src address */
898 addr = (struct sadb_address*) skb_put(skb, 895 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
899 sizeof(struct sadb_address)+sockaddr_size);
900 addr->sadb_address_len = 896 addr->sadb_address_len =
901 (sizeof(struct sadb_address)+sockaddr_size)/ 897 (sizeof(struct sadb_address)+sockaddr_size)/
902 sizeof(uint64_t); 898 sizeof(uint64_t);
@@ -915,8 +911,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
915 BUG(); 911 BUG();
916 912
917 /* dst address */ 913 /* dst address */
918 addr = (struct sadb_address*) skb_put(skb, 914 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
919 sizeof(struct sadb_address)+sockaddr_size);
920 addr->sadb_address_len = 915 addr->sadb_address_len =
921 (sizeof(struct sadb_address)+sockaddr_size)/ 916 (sizeof(struct sadb_address)+sockaddr_size)/
922 sizeof(uint64_t); 917 sizeof(uint64_t);
@@ -933,8 +928,8 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
933 928
934 if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr, 929 if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr,
935 x->props.family)) { 930 x->props.family)) {
936 addr = (struct sadb_address*) skb_put(skb, 931 addr = skb_put(skb,
937 sizeof(struct sadb_address)+sockaddr_size); 932 sizeof(struct sadb_address) + sockaddr_size);
938 addr->sadb_address_len = 933 addr->sadb_address_len =
939 (sizeof(struct sadb_address)+sockaddr_size)/ 934 (sizeof(struct sadb_address)+sockaddr_size)/
940 sizeof(uint64_t); 935 sizeof(uint64_t);
@@ -951,8 +946,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
951 946
952 /* auth key */ 947 /* auth key */
953 if (add_keys && auth_key_size) { 948 if (add_keys && auth_key_size) {
954 key = (struct sadb_key *) skb_put(skb, 949 key = skb_put(skb, sizeof(struct sadb_key) + auth_key_size);
955 sizeof(struct sadb_key)+auth_key_size);
956 key->sadb_key_len = (sizeof(struct sadb_key) + auth_key_size) / 950 key->sadb_key_len = (sizeof(struct sadb_key) + auth_key_size) /
957 sizeof(uint64_t); 951 sizeof(uint64_t);
958 key->sadb_key_exttype = SADB_EXT_KEY_AUTH; 952 key->sadb_key_exttype = SADB_EXT_KEY_AUTH;
@@ -962,8 +956,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
962 } 956 }
963 /* encrypt key */ 957 /* encrypt key */
964 if (add_keys && encrypt_key_size) { 958 if (add_keys && encrypt_key_size) {
965 key = (struct sadb_key *) skb_put(skb, 959 key = skb_put(skb, sizeof(struct sadb_key) + encrypt_key_size);
966 sizeof(struct sadb_key)+encrypt_key_size);
967 key->sadb_key_len = (sizeof(struct sadb_key) + 960 key->sadb_key_len = (sizeof(struct sadb_key) +
968 encrypt_key_size) / sizeof(uint64_t); 961 encrypt_key_size) / sizeof(uint64_t);
969 key->sadb_key_exttype = SADB_EXT_KEY_ENCRYPT; 962 key->sadb_key_exttype = SADB_EXT_KEY_ENCRYPT;
@@ -974,7 +967,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
974 } 967 }
975 968
976 /* sa */ 969 /* sa */
977 sa2 = (struct sadb_x_sa2 *) skb_put(skb, sizeof(struct sadb_x_sa2)); 970 sa2 = skb_put(skb, sizeof(struct sadb_x_sa2));
978 sa2->sadb_x_sa2_len = sizeof(struct sadb_x_sa2)/sizeof(uint64_t); 971 sa2->sadb_x_sa2_len = sizeof(struct sadb_x_sa2)/sizeof(uint64_t);
979 sa2->sadb_x_sa2_exttype = SADB_X_EXT_SA2; 972 sa2->sadb_x_sa2_exttype = SADB_X_EXT_SA2;
980 if ((mode = pfkey_mode_from_xfrm(x->props.mode)) < 0) { 973 if ((mode = pfkey_mode_from_xfrm(x->props.mode)) < 0) {
@@ -992,7 +985,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
992 struct sadb_x_nat_t_port *n_port; 985 struct sadb_x_nat_t_port *n_port;
993 986
994 /* type */ 987 /* type */
995 n_type = (struct sadb_x_nat_t_type*) skb_put(skb, sizeof(*n_type)); 988 n_type = skb_put(skb, sizeof(*n_type));
996 n_type->sadb_x_nat_t_type_len = sizeof(*n_type)/sizeof(uint64_t); 989 n_type->sadb_x_nat_t_type_len = sizeof(*n_type)/sizeof(uint64_t);
997 n_type->sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE; 990 n_type->sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE;
998 n_type->sadb_x_nat_t_type_type = natt->encap_type; 991 n_type->sadb_x_nat_t_type_type = natt->encap_type;
@@ -1001,14 +994,14 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
1001 n_type->sadb_x_nat_t_type_reserved[2] = 0; 994 n_type->sadb_x_nat_t_type_reserved[2] = 0;
1002 995
1003 /* source port */ 996 /* source port */
1004 n_port = (struct sadb_x_nat_t_port*) skb_put(skb, sizeof (*n_port)); 997 n_port = skb_put(skb, sizeof(*n_port));
1005 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t); 998 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t);
1006 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT; 999 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT;
1007 n_port->sadb_x_nat_t_port_port = natt->encap_sport; 1000 n_port->sadb_x_nat_t_port_port = natt->encap_sport;
1008 n_port->sadb_x_nat_t_port_reserved = 0; 1001 n_port->sadb_x_nat_t_port_reserved = 0;
1009 1002
1010 /* dest port */ 1003 /* dest port */
1011 n_port = (struct sadb_x_nat_t_port*) skb_put(skb, sizeof (*n_port)); 1004 n_port = skb_put(skb, sizeof(*n_port));
1012 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t); 1005 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t);
1013 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT; 1006 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT;
1014 n_port->sadb_x_nat_t_port_port = natt->encap_dport; 1007 n_port->sadb_x_nat_t_port_port = natt->encap_dport;
@@ -1017,8 +1010,8 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
1017 1010
1018 /* security context */ 1011 /* security context */
1019 if (xfrm_ctx) { 1012 if (xfrm_ctx) {
1020 sec_ctx = (struct sadb_x_sec_ctx *) skb_put(skb, 1013 sec_ctx = skb_put(skb,
1021 sizeof(struct sadb_x_sec_ctx) + ctx_size); 1014 sizeof(struct sadb_x_sec_ctx) + ctx_size);
1022 sec_ctx->sadb_x_sec_len = 1015 sec_ctx->sadb_x_sec_len =
1023 (sizeof(struct sadb_x_sec_ctx) + ctx_size) / sizeof(uint64_t); 1016 (sizeof(struct sadb_x_sec_ctx) + ctx_size) / sizeof(uint64_t);
1024 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; 1017 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
@@ -1617,7 +1610,7 @@ static struct sk_buff *compose_sadb_supported(const struct sadb_msg *orig,
1617 if (!skb) 1610 if (!skb)
1618 goto out_put_algs; 1611 goto out_put_algs;
1619 1612
1620 hdr = (struct sadb_msg *) skb_put(skb, sizeof(*hdr)); 1613 hdr = skb_put(skb, sizeof(*hdr));
1621 pfkey_hdr_dup(hdr, orig); 1614 pfkey_hdr_dup(hdr, orig);
1622 hdr->sadb_msg_errno = 0; 1615 hdr->sadb_msg_errno = 0;
1623 hdr->sadb_msg_len = len / sizeof(uint64_t); 1616 hdr->sadb_msg_len = len / sizeof(uint64_t);
@@ -1626,7 +1619,7 @@ static struct sk_buff *compose_sadb_supported(const struct sadb_msg *orig,
1626 struct sadb_supported *sp; 1619 struct sadb_supported *sp;
1627 struct sadb_alg *ap; 1620 struct sadb_alg *ap;
1628 1621
1629 sp = (struct sadb_supported *) skb_put(skb, auth_len); 1622 sp = skb_put(skb, auth_len);
1630 ap = (struct sadb_alg *) (sp + 1); 1623 ap = (struct sadb_alg *) (sp + 1);
1631 1624
1632 sp->sadb_supported_len = auth_len / sizeof(uint64_t); 1625 sp->sadb_supported_len = auth_len / sizeof(uint64_t);
@@ -1647,7 +1640,7 @@ static struct sk_buff *compose_sadb_supported(const struct sadb_msg *orig,
1647 struct sadb_supported *sp; 1640 struct sadb_supported *sp;
1648 struct sadb_alg *ap; 1641 struct sadb_alg *ap;
1649 1642
1650 sp = (struct sadb_supported *) skb_put(skb, enc_len); 1643 sp = skb_put(skb, enc_len);
1651 ap = (struct sadb_alg *) (sp + 1); 1644 ap = (struct sadb_alg *) (sp + 1);
1652 1645
1653 sp->sadb_supported_len = enc_len / sizeof(uint64_t); 1646 sp->sadb_supported_len = enc_len / sizeof(uint64_t);
@@ -1721,7 +1714,7 @@ static int key_notify_sa_flush(const struct km_event *c)
1721 skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); 1714 skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC);
1722 if (!skb) 1715 if (!skb)
1723 return -ENOBUFS; 1716 return -ENOBUFS;
1724 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 1717 hdr = skb_put(skb, sizeof(struct sadb_msg));
1725 hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); 1718 hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto);
1726 hdr->sadb_msg_type = SADB_FLUSH; 1719 hdr->sadb_msg_type = SADB_FLUSH;
1727 hdr->sadb_msg_seq = c->seq; 1720 hdr->sadb_msg_seq = c->seq;
@@ -2046,12 +2039,11 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2046 size = pfkey_xfrm_policy2msg_size(xp); 2039 size = pfkey_xfrm_policy2msg_size(xp);
2047 2040
2048 /* call should fill header later */ 2041 /* call should fill header later */
2049 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 2042 hdr = skb_put(skb, sizeof(struct sadb_msg));
2050 memset(hdr, 0, size); /* XXX do we need this ? */ 2043 memset(hdr, 0, size); /* XXX do we need this ? */
2051 2044
2052 /* src address */ 2045 /* src address */
2053 addr = (struct sadb_address*) skb_put(skb, 2046 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
2054 sizeof(struct sadb_address)+sockaddr_size);
2055 addr->sadb_address_len = 2047 addr->sadb_address_len =
2056 (sizeof(struct sadb_address)+sockaddr_size)/ 2048 (sizeof(struct sadb_address)+sockaddr_size)/
2057 sizeof(uint64_t); 2049 sizeof(uint64_t);
@@ -2066,8 +2058,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2066 BUG(); 2058 BUG();
2067 2059
2068 /* dst address */ 2060 /* dst address */
2069 addr = (struct sadb_address*) skb_put(skb, 2061 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
2070 sizeof(struct sadb_address)+sockaddr_size);
2071 addr->sadb_address_len = 2062 addr->sadb_address_len =
2072 (sizeof(struct sadb_address)+sockaddr_size)/ 2063 (sizeof(struct sadb_address)+sockaddr_size)/
2073 sizeof(uint64_t); 2064 sizeof(uint64_t);
@@ -2081,8 +2072,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2081 xp->family); 2072 xp->family);
2082 2073
2083 /* hard time */ 2074 /* hard time */
2084 lifetime = (struct sadb_lifetime *) skb_put(skb, 2075 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
2085 sizeof(struct sadb_lifetime));
2086 lifetime->sadb_lifetime_len = 2076 lifetime->sadb_lifetime_len =
2087 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 2077 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
2088 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD; 2078 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD;
@@ -2091,8 +2081,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2091 lifetime->sadb_lifetime_addtime = xp->lft.hard_add_expires_seconds; 2081 lifetime->sadb_lifetime_addtime = xp->lft.hard_add_expires_seconds;
2092 lifetime->sadb_lifetime_usetime = xp->lft.hard_use_expires_seconds; 2082 lifetime->sadb_lifetime_usetime = xp->lft.hard_use_expires_seconds;
2093 /* soft time */ 2083 /* soft time */
2094 lifetime = (struct sadb_lifetime *) skb_put(skb, 2084 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
2095 sizeof(struct sadb_lifetime));
2096 lifetime->sadb_lifetime_len = 2085 lifetime->sadb_lifetime_len =
2097 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 2086 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
2098 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_SOFT; 2087 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_SOFT;
@@ -2101,8 +2090,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2101 lifetime->sadb_lifetime_addtime = xp->lft.soft_add_expires_seconds; 2090 lifetime->sadb_lifetime_addtime = xp->lft.soft_add_expires_seconds;
2102 lifetime->sadb_lifetime_usetime = xp->lft.soft_use_expires_seconds; 2091 lifetime->sadb_lifetime_usetime = xp->lft.soft_use_expires_seconds;
2103 /* current time */ 2092 /* current time */
2104 lifetime = (struct sadb_lifetime *) skb_put(skb, 2093 lifetime = skb_put(skb, sizeof(struct sadb_lifetime));
2105 sizeof(struct sadb_lifetime));
2106 lifetime->sadb_lifetime_len = 2094 lifetime->sadb_lifetime_len =
2107 sizeof(struct sadb_lifetime)/sizeof(uint64_t); 2095 sizeof(struct sadb_lifetime)/sizeof(uint64_t);
2108 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT; 2096 lifetime->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT;
@@ -2111,7 +2099,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2111 lifetime->sadb_lifetime_addtime = xp->curlft.add_time; 2099 lifetime->sadb_lifetime_addtime = xp->curlft.add_time;
2112 lifetime->sadb_lifetime_usetime = xp->curlft.use_time; 2100 lifetime->sadb_lifetime_usetime = xp->curlft.use_time;
2113 2101
2114 pol = (struct sadb_x_policy *) skb_put(skb, sizeof(struct sadb_x_policy)); 2102 pol = skb_put(skb, sizeof(struct sadb_x_policy));
2115 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t); 2103 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t);
2116 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; 2104 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
2117 pol->sadb_x_policy_type = IPSEC_POLICY_DISCARD; 2105 pol->sadb_x_policy_type = IPSEC_POLICY_DISCARD;
@@ -2139,7 +2127,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2139 } else { 2127 } else {
2140 size -= 2*socklen; 2128 size -= 2*socklen;
2141 } 2129 }
2142 rq = (void*)skb_put(skb, req_size); 2130 rq = skb_put(skb, req_size);
2143 pol->sadb_x_policy_len += req_size/8; 2131 pol->sadb_x_policy_len += req_size/8;
2144 memset(rq, 0, sizeof(*rq)); 2132 memset(rq, 0, sizeof(*rq));
2145 rq->sadb_x_ipsecrequest_len = req_size; 2133 rq->sadb_x_ipsecrequest_len = req_size;
@@ -2169,7 +2157,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy *
2169 if ((xfrm_ctx = xp->security)) { 2157 if ((xfrm_ctx = xp->security)) {
2170 int ctx_size = pfkey_xfrm_policy2sec_ctx_size(xp); 2158 int ctx_size = pfkey_xfrm_policy2sec_ctx_size(xp);
2171 2159
2172 sec_ctx = (struct sadb_x_sec_ctx *) skb_put(skb, ctx_size); 2160 sec_ctx = skb_put(skb, ctx_size);
2173 sec_ctx->sadb_x_sec_len = ctx_size / sizeof(uint64_t); 2161 sec_ctx->sadb_x_sec_len = ctx_size / sizeof(uint64_t);
2174 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; 2162 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
2175 sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; 2163 sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi;
@@ -2733,7 +2721,7 @@ static int key_notify_policy_flush(const struct km_event *c)
2733 skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); 2721 skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC);
2734 if (!skb_out) 2722 if (!skb_out)
2735 return -ENOBUFS; 2723 return -ENOBUFS;
2736 hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); 2724 hdr = skb_put(skb_out, sizeof(struct sadb_msg));
2737 hdr->sadb_msg_type = SADB_X_SPDFLUSH; 2725 hdr->sadb_msg_type = SADB_X_SPDFLUSH;
2738 hdr->sadb_msg_seq = c->seq; 2726 hdr->sadb_msg_seq = c->seq;
2739 hdr->sadb_msg_pid = c->portid; 2727 hdr->sadb_msg_pid = c->portid;
@@ -2917,7 +2905,7 @@ static void dump_ah_combs(struct sk_buff *skb, const struct xfrm_tmpl *t)
2917 struct sadb_prop *p; 2905 struct sadb_prop *p;
2918 int i; 2906 int i;
2919 2907
2920 p = (struct sadb_prop*)skb_put(skb, sizeof(struct sadb_prop)); 2908 p = skb_put(skb, sizeof(struct sadb_prop));
2921 p->sadb_prop_len = sizeof(struct sadb_prop)/8; 2909 p->sadb_prop_len = sizeof(struct sadb_prop)/8;
2922 p->sadb_prop_exttype = SADB_EXT_PROPOSAL; 2910 p->sadb_prop_exttype = SADB_EXT_PROPOSAL;
2923 p->sadb_prop_replay = 32; 2911 p->sadb_prop_replay = 32;
@@ -2951,7 +2939,7 @@ static void dump_esp_combs(struct sk_buff *skb, const struct xfrm_tmpl *t)
2951 struct sadb_prop *p; 2939 struct sadb_prop *p;
2952 int i, k; 2940 int i, k;
2953 2941
2954 p = (struct sadb_prop*)skb_put(skb, sizeof(struct sadb_prop)); 2942 p = skb_put(skb, sizeof(struct sadb_prop));
2955 p->sadb_prop_len = sizeof(struct sadb_prop)/8; 2943 p->sadb_prop_len = sizeof(struct sadb_prop)/8;
2956 p->sadb_prop_exttype = SADB_EXT_PROPOSAL; 2944 p->sadb_prop_exttype = SADB_EXT_PROPOSAL;
2957 p->sadb_prop_replay = 32; 2945 p->sadb_prop_replay = 32;
@@ -2977,7 +2965,7 @@ static void dump_esp_combs(struct sk_buff *skb, const struct xfrm_tmpl *t)
2977 continue; 2965 continue;
2978 if (!(aalg_tmpl_set(t, aalg) && aalg->available)) 2966 if (!(aalg_tmpl_set(t, aalg) && aalg->available))
2979 continue; 2967 continue;
2980 c = (struct sadb_comb*)skb_put(skb, sizeof(struct sadb_comb)); 2968 c = skb_put(skb, sizeof(struct sadb_comb));
2981 memset(c, 0, sizeof(*c)); 2969 memset(c, 0, sizeof(*c));
2982 p->sadb_prop_len += sizeof(struct sadb_comb)/8; 2970 p->sadb_prop_len += sizeof(struct sadb_comb)/8;
2983 c->sadb_comb_auth = aalg->desc.sadb_alg_id; 2971 c->sadb_comb_auth = aalg->desc.sadb_alg_id;
@@ -3144,7 +3132,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
3144 if (skb == NULL) 3132 if (skb == NULL)
3145 return -ENOMEM; 3133 return -ENOMEM;
3146 3134
3147 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 3135 hdr = skb_put(skb, sizeof(struct sadb_msg));
3148 hdr->sadb_msg_version = PF_KEY_V2; 3136 hdr->sadb_msg_version = PF_KEY_V2;
3149 hdr->sadb_msg_type = SADB_ACQUIRE; 3137 hdr->sadb_msg_type = SADB_ACQUIRE;
3150 hdr->sadb_msg_satype = pfkey_proto2satype(x->id.proto); 3138 hdr->sadb_msg_satype = pfkey_proto2satype(x->id.proto);
@@ -3155,8 +3143,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
3155 hdr->sadb_msg_pid = 0; 3143 hdr->sadb_msg_pid = 0;
3156 3144
3157 /* src address */ 3145 /* src address */
3158 addr = (struct sadb_address*) skb_put(skb, 3146 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
3159 sizeof(struct sadb_address)+sockaddr_size);
3160 addr->sadb_address_len = 3147 addr->sadb_address_len =
3161 (sizeof(struct sadb_address)+sockaddr_size)/ 3148 (sizeof(struct sadb_address)+sockaddr_size)/
3162 sizeof(uint64_t); 3149 sizeof(uint64_t);
@@ -3171,8 +3158,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
3171 BUG(); 3158 BUG();
3172 3159
3173 /* dst address */ 3160 /* dst address */
3174 addr = (struct sadb_address*) skb_put(skb, 3161 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
3175 sizeof(struct sadb_address)+sockaddr_size);
3176 addr->sadb_address_len = 3162 addr->sadb_address_len =
3177 (sizeof(struct sadb_address)+sockaddr_size)/ 3163 (sizeof(struct sadb_address)+sockaddr_size)/
3178 sizeof(uint64_t); 3164 sizeof(uint64_t);
@@ -3186,7 +3172,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
3186 if (!addr->sadb_address_prefixlen) 3172 if (!addr->sadb_address_prefixlen)
3187 BUG(); 3173 BUG();
3188 3174
3189 pol = (struct sadb_x_policy *) skb_put(skb, sizeof(struct sadb_x_policy)); 3175 pol = skb_put(skb, sizeof(struct sadb_x_policy));
3190 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t); 3176 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t);
3191 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; 3177 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
3192 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; 3178 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC;
@@ -3203,8 +3189,8 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
3203 3189
3204 /* security context */ 3190 /* security context */
3205 if (xfrm_ctx) { 3191 if (xfrm_ctx) {
3206 sec_ctx = (struct sadb_x_sec_ctx *) skb_put(skb, 3192 sec_ctx = skb_put(skb,
3207 sizeof(struct sadb_x_sec_ctx) + ctx_size); 3193 sizeof(struct sadb_x_sec_ctx) + ctx_size);
3208 sec_ctx->sadb_x_sec_len = 3194 sec_ctx->sadb_x_sec_len =
3209 (sizeof(struct sadb_x_sec_ctx) + ctx_size) / sizeof(uint64_t); 3195 (sizeof(struct sadb_x_sec_ctx) + ctx_size) / sizeof(uint64_t);
3210 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; 3196 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX;
@@ -3346,7 +3332,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
3346 if (skb == NULL) 3332 if (skb == NULL)
3347 return -ENOMEM; 3333 return -ENOMEM;
3348 3334
3349 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 3335 hdr = skb_put(skb, sizeof(struct sadb_msg));
3350 hdr->sadb_msg_version = PF_KEY_V2; 3336 hdr->sadb_msg_version = PF_KEY_V2;
3351 hdr->sadb_msg_type = SADB_X_NAT_T_NEW_MAPPING; 3337 hdr->sadb_msg_type = SADB_X_NAT_T_NEW_MAPPING;
3352 hdr->sadb_msg_satype = satype; 3338 hdr->sadb_msg_satype = satype;
@@ -3357,7 +3343,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
3357 hdr->sadb_msg_pid = 0; 3343 hdr->sadb_msg_pid = 0;
3358 3344
3359 /* SA */ 3345 /* SA */
3360 sa = (struct sadb_sa *) skb_put(skb, sizeof(struct sadb_sa)); 3346 sa = skb_put(skb, sizeof(struct sadb_sa));
3361 sa->sadb_sa_len = sizeof(struct sadb_sa)/sizeof(uint64_t); 3347 sa->sadb_sa_len = sizeof(struct sadb_sa)/sizeof(uint64_t);
3362 sa->sadb_sa_exttype = SADB_EXT_SA; 3348 sa->sadb_sa_exttype = SADB_EXT_SA;
3363 sa->sadb_sa_spi = x->id.spi; 3349 sa->sadb_sa_spi = x->id.spi;
@@ -3368,8 +3354,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
3368 sa->sadb_sa_flags = 0; 3354 sa->sadb_sa_flags = 0;
3369 3355
3370 /* ADDRESS_SRC (old addr) */ 3356 /* ADDRESS_SRC (old addr) */
3371 addr = (struct sadb_address*) 3357 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
3372 skb_put(skb, sizeof(struct sadb_address)+sockaddr_size);
3373 addr->sadb_address_len = 3358 addr->sadb_address_len =
3374 (sizeof(struct sadb_address)+sockaddr_size)/ 3359 (sizeof(struct sadb_address)+sockaddr_size)/
3375 sizeof(uint64_t); 3360 sizeof(uint64_t);
@@ -3384,15 +3369,14 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
3384 BUG(); 3369 BUG();
3385 3370
3386 /* NAT_T_SPORT (old port) */ 3371 /* NAT_T_SPORT (old port) */
3387 n_port = (struct sadb_x_nat_t_port*) skb_put(skb, sizeof (*n_port)); 3372 n_port = skb_put(skb, sizeof(*n_port));
3388 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t); 3373 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t);
3389 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT; 3374 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT;
3390 n_port->sadb_x_nat_t_port_port = natt->encap_sport; 3375 n_port->sadb_x_nat_t_port_port = natt->encap_sport;
3391 n_port->sadb_x_nat_t_port_reserved = 0; 3376 n_port->sadb_x_nat_t_port_reserved = 0;
3392 3377
3393 /* ADDRESS_DST (new addr) */ 3378 /* ADDRESS_DST (new addr) */
3394 addr = (struct sadb_address*) 3379 addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size);
3395 skb_put(skb, sizeof(struct sadb_address)+sockaddr_size);
3396 addr->sadb_address_len = 3380 addr->sadb_address_len =
3397 (sizeof(struct sadb_address)+sockaddr_size)/ 3381 (sizeof(struct sadb_address)+sockaddr_size)/
3398 sizeof(uint64_t); 3382 sizeof(uint64_t);
@@ -3407,7 +3391,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
3407 BUG(); 3391 BUG();
3408 3392
3409 /* NAT_T_DPORT (new port) */ 3393 /* NAT_T_DPORT (new port) */
3410 n_port = (struct sadb_x_nat_t_port*) skb_put(skb, sizeof (*n_port)); 3394 n_port = skb_put(skb, sizeof(*n_port));
3411 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t); 3395 n_port->sadb_x_nat_t_port_len = sizeof(*n_port)/sizeof(uint64_t);
3412 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT; 3396 n_port->sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT;
3413 n_port->sadb_x_nat_t_port_port = sport; 3397 n_port->sadb_x_nat_t_port_port = sport;
@@ -3421,7 +3405,7 @@ static int set_sadb_address(struct sk_buff *skb, int sasize, int type,
3421 const struct xfrm_selector *sel) 3405 const struct xfrm_selector *sel)
3422{ 3406{
3423 struct sadb_address *addr; 3407 struct sadb_address *addr;
3424 addr = (struct sadb_address *)skb_put(skb, sizeof(struct sadb_address) + sasize); 3408 addr = skb_put(skb, sizeof(struct sadb_address) + sasize);
3425 addr->sadb_address_len = (sizeof(struct sadb_address) + sasize)/8; 3409 addr->sadb_address_len = (sizeof(struct sadb_address) + sasize)/8;
3426 addr->sadb_address_exttype = type; 3410 addr->sadb_address_exttype = type;
3427 addr->sadb_address_proto = sel->proto; 3411 addr->sadb_address_proto = sel->proto;
@@ -3553,7 +3537,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
3553 if (skb == NULL) 3537 if (skb == NULL)
3554 return -ENOMEM; 3538 return -ENOMEM;
3555 3539
3556 hdr = (struct sadb_msg *)skb_put(skb, sizeof(struct sadb_msg)); 3540 hdr = skb_put(skb, sizeof(struct sadb_msg));
3557 hdr->sadb_msg_version = PF_KEY_V2; 3541 hdr->sadb_msg_version = PF_KEY_V2;
3558 hdr->sadb_msg_type = SADB_X_MIGRATE; 3542 hdr->sadb_msg_type = SADB_X_MIGRATE;
3559 hdr->sadb_msg_satype = pfkey_proto2satype(m->proto); 3543 hdr->sadb_msg_satype = pfkey_proto2satype(m->proto);
@@ -3574,7 +3558,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
3574 set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_DST, sel); 3558 set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_DST, sel);
3575 3559
3576 /* policy information */ 3560 /* policy information */
3577 pol = (struct sadb_x_policy *)skb_put(skb, sizeof(struct sadb_x_policy)); 3561 pol = skb_put(skb, sizeof(struct sadb_x_policy));
3578 pol->sadb_x_policy_len = size_pol / 8; 3562 pol->sadb_x_policy_len = size_pol / 8;
3579 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; 3563 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
3580 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; 3564 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f9eb2486d550..a354f1939e49 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1107,7 +1107,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta)
1107 skb = dev_alloc_skb(sizeof(*msg)); 1107 skb = dev_alloc_skb(sizeof(*msg));
1108 if (!skb) 1108 if (!skb)
1109 return; 1109 return;
1110 msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg)); 1110 msg = skb_put(skb, sizeof(*msg));
1111 1111
1112 /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID) 1112 /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID)
1113 * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ 1113 * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */
@@ -3414,7 +3414,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
3414 3414
3415 skb_reserve(skb, local->hw.extra_tx_headroom); 3415 skb_reserve(skb, local->hw.extra_tx_headroom);
3416 3416
3417 nullfunc = (void *) skb_put(skb, size); 3417 nullfunc = skb_put(skb, size);
3418 nullfunc->frame_control = fc; 3418 nullfunc->frame_control = fc;
3419 nullfunc->duration_id = 0; 3419 nullfunc->duration_id = 0;
3420 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); 3420 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN);
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 927215d4dd8f..c92df492e898 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -459,7 +459,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
459 return -ENOMEM; 459 return -ENOMEM;
460 460
461 skb_reserve(skb, local->hw.extra_tx_headroom); 461 skb_reserve(skb, local->hw.extra_tx_headroom);
462 action_frame = (void *)skb_put(skb, 27); 462 action_frame = skb_put(skb, 27);
463 memcpy(action_frame->da, da, ETH_ALEN); 463 memcpy(action_frame->da, da, ETH_ALEN);
464 memcpy(action_frame->sa, sdata->dev->dev_addr, ETH_ALEN); 464 memcpy(action_frame->sa, sdata->dev->dev_addr, ETH_ALEN);
465 memcpy(action_frame->bssid, bssid, ETH_ALEN); 465 memcpy(action_frame->bssid, bssid, ETH_ALEN);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 861697f2d75b..a550c707cd8a 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1265,7 +1265,7 @@ static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata,
1265 if (!skb) 1265 if (!skb)
1266 return -ENOMEM; 1266 return -ENOMEM;
1267 skb_reserve(skb, local->tx_headroom); 1267 skb_reserve(skb, local->tx_headroom);
1268 mgmt_fwd = (struct ieee80211_mgmt *) skb_put(skb, len); 1268 mgmt_fwd = skb_put(skb, len);
1269 1269
1270 /* offset_ttl is based on whether the secondary channel 1270 /* offset_ttl is based on whether the secondary channel
1271 * offset is available or not. Subtract 1 from the mesh TTL 1271 * offset is available or not. Subtract 1 from the mesh TTL
diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 96c987e641b3..d8cd91424175 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -30,7 +30,7 @@ static struct sk_buff *mps_qos_null_get(struct sta_info *sta)
30 return NULL; 30 return NULL;
31 skb_reserve(skb, local->hw.extra_tx_headroom); 31 skb_reserve(skb, local->hw.extra_tx_headroom);
32 32
33 nullfunc = (struct ieee80211_hdr *) skb_put(skb, size); 33 nullfunc = skb_put(skb, size);
34 fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); 34 fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
35 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, 35 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr,
36 sdata->vif.addr); 36 sdata->vif.addr);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 46e1809356f6..69615016d5bf 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1312,7 +1312,7 @@ static void ieee80211_send_null_response(struct sta_info *sta, int tid,
1312 1312
1313 skb_reserve(skb, local->hw.extra_tx_headroom); 1313 skb_reserve(skb, local->hw.extra_tx_headroom);
1314 1314
1315 nullfunc = (void *) skb_put(skb, size); 1315 nullfunc = skb_put(skb, size);
1316 nullfunc->frame_control = fc; 1316 nullfunc->frame_control = fc;
1317 nullfunc->duration_id = 0; 1317 nullfunc->duration_id = 0;
1318 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); 1318 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN);
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 86740670102d..709ef02fe67e 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -49,7 +49,7 @@ static void ieee80211_tdls_add_ext_capab(struct ieee80211_sub_if_data *sdata,
49 !ifmgd->tdls_wider_bw_prohibited; 49 !ifmgd->tdls_wider_bw_prohibited;
50 struct ieee80211_supported_band *sband = ieee80211_get_sband(sdata); 50 struct ieee80211_supported_band *sband = ieee80211_get_sband(sdata);
51 bool vht = sband && sband->vht_cap.vht_supported; 51 bool vht = sband && sband->vht_cap.vht_supported;
52 u8 *pos = (void *)skb_put(skb, 10); 52 u8 *pos = skb_put(skb, 10);
53 53
54 *pos++ = WLAN_EID_EXT_CAPABILITY; 54 *pos++ = WLAN_EID_EXT_CAPABILITY;
55 *pos++ = 8; /* len */ 55 *pos++ = 8; /* len */
@@ -168,7 +168,7 @@ static void ieee80211_tdls_add_oper_classes(struct ieee80211_sub_if_data *sdata,
168 168
169static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb) 169static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb)
170{ 170{
171 u8 *pos = (void *)skb_put(skb, 3); 171 u8 *pos = skb_put(skb, 3);
172 172
173 *pos++ = WLAN_EID_BSS_COEX_2040; 173 *pos++ = WLAN_EID_BSS_COEX_2040;
174 *pos++ = 1; /* len */ 174 *pos++ = 1; /* len */
@@ -209,7 +209,7 @@ static void ieee80211_tdls_add_link_ie(struct ieee80211_sub_if_data *sdata,
209 rsp_addr = sdata->vif.addr; 209 rsp_addr = sdata->vif.addr;
210 } 210 }
211 211
212 lnkid = (void *)skb_put(skb, sizeof(struct ieee80211_tdls_lnkie)); 212 lnkid = skb_put(skb, sizeof(struct ieee80211_tdls_lnkie));
213 213
214 lnkid->ie_type = WLAN_EID_LINK_ID; 214 lnkid->ie_type = WLAN_EID_LINK_ID;
215 lnkid->ie_len = sizeof(struct ieee80211_tdls_lnkie) - 2; 215 lnkid->ie_len = sizeof(struct ieee80211_tdls_lnkie) - 2;
@@ -223,7 +223,7 @@ static void
223ieee80211_tdls_add_aid(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) 223ieee80211_tdls_add_aid(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
224{ 224{
225 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 225 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
226 u8 *pos = (void *)skb_put(skb, 4); 226 u8 *pos = skb_put(skb, 4);
227 227
228 *pos++ = WLAN_EID_AID; 228 *pos++ = WLAN_EID_AID;
229 *pos++ = 2; /* len */ 229 *pos++ = 2; /* len */
@@ -745,7 +745,7 @@ ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev,
745 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 745 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
746 struct ieee80211_tdls_data *tf; 746 struct ieee80211_tdls_data *tf;
747 747
748 tf = (void *)skb_put(skb, offsetof(struct ieee80211_tdls_data, u)); 748 tf = skb_put(skb, offsetof(struct ieee80211_tdls_data, u));
749 749
750 memcpy(tf->da, peer, ETH_ALEN); 750 memcpy(tf->da, peer, ETH_ALEN);
751 memcpy(tf->sa, sdata->vif.addr, ETH_ALEN); 751 memcpy(tf->sa, sdata->vif.addr, ETH_ALEN);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 18c5d6e6305d..ec5a9a72797e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3874,7 +3874,7 @@ static void __ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
3874 ps->dtim_count--; 3874 ps->dtim_count--;
3875 } 3875 }
3876 3876
3877 tim = pos = (u8 *) skb_put(skb, 6); 3877 tim = pos = skb_put(skb, 6);
3878 *pos++ = WLAN_EID_TIM; 3878 *pos++ = WLAN_EID_TIM;
3879 *pos++ = 4; 3879 *pos++ = 4;
3880 *pos++ = ps->dtim_count; 3880 *pos++ = ps->dtim_count;
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index cc19614ff4e6..0d722ea98a1b 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -949,7 +949,7 @@ ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx)
949 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) 949 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie)))
950 return TX_DROP; 950 return TX_DROP;
951 951
952 mmie = (struct ieee80211_mmie *) skb_put(skb, sizeof(*mmie)); 952 mmie = skb_put(skb, sizeof(*mmie));
953 mmie->element_id = WLAN_EID_MMIE; 953 mmie->element_id = WLAN_EID_MMIE;
954 mmie->length = sizeof(*mmie) - 2; 954 mmie->length = sizeof(*mmie) - 2;
955 mmie->key_id = cpu_to_le16(key->conf.keyidx); 955 mmie->key_id = cpu_to_le16(key->conf.keyidx);
@@ -993,7 +993,7 @@ ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx)
993 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) 993 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie)))
994 return TX_DROP; 994 return TX_DROP;
995 995
996 mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); 996 mmie = skb_put(skb, sizeof(*mmie));
997 mmie->element_id = WLAN_EID_MMIE; 997 mmie->element_id = WLAN_EID_MMIE;
998 mmie->length = sizeof(*mmie) - 2; 998 mmie->length = sizeof(*mmie) - 2;
999 mmie->key_id = cpu_to_le16(key->conf.keyidx); 999 mmie->key_id = cpu_to_le16(key->conf.keyidx);
@@ -1138,7 +1138,7 @@ ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx)
1138 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) 1138 if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie)))
1139 return TX_DROP; 1139 return TX_DROP;
1140 1140
1141 mmie = (struct ieee80211_mmie_16 *)skb_put(skb, sizeof(*mmie)); 1141 mmie = skb_put(skb, sizeof(*mmie));
1142 mmie->element_id = WLAN_EID_MMIE; 1142 mmie->element_id = WLAN_EID_MMIE;
1143 mmie->length = sizeof(*mmie) - 2; 1143 mmie->length = sizeof(*mmie) - 2;
1144 mmie->key_id = cpu_to_le16(key->conf.keyidx); 1144 mmie->key_id = cpu_to_le16(key->conf.keyidx);
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index da9704971a83..94ec0d0765a8 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -590,7 +590,7 @@ __build_packet_message(struct nfnl_log_net *log,
590 if (skb_tailroom(inst->skb) < nla_total_size(data_len)) 590 if (skb_tailroom(inst->skb) < nla_total_size(data_len))
591 goto nla_put_failure; 591 goto nla_put_failure;
592 592
593 nla = (struct nlattr *)skb_put(inst->skb, nla_total_size(data_len)); 593 nla = skb_put(inst->skb, nla_total_size(data_len));
594 nla->nla_type = NFULA_PAYLOAD; 594 nla->nla_type = NFULA_PAYLOAD;
595 nla->nla_len = size; 595 nla->nla_len = size;
596 596
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 8a0f218b7938..1b17a1b445a3 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -589,7 +589,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
589 if (skb_tailroom(skb) < sizeof(*nla) + hlen) 589 if (skb_tailroom(skb) < sizeof(*nla) + hlen)
590 goto nla_put_failure; 590 goto nla_put_failure;
591 591
592 nla = (struct nlattr *)skb_put(skb, sizeof(*nla)); 592 nla = skb_put(skb, sizeof(*nla));
593 nla->nla_type = NFQA_PAYLOAD; 593 nla->nla_type = NFQA_PAYLOAD;
594 nla->nla_len = nla_attr_size(data_len); 594 nla->nla_len = nla_attr_size(data_len);
595 595
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index bd24a975fd49..a88745e4b7df 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2104,7 +2104,7 @@ __nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int fla
2104 struct nlmsghdr *nlh; 2104 struct nlmsghdr *nlh;
2105 int size = nlmsg_msg_size(len); 2105 int size = nlmsg_msg_size(len);
2106 2106
2107 nlh = (struct nlmsghdr *)skb_put(skb, NLMSG_ALIGN(size)); 2107 nlh = skb_put(skb, NLMSG_ALIGN(size));
2108 nlh->nlmsg_type = type; 2108 nlh->nlmsg_type = type;
2109 nlh->nlmsg_len = size; 2109 nlh->nlmsg_len = size;
2110 nlh->nlmsg_flags = flags; 2110 nlh->nlmsg_flags = flags;
diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c
index 0fd5518bf252..fec47a7d0092 100644
--- a/net/nfc/digital_core.c
+++ b/net/nfc/digital_core.c
@@ -74,8 +74,8 @@ void digital_skb_add_crc(struct sk_buff *skb, crc_func_t crc_func, u16 init,
74 if (msb_first) 74 if (msb_first)
75 crc = __fswab16(crc); 75 crc = __fswab16(crc);
76 76
77 *skb_put(skb, 1) = crc & 0xFF; 77 *(u8 *)skb_put(skb, 1) = crc & 0xFF;
78 *skb_put(skb, 1) = (crc >> 8) & 0xFF; 78 *(u8 *)skb_put(skb, 1) = (crc >> 8) & 0xFF;
79} 79}
80 80
81int digital_skb_check_crc(struct sk_buff *skb, crc_func_t crc_func, 81int digital_skb_check_crc(struct sk_buff *skb, crc_func_t crc_func,
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c
index f44f75a2a4d5..82471af5553e 100644
--- a/net/nfc/digital_dep.c
+++ b/net/nfc/digital_dep.c
@@ -654,7 +654,7 @@ static int digital_in_send_rtox(struct nfc_digital_dev *ddev,
654 if (!skb) 654 if (!skb)
655 return -ENOMEM; 655 return -ENOMEM;
656 656
657 *skb_put(skb, 1) = rtox; 657 *(u8 *)skb_put(skb, 1) = rtox;
658 658
659 skb_push(skb, sizeof(struct digital_dep_req_res)); 659 skb_push(skb, sizeof(struct digital_dep_req_res));
660 660
diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c
index d9080dec5d27..fae6d31b377c 100644
--- a/net/nfc/digital_technology.c
+++ b/net/nfc/digital_technology.c
@@ -266,8 +266,8 @@ static int digital_in_send_rats(struct nfc_digital_dev *ddev,
266 if (!skb) 266 if (!skb)
267 return -ENOMEM; 267 return -ENOMEM;
268 268
269 *skb_put(skb, 1) = DIGITAL_RATS_BYTE1; 269 *(u8 *)skb_put(skb, 1) = DIGITAL_RATS_BYTE1;
270 *skb_put(skb, 1) = DIGITAL_RATS_PARAM; 270 *(u8 *)skb_put(skb, 1) = DIGITAL_RATS_PARAM;
271 271
272 rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_ats, 272 rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_ats,
273 target); 273 target);
@@ -470,8 +470,8 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev,
470 else 470 else
471 sel_cmd = DIGITAL_CMD_SEL_REQ_CL3; 471 sel_cmd = DIGITAL_CMD_SEL_REQ_CL3;
472 472
473 *skb_put(skb, sizeof(u8)) = sel_cmd; 473 *(u8 *)skb_put(skb, sizeof(u8)) = sel_cmd;
474 *skb_put(skb, sizeof(u8)) = DIGITAL_SDD_REQ_SEL_PAR; 474 *(u8 *)skb_put(skb, sizeof(u8)) = DIGITAL_SDD_REQ_SEL_PAR;
475 475
476 return digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res, 476 return digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res,
477 target); 477 target);
@@ -541,7 +541,7 @@ int digital_in_send_sens_req(struct nfc_digital_dev *ddev, u8 rf_tech)
541 if (!skb) 541 if (!skb)
542 return -ENOMEM; 542 return -ENOMEM;
543 543
544 *skb_put(skb, sizeof(u8)) = DIGITAL_CMD_SENS_REQ; 544 *(u8 *)skb_put(skb, sizeof(u8)) = DIGITAL_CMD_SENS_REQ;
545 545
546 rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sens_res, NULL); 546 rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sens_res, NULL);
547 if (rc) 547 if (rc)
@@ -625,8 +625,7 @@ static int digital_in_send_attrib_req(struct nfc_digital_dev *ddev,
625 if (!skb) 625 if (!skb)
626 return -ENOMEM; 626 return -ENOMEM;
627 627
628 attrib_req = (struct digital_attrib_req *)skb_put(skb, 628 attrib_req = skb_put(skb, sizeof(*attrib_req));
629 sizeof(*attrib_req));
630 629
631 attrib_req->cmd = DIGITAL_CMD_ATTRIB_REQ; 630 attrib_req->cmd = DIGITAL_CMD_ATTRIB_REQ;
632 memcpy(attrib_req->nfcid0, sensb_res->nfcid0, 631 memcpy(attrib_req->nfcid0, sensb_res->nfcid0,
@@ -730,8 +729,7 @@ int digital_in_send_sensb_req(struct nfc_digital_dev *ddev, u8 rf_tech)
730 if (!skb) 729 if (!skb)
731 return -ENOMEM; 730 return -ENOMEM;
732 731
733 sensb_req = (struct digital_sensb_req *)skb_put(skb, 732 sensb_req = skb_put(skb, sizeof(*sensb_req));
734 sizeof(*sensb_req));
735 733
736 sensb_req->cmd = DIGITAL_CMD_SENSB_REQ; 734 sensb_req->cmd = DIGITAL_CMD_SENSB_REQ;
737 sensb_req->afi = 0x00; /* All families and sub-families */ 735 sensb_req->afi = 0x00; /* All families and sub-families */
@@ -939,7 +937,7 @@ static int digital_tg_send_sel_res(struct nfc_digital_dev *ddev)
939 if (!skb) 937 if (!skb)
940 return -ENOMEM; 938 return -ENOMEM;
941 939
942 *skb_put(skb, 1) = DIGITAL_SEL_RES_NFC_DEP; 940 *(u8 *)skb_put(skb, 1) = DIGITAL_SEL_RES_NFC_DEP;
943 941
944 if (!DIGITAL_DRV_CAPS_TG_CRC(ddev)) 942 if (!DIGITAL_DRV_CAPS_TG_CRC(ddev))
945 digital_skb_add_crc_a(skb); 943 digital_skb_add_crc_a(skb);
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 8741ad47a6fb..3a0c94590411 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -874,7 +874,7 @@ static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb)
874 return; 874 return;
875 } 875 }
876 876
877 *skb_put(hcp_skb, NFC_HCI_HCP_PACKET_HEADER_LEN) = pipe; 877 *(u8 *)skb_put(hcp_skb, NFC_HCI_HCP_PACKET_HEADER_LEN) = pipe;
878 878
879 skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) { 879 skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) {
880 msg_len = frag_skb->len - NFC_HCI_HCP_PACKET_HEADER_LEN; 880 msg_len = frag_skb->len - NFC_HCI_HCP_PACKET_HEADER_LEN;
diff --git a/net/nfc/hci/llc_shdlc.c b/net/nfc/hci/llc_shdlc.c
index 401c7e255273..9ab4a05f086f 100644
--- a/net/nfc/hci/llc_shdlc.c
+++ b/net/nfc/hci/llc_shdlc.c
@@ -382,8 +382,8 @@ static int llc_shdlc_connect_initiate(struct llc_shdlc *shdlc)
382 if (skb == NULL) 382 if (skb == NULL)
383 return -ENOMEM; 383 return -ENOMEM;
384 384
385 *skb_put(skb, 1) = SHDLC_MAX_WINDOW; 385 *(u8 *)skb_put(skb, 1) = SHDLC_MAX_WINDOW;
386 *skb_put(skb, 1) = SHDLC_SREJ_SUPPORT ? 1 : 0; 386 *(u8 *)skb_put(skb, 1) = SHDLC_SREJ_SUPPORT ? 1 : 0;
387 387
388 return llc_shdlc_send_u_frame(shdlc, skb, U_FRAME_RSET); 388 return llc_shdlc_send_u_frame(shdlc, skb, U_FRAME_RSET);
389} 389}
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 17b9f1ce23db..a3dac34cf790 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1341,7 +1341,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload)
1341 return -ENOMEM; 1341 return -ENOMEM;
1342 } 1342 }
1343 1343
1344 hdr = (struct nci_ctrl_hdr *) skb_put(skb, NCI_CTRL_HDR_SIZE); 1344 hdr = skb_put(skb, NCI_CTRL_HDR_SIZE);
1345 hdr->gid = nci_opcode_gid(opcode); 1345 hdr->gid = nci_opcode_gid(opcode);
1346 hdr->oid = nci_opcode_oid(opcode); 1346 hdr->oid = nci_opcode_oid(opcode);
1347 hdr->plen = plen; 1347 hdr->plen = plen;
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index d4a53ce818c3..d1119bb35f24 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -472,7 +472,7 @@ void nci_hci_data_received_cb(void *context,
472 return; 472 return;
473 } 473 }
474 474
475 *skb_put(hcp_skb, NCI_HCI_HCP_PACKET_HEADER_LEN) = pipe; 475 *(u8 *)skb_put(hcp_skb, NCI_HCI_HCP_PACKET_HEADER_LEN) = pipe;
476 476
477 skb_queue_walk(&ndev->hci_dev->rx_hcp_frags, frag_skb) { 477 skb_queue_walk(&ndev->hci_dev->rx_hcp_frags, frag_skb) {
478 msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN; 478 msg_len = frag_skb->len - NCI_HCI_HCP_PACKET_HEADER_LEN;
diff --git a/net/nfc/nci/spi.c b/net/nfc/nci/spi.c
index d904cd2f1442..a502a334918a 100644
--- a/net/nfc/nci/spi.c
+++ b/net/nfc/nci/spi.c
@@ -86,8 +86,8 @@ int nci_spi_send(struct nci_spi *nspi,
86 u16 crc; 86 u16 crc;
87 87
88 crc = crc_ccitt(CRC_INIT, skb->data, skb->len); 88 crc = crc_ccitt(CRC_INIT, skb->data, skb->len);
89 *skb_put(skb, 1) = crc >> 8; 89 *(u8 *)skb_put(skb, 1) = crc >> 8;
90 *skb_put(skb, 1) = crc & 0xFF; 90 *(u8 *)skb_put(skb, 1) = crc & 0xFF;
91 } 91 }
92 92
93 if (write_handshake_completion) { 93 if (write_handshake_completion) {
@@ -172,8 +172,8 @@ static int send_acknowledge(struct nci_spi *nspi, u8 acknowledge)
172 hdr[3] = 0; 172 hdr[3] = 0;
173 173
174 crc = crc_ccitt(CRC_INIT, skb->data, skb->len); 174 crc = crc_ccitt(CRC_INIT, skb->data, skb->len);
175 *skb_put(skb, 1) = crc >> 8; 175 *(u8 *)skb_put(skb, 1) = crc >> 8;
176 *skb_put(skb, 1) = crc & 0xFF; 176 *(u8 *)skb_put(skb, 1) = crc & 0xFF;
177 177
178 ret = __nci_spi_send(nspi, skb, 0); 178 ret = __nci_spi_send(nspi, skb, 0);
179 179
diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c
index cfa7f352c1c3..442f8eadfc76 100644
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -355,7 +355,7 @@ static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data,
355 355
356 /* Eat byte after byte till full packet header is received */ 356 /* Eat byte after byte till full packet header is received */
357 if (nu->rx_skb->len < NCI_CTRL_HDR_SIZE) { 357 if (nu->rx_skb->len < NCI_CTRL_HDR_SIZE) {
358 *skb_put(nu->rx_skb, 1) = *data++; 358 *(u8 *)skb_put(nu->rx_skb, 1) = *data++;
359 --count; 359 --count;
360 continue; 360 continue;
361 } 361 }
diff --git a/net/psample/psample.c b/net/psample/psample.c
index 8aa58a918783..3a6ad0f438dc 100644
--- a/net/psample/psample.c
+++ b/net/psample/psample.c
@@ -264,7 +264,7 @@ void psample_sample_packet(struct psample_group *group, struct sk_buff *skb,
264 int nla_len = nla_total_size(data_len); 264 int nla_len = nla_total_size(data_len);
265 struct nlattr *nla; 265 struct nlattr *nla;
266 266
267 nla = (struct nlattr *)skb_put(nl_skb, nla_len); 267 nla = skb_put(nl_skb, nla_len);
268 nla->nla_type = PSAMPLE_ATTR_DATA; 268 nla->nla_type = PSAMPLE_ATTR_DATA;
269 nla->nla_len = nla_attr_size(data_len); 269 nla->nla_len = nla_attr_size(data_len);
270 270
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index cff679167bdc..5586609afa27 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -259,7 +259,7 @@ static struct sk_buff *qrtr_alloc_ctrl_packet(u32 type, size_t pkt_len,
259 return NULL; 259 return NULL;
260 skb_reset_transport_header(skb); 260 skb_reset_transport_header(skb);
261 261
262 hdr = (struct qrtr_hdr *)skb_put(skb, QRTR_HDR_SIZE); 262 hdr = skb_put(skb, QRTR_HDR_SIZE);
263 hdr->version = cpu_to_le32(QRTR_PROTO_VER); 263 hdr->version = cpu_to_le32(QRTR_PROTO_VER);
264 hdr->type = cpu_to_le32(type); 264 hdr->type = cpu_to_le32(type);
265 hdr->src_node_id = cpu_to_le32(src_node); 265 hdr->src_node_id = cpu_to_le32(src_node);
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 034e916362cf..2c196b3e9cd3 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1389,7 +1389,7 @@ static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc,
1389 goto nodata; 1389 goto nodata;
1390 1390
1391 /* Make room for the chunk header. */ 1391 /* Make room for the chunk header. */
1392 chunk_hdr = (sctp_chunkhdr_t *)skb_put(skb, sizeof(sctp_chunkhdr_t)); 1392 chunk_hdr = skb_put(skb, sizeof(sctp_chunkhdr_t));
1393 chunk_hdr->type = type; 1393 chunk_hdr->type = type;
1394 chunk_hdr->flags = flags; 1394 chunk_hdr->flags = flags;
1395 chunk_hdr->length = htons(sizeof(sctp_chunkhdr_t)); 1395 chunk_hdr->length = htons(sizeof(sctp_chunkhdr_t));
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index ec2b3e013c2f..e361f0b57fb6 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -167,8 +167,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
167 goto fail; 167 goto fail;
168 168
169 skb = sctp_event2skb(event); 169 skb = sctp_event2skb(event);
170 sac = (struct sctp_assoc_change *) skb_put(skb, 170 sac = skb_put(skb, sizeof(struct sctp_assoc_change));
171 sizeof(struct sctp_assoc_change));
172 } 171 }
173 172
174 /* Socket Extensions for SCTP 173 /* Socket Extensions for SCTP
@@ -270,8 +269,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
270 goto fail; 269 goto fail;
271 270
272 skb = sctp_event2skb(event); 271 skb = sctp_event2skb(event);
273 spc = (struct sctp_paddr_change *) 272 spc = skb_put(skb, sizeof(struct sctp_paddr_change));
274 skb_put(skb, sizeof(struct sctp_paddr_change));
275 273
276 /* Sockets API Extensions for SCTP 274 /* Sockets API Extensions for SCTP
277 * Section 5.3.1.2 SCTP_PEER_ADDR_CHANGE 275 * Section 5.3.1.2 SCTP_PEER_ADDR_CHANGE
@@ -549,8 +547,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
549 goto fail; 547 goto fail;
550 548
551 skb = sctp_event2skb(event); 549 skb = sctp_event2skb(event);
552 sse = (struct sctp_shutdown_event *) 550 sse = skb_put(skb, sizeof(struct sctp_shutdown_event));
553 skb_put(skb, sizeof(struct sctp_shutdown_event));
554 551
555 /* Socket Extensions for SCTP 552 /* Socket Extensions for SCTP
556 * 5.3.1.5 SCTP_SHUTDOWN_EVENT 553 * 5.3.1.5 SCTP_SHUTDOWN_EVENT
@@ -612,8 +609,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication(
612 goto fail; 609 goto fail;
613 610
614 skb = sctp_event2skb(event); 611 skb = sctp_event2skb(event);
615 sai = (struct sctp_adaptation_event *) 612 sai = skb_put(skb, sizeof(struct sctp_adaptation_event));
616 skb_put(skb, sizeof(struct sctp_adaptation_event));
617 613
618 sai->sai_type = SCTP_ADAPTATION_INDICATION; 614 sai->sai_type = SCTP_ADAPTATION_INDICATION;
619 sai->sai_flags = 0; 615 sai->sai_flags = 0;
@@ -751,8 +747,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
751 goto fail; 747 goto fail;
752 748
753 skb = sctp_event2skb(event); 749 skb = sctp_event2skb(event);
754 pd = (struct sctp_pdapi_event *) 750 pd = skb_put(skb, sizeof(struct sctp_pdapi_event));
755 skb_put(skb, sizeof(struct sctp_pdapi_event));
756 751
757 /* pdapi_type 752 /* pdapi_type
758 * It should be SCTP_PARTIAL_DELIVERY_EVENT 753 * It should be SCTP_PARTIAL_DELIVERY_EVENT
@@ -803,8 +798,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_authkey(
803 goto fail; 798 goto fail;
804 799
805 skb = sctp_event2skb(event); 800 skb = sctp_event2skb(event);
806 ak = (struct sctp_authkey_event *) 801 ak = skb_put(skb, sizeof(struct sctp_authkey_event));
807 skb_put(skb, sizeof(struct sctp_authkey_event));
808 802
809 ak->auth_type = SCTP_AUTHENTICATION_EVENT; 803 ak->auth_type = SCTP_AUTHENTICATION_EVENT;
810 ak->auth_flags = 0; 804 ak->auth_flags = 0;
@@ -842,8 +836,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_sender_dry_event(
842 return NULL; 836 return NULL;
843 837
844 skb = sctp_event2skb(event); 838 skb = sctp_event2skb(event);
845 sdry = (struct sctp_sender_dry_event *) 839 sdry = skb_put(skb, sizeof(struct sctp_sender_dry_event));
846 skb_put(skb, sizeof(struct sctp_sender_dry_event));
847 840
848 sdry->sender_dry_type = SCTP_SENDER_DRY_EVENT; 841 sdry->sender_dry_type = SCTP_SENDER_DRY_EVENT;
849 sdry->sender_dry_flags = 0; 842 sdry->sender_dry_flags = 0;
@@ -869,7 +862,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_stream_reset_event(
869 return NULL; 862 return NULL;
870 863
871 skb = sctp_event2skb(event); 864 skb = sctp_event2skb(event);
872 sreset = (struct sctp_stream_reset_event *)skb_put(skb, length); 865 sreset = skb_put(skb, length);
873 866
874 sreset->strreset_type = SCTP_STREAM_RESET_EVENT; 867 sreset->strreset_type = SCTP_STREAM_RESET_EVENT;
875 sreset->strreset_flags = flags; 868 sreset->strreset_flags = flags;
@@ -897,8 +890,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_reset_event(
897 return NULL; 890 return NULL;
898 891
899 skb = sctp_event2skb(event); 892 skb = sctp_event2skb(event);
900 areset = (struct sctp_assoc_reset_event *) 893 areset = skb_put(skb, sizeof(struct sctp_assoc_reset_event));
901 skb_put(skb, sizeof(struct sctp_assoc_reset_event));
902 894
903 areset->assocreset_type = SCTP_ASSOC_RESET_EVENT; 895 areset->assocreset_type = SCTP_ASSOC_RESET_EVENT;
904 areset->assocreset_flags = flags; 896 areset->assocreset_flags = flags;
@@ -925,8 +917,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_stream_change_event(
925 return NULL; 917 return NULL;
926 918
927 skb = sctp_event2skb(event); 919 skb = sctp_event2skb(event);
928 schange = (struct sctp_stream_change_event *) 920 schange = skb_put(skb, sizeof(struct sctp_stream_change_event));
929 skb_put(skb, sizeof(struct sctp_stream_change_event));
930 921
931 schange->strchange_type = SCTP_STREAM_CHANGE_EVENT; 922 schange->strchange_type = SCTP_STREAM_CHANGE_EVENT;
932 schange->strchange_flags = flags; 923 schange->strchange_flags = flags;
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 24e2054bfbaf..7d6ee03f2762 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -99,7 +99,7 @@ static struct sk_buff *virtio_transport_build_skb(void *opaque)
99 if (!skb) 99 if (!skb)
100 return NULL; 100 return NULL;
101 101
102 hdr = (struct af_vsockmon_hdr *)skb_put(skb, sizeof(*hdr)); 102 hdr = skb_put(skb, sizeof(*hdr));
103 103
104 /* pkt->hdr is little-endian so no need to byteswap here */ 104 /* pkt->hdr is little-endian so no need to byteswap here */
105 hdr->src_cid = pkt->hdr.src_cid; 105 hdr->src_cid = pkt->hdr.src_cid;