Commit 04b588d7 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Jeff Garzik

UCC Ether driver: kmalloc casting cleanups

A kmalloc casting cleanup patch.
Signed-off-by: default avatarAhmed Darwish <darwish.07@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 7f60c64b
...@@ -2865,8 +2865,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -2865,8 +2865,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4) if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4)
align = UCC_GETH_TX_BD_RING_ALIGNMENT; align = UCC_GETH_TX_BD_RING_ALIGNMENT;
ugeth->tx_bd_ring_offset[j] = ugeth->tx_bd_ring_offset[j] =
(u32) (kmalloc((u32) (length + align), kmalloc((u32) (length + align), GFP_KERNEL);
GFP_KERNEL));
if (ugeth->tx_bd_ring_offset[j] != 0) if (ugeth->tx_bd_ring_offset[j] != 0)
ugeth->p_tx_bd_ring[j] = ugeth->p_tx_bd_ring[j] =
(void*)((ugeth->tx_bd_ring_offset[j] + (void*)((ugeth->tx_bd_ring_offset[j] +
...@@ -2901,7 +2901,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -2901,7 +2901,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4) if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4)
align = UCC_GETH_RX_BD_RING_ALIGNMENT; align = UCC_GETH_RX_BD_RING_ALIGNMENT;
ugeth->rx_bd_ring_offset[j] = ugeth->rx_bd_ring_offset[j] =
(u32) (kmalloc((u32) (length + align), GFP_KERNEL)); kmalloc((u32) (length + align), GFP_KERNEL);
if (ugeth->rx_bd_ring_offset[j] != 0) if (ugeth->rx_bd_ring_offset[j] != 0)
ugeth->p_rx_bd_ring[j] = ugeth->p_rx_bd_ring[j] =
(void*)((ugeth->rx_bd_ring_offset[j] + (void*)((ugeth->rx_bd_ring_offset[j] +
...@@ -2927,8 +2927,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -2927,8 +2927,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
/* Init Tx bds */ /* Init Tx bds */
for (j = 0; j < ug_info->numQueuesTx; j++) { for (j = 0; j < ug_info->numQueuesTx; j++) {
/* Setup the skbuff rings */ /* Setup the skbuff rings */
ugeth->tx_skbuff[j] = ugeth->tx_skbuff[j] = kmalloc(sizeof(struct sk_buff *) *
(struct sk_buff **)kmalloc(sizeof(struct sk_buff *) *
ugeth->ug_info->bdRingLenTx[j], ugeth->ug_info->bdRingLenTx[j],
GFP_KERNEL); GFP_KERNEL);
...@@ -2959,8 +2958,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -2959,8 +2958,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
/* Init Rx bds */ /* Init Rx bds */
for (j = 0; j < ug_info->numQueuesRx; j++) { for (j = 0; j < ug_info->numQueuesRx; j++) {
/* Setup the skbuff rings */ /* Setup the skbuff rings */
ugeth->rx_skbuff[j] = ugeth->rx_skbuff[j] = kmalloc(sizeof(struct sk_buff *) *
(struct sk_buff **)kmalloc(sizeof(struct sk_buff *) *
ugeth->ug_info->bdRingLenRx[j], ugeth->ug_info->bdRingLenRx[j],
GFP_KERNEL); GFP_KERNEL);
...@@ -3453,8 +3451,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -3453,8 +3451,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
* allocated resources can be released when the channel is freed. * allocated resources can be released when the channel is freed.
*/ */
if (!(ugeth->p_init_enet_param_shadow = if (!(ugeth->p_init_enet_param_shadow =
(struct ucc_geth_init_pram *) kmalloc(sizeof(struct ucc_geth_init_pram), kmalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
GFP_KERNEL))) {
ugeth_err ugeth_err
("%s: Can not allocate memory for" ("%s: Can not allocate memory for"
" p_UccInitEnetParamShadows.", __FUNCTION__); " p_UccInitEnetParamShadows.", __FUNCTION__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment