aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-01-27 03:00:02 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:49 -0500
commit04b588d727cf49321458731727737cf330f04cd2 (patch)
tree1906677cb537faeef23614b854c3a9221c7ef443 /drivers/net/ucc_geth.c
parent7f60c64bd0e7262b51faefcce5d8df9d51d84b60 (diff)
UCC Ether driver: kmalloc casting cleanups
A kmalloc casting cleanup patch. Signed-off-by: Ahmed Darwish <darwish.07@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7e4b23c7c1ba..abb8611c5a91 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2865,8 +2865,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2865 if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4) 2865 if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4)
2866 align = UCC_GETH_TX_BD_RING_ALIGNMENT; 2866 align = UCC_GETH_TX_BD_RING_ALIGNMENT;
2867 ugeth->tx_bd_ring_offset[j] = 2867 ugeth->tx_bd_ring_offset[j] =
2868 (u32) (kmalloc((u32) (length + align), 2868 kmalloc((u32) (length + align), GFP_KERNEL);
2869 GFP_KERNEL)); 2869
2870 if (ugeth->tx_bd_ring_offset[j] != 0) 2870 if (ugeth->tx_bd_ring_offset[j] != 0)
2871 ugeth->p_tx_bd_ring[j] = 2871 ugeth->p_tx_bd_ring[j] =
2872 (void*)((ugeth->tx_bd_ring_offset[j] + 2872 (void*)((ugeth->tx_bd_ring_offset[j] +
@@ -2901,7 +2901,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2901 if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4) 2901 if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4)
2902 align = UCC_GETH_RX_BD_RING_ALIGNMENT; 2902 align = UCC_GETH_RX_BD_RING_ALIGNMENT;
2903 ugeth->rx_bd_ring_offset[j] = 2903 ugeth->rx_bd_ring_offset[j] =
2904 (u32) (kmalloc((u32) (length + align), GFP_KERNEL)); 2904 kmalloc((u32) (length + align), GFP_KERNEL);
2905 if (ugeth->rx_bd_ring_offset[j] != 0) 2905 if (ugeth->rx_bd_ring_offset[j] != 0)
2906 ugeth->p_rx_bd_ring[j] = 2906 ugeth->p_rx_bd_ring[j] =
2907 (void*)((ugeth->rx_bd_ring_offset[j] + 2907 (void*)((ugeth->rx_bd_ring_offset[j] +
@@ -2927,10 +2927,9 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2927 /* Init Tx bds */ 2927 /* Init Tx bds */
2928 for (j = 0; j < ug_info->numQueuesTx; j++) { 2928 for (j = 0; j < ug_info->numQueuesTx; j++) {
2929 /* Setup the skbuff rings */ 2929 /* Setup the skbuff rings */
2930 ugeth->tx_skbuff[j] = 2930 ugeth->tx_skbuff[j] = kmalloc(sizeof(struct sk_buff *) *
2931 (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * 2931 ugeth->ug_info->bdRingLenTx[j],
2932 ugeth->ug_info->bdRingLenTx[j], 2932 GFP_KERNEL);
2933 GFP_KERNEL);
2934 2933
2935 if (ugeth->tx_skbuff[j] == NULL) { 2934 if (ugeth->tx_skbuff[j] == NULL) {
2936 ugeth_err("%s: Could not allocate tx_skbuff", 2935 ugeth_err("%s: Could not allocate tx_skbuff",
@@ -2959,10 +2958,9 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2959 /* Init Rx bds */ 2958 /* Init Rx bds */
2960 for (j = 0; j < ug_info->numQueuesRx; j++) { 2959 for (j = 0; j < ug_info->numQueuesRx; j++) {
2961 /* Setup the skbuff rings */ 2960 /* Setup the skbuff rings */
2962 ugeth->rx_skbuff[j] = 2961 ugeth->rx_skbuff[j] = kmalloc(sizeof(struct sk_buff *) *
2963 (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * 2962 ugeth->ug_info->bdRingLenRx[j],
2964 ugeth->ug_info->bdRingLenRx[j], 2963 GFP_KERNEL);
2965 GFP_KERNEL);
2966 2964
2967 if (ugeth->rx_skbuff[j] == NULL) { 2965 if (ugeth->rx_skbuff[j] == NULL) {
2968 ugeth_err("%s: Could not allocate rx_skbuff", 2966 ugeth_err("%s: Could not allocate rx_skbuff",
@@ -3453,8 +3451,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
3453 * allocated resources can be released when the channel is freed. 3451 * allocated resources can be released when the channel is freed.
3454 */ 3452 */
3455 if (!(ugeth->p_init_enet_param_shadow = 3453 if (!(ugeth->p_init_enet_param_shadow =
3456 (struct ucc_geth_init_pram *) kmalloc(sizeof(struct ucc_geth_init_pram), 3454 kmalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
3457 GFP_KERNEL))) {
3458 ugeth_err 3455 ugeth_err
3459 ("%s: Can not allocate memory for" 3456 ("%s: Can not allocate memory for"
3460 " p_UccInitEnetParamShadows.", __FUNCTION__); 3457 " p_UccInitEnetParamShadows.", __FUNCTION__);