Commit 324148788bf3744d90fb6894ec5744eb0ca91b74

Authored by Julia Lawall
Committed by Greg Kroah-Hartman
1 parent a05d08c40c

Staging: Drop memory allocation cast

Drop cast on the result of kmalloc and similar functions.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
@@

- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 33 changed files with 52 additions and 59 deletions Side-by-side Diff

drivers/staging/comedi/drivers/unioxx5.c
... ... @@ -285,7 +285,7 @@
285 285 return -EIO;
286 286 }
287 287  
288   - usp = (struct unioxx5_subd_priv *)kzalloc(sizeof(*usp), GFP_KERNEL);
  288 + usp = kzalloc(sizeof(*usp), GFP_KERNEL);
289 289  
290 290 if (usp == NULL) {
291 291 printk(KERN_ERR "comedi%d: erorr! --> out of memory!\n", minor);
drivers/staging/crystalhd/crystalhd_misc.c
... ... @@ -887,7 +887,7 @@
887 887 BC_LINK_SG_POOL_SZ, max_pages, asz, adp->fill_byte_pool);
888 888  
889 889 for (i = 0; i < BC_LINK_SG_POOL_SZ; i++) {
890   - temp = (uint8_t *)kzalloc(asz, GFP_KERNEL);
  890 + temp = kzalloc(asz, GFP_KERNEL);
891 891 if ((temp) == NULL) {
892 892 BCMLOG_ERR("Failed to alloc %d mem\n", asz);
893 893 return -ENOMEM;
drivers/staging/cx25821/cx25821-audio-upstream.c
... ... @@ -751,8 +751,7 @@
751 751  
752 752 if (dev->input_audiofilename) {
753 753 str_length = strlen(dev->input_audiofilename);
754   - dev->_audiofilename =
755   - (char *)kmalloc(str_length + 1, GFP_KERNEL);
  754 + dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
756 755  
757 756 if (!dev->_audiofilename)
758 757 goto error;
... ... @@ -766,8 +765,7 @@
766 765 }
767 766 } else {
768 767 str_length = strlen(_defaultAudioName);
769   - dev->_audiofilename =
770   - (char *)kmalloc(str_length + 1, GFP_KERNEL);
  768 + dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
771 769  
772 770 if (!dev->_audiofilename)
773 771 goto error;
drivers/staging/cx25821/cx25821-video-upstream-ch2.c
... ... @@ -769,8 +769,7 @@
769 769  
770 770 if (dev->input_filename_ch2) {
771 771 str_length = strlen(dev->input_filename_ch2);
772   - dev->_filename_ch2 =
773   - (char *)kmalloc(str_length + 1, GFP_KERNEL);
  772 + dev->_filename_ch2 = kmalloc(str_length + 1, GFP_KERNEL);
774 773  
775 774 if (!dev->_filename_ch2)
776 775 goto error;
... ... @@ -779,8 +778,7 @@
779 778 str_length + 1);
780 779 } else {
781 780 str_length = strlen(dev->_defaultname_ch2);
782   - dev->_filename_ch2 =
783   - (char *)kmalloc(str_length + 1, GFP_KERNEL);
  781 + dev->_filename_ch2 = kmalloc(str_length + 1, GFP_KERNEL);
784 782  
785 783 if (!dev->_filename_ch2)
786 784 goto error;
drivers/staging/cx25821/cx25821-video-upstream.c
... ... @@ -825,7 +825,7 @@
825 825  
826 826 if (dev->input_filename) {
827 827 str_length = strlen(dev->input_filename);
828   - dev->_filename = (char *)kmalloc(str_length + 1, GFP_KERNEL);
  828 + dev->_filename = kmalloc(str_length + 1, GFP_KERNEL);
829 829  
830 830 if (!dev->_filename)
831 831 goto error;
... ... @@ -833,7 +833,7 @@
833 833 memcpy(dev->_filename, dev->input_filename, str_length + 1);
834 834 } else {
835 835 str_length = strlen(dev->_defaultname);
836   - dev->_filename = (char *)kmalloc(str_length + 1, GFP_KERNEL);
  836 + dev->_filename = kmalloc(str_length + 1, GFP_KERNEL);
837 837  
838 838 if (!dev->_filename)
839 839 goto error;
drivers/staging/et131x/et1310_rx.c
... ... @@ -547,7 +547,7 @@
547 547  
548 548 /* Setup each RFD */
549 549 for (rfdct = 0; rfdct < rx_ring->NumRfd; rfdct++) {
550   - rfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
  550 + rfd = kmem_cache_alloc(rx_ring->RecvLookaside,
551 551 GFP_ATOMIC | GFP_DMA);
552 552  
553 553 if (!rfd) {
drivers/staging/et131x/et1310_tx.c
... ... @@ -112,7 +112,7 @@
112 112 struct tx_ring *tx_ring = &adapter->tx_ring;
113 113  
114 114 /* Allocate memory for the TCB's (Transmit Control Block) */
115   - adapter->tx_ring.tcb_ring = (struct tcb *)
  115 + adapter->tx_ring.tcb_ring =
116 116 kcalloc(NUM_TCB, sizeof(struct tcb), GFP_ATOMIC | GFP_DMA);
117 117 if (!adapter->tx_ring.tcb_ring) {
118 118 dev_err(&adapter->pdev->dev, "Cannot alloc memory for TCBs\n");
drivers/staging/rt2860/common/cmm_data.c
... ... @@ -1424,7 +1424,7 @@
1424 1424 if ((Header802_3[12] == 0x88) && (Header802_3[13] == 0x8E)) {
1425 1425 /* avoid local heap overflow, use dyanamic allocation */
1426 1426 struct rt_mlme_queue_elem *Elem =
1427   - (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
  1427 + kmalloc(sizeof(struct rt_mlme_queue_elem),
1428 1428 MEM_ALLOC_FLAG);
1429 1429 if (Elem != NULL) {
1430 1430 memmove(Elem->Msg +
drivers/staging/rt2860/common/cmm_mac_pci.c
... ... @@ -1558,7 +1558,7 @@
1558 1558 if (INFRA_ON(pAd) || ADHOC_ON(pAd)) {
1559 1559 struct rt_mlme_disassoc_req DisReq;
1560 1560 struct rt_mlme_queue_elem *pMsgElem =
1561   - (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
  1561 + kmalloc(sizeof(struct rt_mlme_queue_elem),
1562 1562 MEM_ALLOC_FLAG);
1563 1563  
1564 1564 if (pMsgElem) {
drivers/staging/rt2860/common/cmm_mac_usb.c
... ... @@ -1087,7 +1087,7 @@
1087 1087 if (INFRA_ON(pAd) || ADHOC_ON(pAd)) {
1088 1088 struct rt_mlme_disassoc_req DisReq;
1089 1089 struct rt_mlme_queue_elem *pMsgElem =
1090   - (struct rt_mlme_queue_elem *)kmalloc(sizeof(struct rt_mlme_queue_elem),
  1090 + kmalloc(sizeof(struct rt_mlme_queue_elem),
1091 1091 MEM_ALLOC_FLAG);
1092 1092  
1093 1093 if (pMsgElem) {
drivers/staging/rt2860/rt_linux.c
... ... @@ -154,7 +154,7 @@
154 154 /* pAd MUST allow to be NULL */
155 155 int os_alloc_mem(struct rt_rtmp_adapter *pAd, u8 ** mem, unsigned long size)
156 156 {
157   - *mem = (u8 *)kmalloc(size, GFP_ATOMIC);
  157 + *mem = kmalloc(size, GFP_ATOMIC);
158 158 if (*mem)
159 159 return NDIS_STATUS_SUCCESS;
160 160 else
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
... ... @@ -1435,7 +1435,7 @@
1435 1435  
1436 1436 if(*(t++) == MFIE_TYPE_CHALLENGE){
1437 1437 *chlen = *(t++);
1438   - *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
  1438 + *challenge = kmalloc(*chlen, GFP_ATOMIC);
1439 1439 memcpy(*challenge, t, *chlen);
1440 1440 }
1441 1441 }
... ... @@ -2861,8 +2861,7 @@
2861 2861  
2862 2862 ieee80211_crypt_delayed_deinit(ieee, crypt);
2863 2863  
2864   - new_crypt = (struct ieee80211_crypt_data *)
2865   - kmalloc(sizeof(*new_crypt), GFP_KERNEL);
  2864 + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
2866 2865 if (new_crypt == NULL) {
2867 2866 ret = -ENOMEM;
2868 2867 goto done;
... ... @@ -2953,7 +2952,7 @@
2953 2952 goto out;
2954 2953 }
2955 2954  
2956   - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  2955 + param = kmalloc(p->length, GFP_KERNEL);
2957 2956 if (param == NULL){
2958 2957 ret = -ENOMEM;
2959 2958 goto out;
drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
... ... @@ -170,7 +170,7 @@
170 170 ieee80211_softmac_init(ieee);
171 171  
172 172 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
173   - ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
  173 + ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
174 174 #else
175 175 ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kmalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
176 176 memset(ieee->pHTInfo,0,sizeof(RT_HIGH_THROUGHPUT));
drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c
... ... @@ -1397,7 +1397,7 @@
1397 1397 /* skb: hdr + (possible reassembled) full plaintext payload */
1398 1398 payload = skb->data + hdrlen;
1399 1399 //ethertype = (payload[6] << 8) | payload[7];
1400   - rxb = (struct ieee80211_rxb*)kmalloc(sizeof(struct ieee80211_rxb),GFP_ATOMIC);
  1400 + rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC);
1401 1401 if(rxb == NULL)
1402 1402 {
1403 1403 IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__FUNCTION__);
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
... ... @@ -1800,7 +1800,7 @@
1800 1800  
1801 1801 if(*(t++) == MFIE_TYPE_CHALLENGE){
1802 1802 *chlen = *(t++);
1803   - *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
  1803 + *challenge = kmalloc(*chlen, GFP_ATOMIC);
1804 1804 memcpy(*challenge, t, *chlen);
1805 1805 }
1806 1806 }
... ... @@ -3459,8 +3459,7 @@
3459 3459  
3460 3460 ieee80211_crypt_delayed_deinit(ieee, crypt);
3461 3461  
3462   - new_crypt = (struct ieee80211_crypt_data *)
3463   - kmalloc(sizeof(*new_crypt), GFP_KERNEL);
  3462 + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
3464 3463 if (new_crypt == NULL) {
3465 3464 ret = -ENOMEM;
3466 3465 goto done;
... ... @@ -3592,7 +3591,7 @@
3592 3591 goto out;
3593 3592 }
3594 3593  
3595   - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  3594 + param = kmalloc(p->length, GFP_KERNEL);
3596 3595 if (param == NULL){
3597 3596 ret = -ENOMEM;
3598 3597 goto out;
drivers/staging/rtl8192e/r8192E_core.c
... ... @@ -5040,7 +5040,7 @@
5040 5040 goto out;
5041 5041 }
5042 5042  
5043   - ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  5043 + ipw = kmalloc(p->length, GFP_KERNEL);
5044 5044 if (ipw == NULL){
5045 5045 ret = -ENOMEM;
5046 5046 goto out;
drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
... ... @@ -161,7 +161,7 @@
161 161  
162 162 ieee80211_softmac_init(ieee);
163 163  
164   - ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
  164 + ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
165 165 if (ieee->pHTInfo == NULL)
166 166 {
167 167 IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n");
drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
... ... @@ -1191,7 +1191,7 @@
1191 1191 /* skb: hdr + (possible reassembled) full plaintext payload */
1192 1192 payload = skb->data + hdrlen;
1193 1193 //ethertype = (payload[6] << 8) | payload[7];
1194   - rxb = (struct ieee80211_rxb*)kmalloc(sizeof(struct ieee80211_rxb),GFP_ATOMIC);
  1194 + rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC);
1195 1195 if(rxb == NULL)
1196 1196 {
1197 1197 IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__FUNCTION__);
drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
... ... @@ -1557,7 +1557,7 @@
1557 1557  
1558 1558 if(*(t++) == MFIE_TYPE_CHALLENGE){
1559 1559 *chlen = *(t++);
1560   - *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
  1560 + *challenge = kmalloc(*chlen, GFP_ATOMIC);
1561 1561 memcpy(*challenge, t, *chlen);
1562 1562 }
1563 1563 }
... ... @@ -3048,8 +3048,7 @@
3048 3048  
3049 3049 ieee80211_crypt_delayed_deinit(ieee, crypt);
3050 3050  
3051   - new_crypt = (struct ieee80211_crypt_data *)
3052   - kmalloc(sizeof(*new_crypt), GFP_KERNEL);
  3051 + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
3053 3052 if (new_crypt == NULL) {
3054 3053 ret = -ENOMEM;
3055 3054 goto done;
... ... @@ -3182,7 +3181,7 @@
3182 3181 goto out;
3183 3182 }
3184 3183  
3185   - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  3184 + param = kmalloc(p->length, GFP_KERNEL);
3186 3185 if (param == NULL){
3187 3186 ret = -ENOMEM;
3188 3187 goto out;
drivers/staging/rtl8192su/r8192U_core.c
... ... @@ -5747,7 +5747,7 @@
5747 5747 goto out;
5748 5748 }
5749 5749  
5750   - ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  5750 + ipw = kmalloc(p->length, GFP_KERNEL);
5751 5751 if (ipw == NULL){
5752 5752 ret = -ENOMEM;
5753 5753 goto out;
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
... ... @@ -161,7 +161,7 @@
161 161  
162 162 ieee80211_softmac_init(ieee);
163 163  
164   - ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
  164 + ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
165 165 if (ieee->pHTInfo == NULL)
166 166 {
167 167 IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n");
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
... ... @@ -1302,7 +1302,7 @@
1302 1302 /* skb: hdr + (possible reassembled) full plaintext payload */
1303 1303 payload = skb->data + hdrlen;
1304 1304 //ethertype = (payload[6] << 8) | payload[7];
1305   - rxb = (struct ieee80211_rxb*)kmalloc(sizeof(struct ieee80211_rxb),GFP_ATOMIC);
  1305 + rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC);
1306 1306 if(rxb == NULL)
1307 1307 {
1308 1308 IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__FUNCTION__);
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
... ... @@ -1579,7 +1579,7 @@
1579 1579  
1580 1580 if(*(t++) == MFIE_TYPE_CHALLENGE){
1581 1581 *chlen = *(t++);
1582   - *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC);
  1582 + *challenge = kmalloc(*chlen, GFP_ATOMIC);
1583 1583 if (!*challenge)
1584 1584 return -ENOMEM;
1585 1585 memcpy(*challenge, t, *chlen);
... ... @@ -3077,8 +3077,7 @@
3077 3077  
3078 3078 ieee80211_crypt_delayed_deinit(ieee, crypt);
3079 3079  
3080   - new_crypt = (struct ieee80211_crypt_data *)
3081   - kmalloc(sizeof(*new_crypt), GFP_KERNEL);
  3080 + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
3082 3081 if (new_crypt == NULL) {
3083 3082 ret = -ENOMEM;
3084 3083 goto done;
... ... @@ -3210,7 +3209,7 @@
3210 3209 goto out;
3211 3210 }
3212 3211  
3213   - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  3212 + param = kmalloc(p->length, GFP_KERNEL);
3214 3213 if (param == NULL){
3215 3214 ret = -ENOMEM;
3216 3215 goto out;
drivers/staging/rtl8192u/r8192U_core.c
... ... @@ -2216,7 +2216,8 @@
2216 2216 {
2217 2217 struct r8192_priv *priv = ieee80211_priv(dev);
2218 2218  
2219   - priv->rx_urb = (struct urb**) kmalloc (sizeof(struct urb*) * (MAX_RX_URB+1), GFP_KERNEL);
  2219 + priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB+1),
  2220 + GFP_KERNEL);
2220 2221  
2221 2222 #ifndef JACKSON_NEW_RX
2222 2223 for(i=0;i<(MAX_RX_URB+1);i++){
... ... @@ -2250,7 +2251,8 @@
2250 2251 #endif
2251 2252  
2252 2253 memset(priv->rx_urb, 0, sizeof(struct urb*) * MAX_RX_URB);
2253   - priv->pp_rxskb = (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB, GFP_KERNEL);
  2254 + priv->pp_rxskb = kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB,
  2255 + GFP_KERNEL);
2254 2256 if (priv->pp_rxskb == NULL)
2255 2257 goto destroy;
2256 2258  
... ... @@ -2839,7 +2841,7 @@
2839 2841 (priv->EarlyRxThreshold == 7 ? RCR_ONLYERLPKT:0);
2840 2842  
2841 2843 priv->AcmControl = 0;
2842   - priv->pFirmware = (rt_firmware*)kmalloc(sizeof(rt_firmware), GFP_KERNEL);
  2844 + priv->pFirmware = kmalloc(sizeof(rt_firmware), GFP_KERNEL);
2843 2845 if (priv->pFirmware)
2844 2846 memset(priv->pFirmware, 0, sizeof(rt_firmware));
2845 2847  
... ... @@ -4415,7 +4417,7 @@
4415 4417 goto out;
4416 4418 }
4417 4419  
4418   - ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
  4420 + ipw = kmalloc(p->length, GFP_KERNEL);
4419 4421 if (ipw == NULL){
4420 4422 ret = -ENOMEM;
4421 4423 goto out;
drivers/staging/vme/bridges/vme_ca91cx42.c
... ... @@ -941,8 +941,7 @@
941 941 dev = list->parent->parent->parent;
942 942  
943 943 /* XXX descriptor must be aligned on 64-bit boundaries */
944   - entry = (struct ca91cx42_dma_entry *)
945   - kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
  944 + entry = kmalloc(sizeof(struct ca91cx42_dma_entry), GFP_KERNEL);
946 945 if (entry == NULL) {
947 946 dev_err(dev, "Failed to allocate memory for dma resource "
948 947 "structure\n");
drivers/staging/vme/bridges/vme_tsi148.c
... ... @@ -2309,7 +2309,7 @@
2309 2309 if (err_chk) {
2310 2310 master_num--;
2311 2311  
2312   - tsi148_device->flush_image = (struct vme_master_resource *)
  2312 + tsi148_device->flush_image =
2313 2313 kmalloc(sizeof(struct vme_master_resource), GFP_KERNEL);
2314 2314 if (tsi148_device->flush_image == NULL) {
2315 2315 dev_err(&pdev->dev, "Failed to allocate memory for "
drivers/staging/vt6655/device_main.c
... ... @@ -3025,7 +3025,7 @@
3025 3025 goto error1;
3026 3026 }
3027 3027  
3028   -buffer = (UCHAR *)kmalloc(1024, GFP_KERNEL);
  3028 +buffer = kmalloc(1024, GFP_KERNEL);
3029 3029 if(buffer==NULL) {
3030 3030 printk("alllocate mem for file fail?\n");
3031 3031 result = -1;
drivers/staging/vt6655/hostap.c
... ... @@ -90,7 +90,7 @@
90 90  
91 91 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
92 92  
93   - pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
  93 + pDevice->apdev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
94 94 if (pDevice->apdev == NULL)
95 95 return -ENOMEM;
96 96 memset(pDevice->apdev, 0, sizeof(struct net_device));
... ... @@ -768,7 +768,7 @@
768 768 p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
769 769 return -EINVAL;
770 770  
771   - param = (struct viawget_hostapd_param *) kmalloc((int)p->length, (int)GFP_KERNEL);
  771 + param = kmalloc((int)p->length, (int)GFP_KERNEL);
772 772 if (param == NULL)
773 773 return -ENOMEM;
774 774  
drivers/staging/vt6655/wpactl.c
... ... @@ -905,7 +905,7 @@
905 905 p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
906 906 return -EINVAL;
907 907  
908   - param = (struct viawget_wpa_param *) kmalloc((int)p->length, (int)GFP_KERNEL);
  908 + param = kmalloc((int)p->length, (int)GFP_KERNEL);
909 909 if (param == NULL)
910 910 return -ENOMEM;
911 911  
drivers/staging/vt6656/hostap.c
... ... @@ -91,7 +91,7 @@
91 91  
92 92 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
93 93  
94   - pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
  94 + pDevice->apdev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
95 95 if (pDevice->apdev == NULL)
96 96 return -ENOMEM;
97 97 memset(pDevice->apdev, 0, sizeof(struct net_device));
... ... @@ -766,7 +766,7 @@
766 766 p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
767 767 return -EINVAL;
768 768  
769   - param = (struct viawget_hostapd_param *) kmalloc((int)p->length, (int)GFP_KERNEL);
  769 + param = kmalloc((int)p->length, (int)GFP_KERNEL);
770 770 if (param == NULL)
771 771 return -ENOMEM;
772 772  
drivers/staging/vt6656/main_usb.c
... ... @@ -1511,7 +1511,7 @@
1511 1511 goto error1;
1512 1512 }
1513 1513  
1514   - buffer = (UCHAR *)kmalloc(1024, GFP_KERNEL);
  1514 + buffer = kmalloc(1024, GFP_KERNEL);
1515 1515 if(buffer==NULL) {
1516 1516 printk("alllocate mem for file fail?\n");
1517 1517 result = -1;
drivers/staging/vt6656/wpactl.c
... ... @@ -926,7 +926,7 @@
926 926 p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
927 927 return -EINVAL;
928 928  
929   - param = (struct viawget_wpa_param *) kmalloc((int)p->length, (int)GFP_KERNEL);
  929 + param = kmalloc((int)p->length, (int)GFP_KERNEL);
930 930 if (param == NULL)
931 931 return -ENOMEM;
932 932  
drivers/staging/wlags49_h2/wl_priv.c
... ... @@ -618,7 +618,7 @@
618 618 LTV record, try to allocate it from the kernel stack.
619 619 Otherwise, we just use our local LTV record. */
620 620 if( urq->len > sizeof( lp->ltvRecord )) {
621   - pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL );
  621 + pLtv = kmalloc(urq->len, GFP_KERNEL);
622 622 if (pLtv != NULL) {
623 623 ltvAllocated = TRUE;
624 624 } else {
... ... @@ -1298,7 +1298,7 @@
1298 1298 LTV record, try to allocate it from the kernel stack.
1299 1299 Otherwise, we just use our local LTV record. */
1300 1300 if( urq->len > sizeof( lp->ltvRecord )) {
1301   - pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL );
  1301 + pLtv = kmalloc(urq->len, GFP_KERNEL);
1302 1302 if (pLtv != NULL) {
1303 1303 ltvAllocated = TRUE;
1304 1304