Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Julia Lawall and committed by
Greg Kroah-Hartman
32414878 a05d08c4

+52 -59
+1 -1
drivers/staging/comedi/drivers/unioxx5.c
··· 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);
+1 -1
drivers/staging/crystalhd/crystalhd_misc.c
··· 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;
+2 -4
drivers/staging/cx25821/cx25821-audio-upstream.c
··· 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; ··· 765 766 } 766 767 } else { 767 768 str_length = strlen(_defaultAudioName); 768 - dev->_audiofilename = 769 - (char *)kmalloc(str_length + 1, GFP_KERNEL); 769 + dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL); 770 770 771 771 if (!dev->_audiofilename) 772 772 goto error;
+2 -4
drivers/staging/cx25821/cx25821-video-upstream-ch2.c
··· 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; ··· 778 779 str_length + 1); 779 780 } else { 780 781 str_length = strlen(dev->_defaultname_ch2); 781 - dev->_filename_ch2 = 782 - (char *)kmalloc(str_length + 1, GFP_KERNEL); 782 + dev->_filename_ch2 = kmalloc(str_length + 1, GFP_KERNEL); 783 783 784 784 if (!dev->_filename_ch2) 785 785 goto error;
+2 -2
drivers/staging/cx25821/cx25821-video-upstream.c
··· 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 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;
+1 -1
drivers/staging/et131x/et1310_rx.c
··· 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) {
+1 -1
drivers/staging/et131x/et1310_tx.c
··· 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");
+1 -1
drivers/staging/rt2860/common/cmm_data.c
··· 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 +
+1 -1
drivers/staging/rt2860/common/cmm_mac_pci.c
··· 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) {
+1 -1
drivers/staging/rt2860/common/cmm_mac_usb.c
··· 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) {
+1 -1
drivers/staging/rt2860/rt_linux.c
··· 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
+3 -4
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
··· 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 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; ··· 2952 2953 goto out; 2953 2954 } 2954 2955 2955 - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 2956 + param = kmalloc(p->length, GFP_KERNEL); 2956 2957 if (param == NULL){ 2957 2958 ret = -ENOMEM; 2958 2959 goto out;
+1 -1
drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
··· 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));
+1 -1
drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c
··· 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__);
+3 -4
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
··· 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 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; ··· 3591 3592 goto out; 3592 3593 } 3593 3594 3594 - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 3595 + param = kmalloc(p->length, GFP_KERNEL); 3595 3596 if (param == NULL){ 3596 3597 ret = -ENOMEM; 3597 3598 goto out;
+1 -1
drivers/staging/rtl8192e/r8192E_core.c
··· 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;
+1 -1
drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
··· 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");
+1 -1
drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
··· 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__);
+3 -4
drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
··· 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 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; ··· 3181 3182 goto out; 3182 3183 } 3183 3184 3184 - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 3185 + param = kmalloc(p->length, GFP_KERNEL); 3185 3186 if (param == NULL){ 3186 3187 ret = -ENOMEM; 3187 3188 goto out;
+1 -1
drivers/staging/rtl8192su/r8192U_core.c
··· 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;
+1 -1
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
··· 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");
+1 -1
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
··· 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__);
+3 -4
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
··· 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 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; ··· 3209 3210 goto out; 3210 3211 } 3211 3212 3212 - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 3213 + param = kmalloc(p->length, GFP_KERNEL); 3213 3214 if (param == NULL){ 3214 3215 ret = -ENOMEM; 3215 3216 goto out;
+6 -4
drivers/staging/rtl8192u/r8192U_core.c
··· 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++){ ··· 2251 2250 #endif 2252 2251 2253 2252 memset(priv->rx_urb, 0, sizeof(struct urb*) * MAX_RX_URB); 2254 - priv->pp_rxskb = (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB, GFP_KERNEL); 2253 + priv->pp_rxskb = kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB, 2254 + GFP_KERNEL); 2255 2255 if (priv->pp_rxskb == NULL) 2256 2256 goto destroy; 2257 2257 ··· 2841 2839 (priv->EarlyRxThreshold == 7 ? RCR_ONLYERLPKT:0); 2842 2840 2843 2841 priv->AcmControl = 0; 2844 - priv->pFirmware = (rt_firmware*)kmalloc(sizeof(rt_firmware), GFP_KERNEL); 2842 + priv->pFirmware = kmalloc(sizeof(rt_firmware), GFP_KERNEL); 2845 2843 if (priv->pFirmware) 2846 2844 memset(priv->pFirmware, 0, sizeof(rt_firmware)); 2847 2845 ··· 4417 4415 goto out; 4418 4416 } 4419 4417 4420 - ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 4418 + ipw = kmalloc(p->length, GFP_KERNEL); 4421 4419 if (ipw == NULL){ 4422 4420 ret = -ENOMEM; 4423 4421 goto out;
+1 -2
drivers/staging/vme/bridges/vme_ca91cx42.c
··· 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");
+1 -1
drivers/staging/vme/bridges/vme_tsi148.c
··· 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 "
+1 -1
drivers/staging/vt6655/device_main.c
··· 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;
+2 -2
drivers/staging/vt6655/hostap.c
··· 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 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
+1 -1
drivers/staging/vt6655/wpactl.c
··· 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
+2 -2
drivers/staging/vt6656/hostap.c
··· 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 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
+1 -1
drivers/staging/vt6656/main_usb.c
··· 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;
+1 -1
drivers/staging/vt6656/wpactl.c
··· 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
+2 -2
drivers/staging/wlags49_h2/wl_priv.c
··· 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 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