diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-16 17:15:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-18 01:42:54 -0400 |
commit | ae57b20a0a1d3aa6cc35b51355949177de94aece (patch) | |
tree | e75b39b31da224459e2f87557ea2110568755e97 /drivers/s390/net | |
parent | 95718c1c25370b2c85061a4d8dfab2831b3ad280 (diff) |
drivers/s390/net: 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: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_mpc.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 2 |
4 files changed, 6 insertions, 11 deletions
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index e35713dd0504..4ecafbf91211 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -1364,8 +1364,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, | |||
1364 | 1364 | ||
1365 | ch->protocol = priv->protocol; | 1365 | ch->protocol = priv->protocol; |
1366 | if (IS_MPC(priv)) { | 1366 | if (IS_MPC(priv)) { |
1367 | ch->discontact_th = (struct th_header *) | 1367 | ch->discontact_th = kzalloc(TH_HEADER_LENGTH, gfp_type()); |
1368 | kzalloc(TH_HEADER_LENGTH, gfp_type()); | ||
1369 | if (ch->discontact_th == NULL) | 1368 | if (ch->discontact_th == NULL) |
1370 | goto nomem_return; | 1369 | goto nomem_return; |
1371 | 1370 | ||
@@ -1379,8 +1378,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type, | |||
1379 | } else | 1378 | } else |
1380 | ccw_num = 8; | 1379 | ccw_num = 8; |
1381 | 1380 | ||
1382 | ch->ccw = (struct ccw1 *) | 1381 | ch->ccw = kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); |
1383 | kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); | ||
1384 | if (ch->ccw == NULL) | 1382 | if (ch->ccw == NULL) |
1385 | goto nomem_return; | 1383 | goto nomem_return; |
1386 | 1384 | ||
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c index 5978b390153f..87c24d2936d6 100644 --- a/drivers/s390/net/ctcm_mpc.c +++ b/drivers/s390/net/ctcm_mpc.c | |||
@@ -669,8 +669,7 @@ static void ctcmpc_send_sweep_resp(struct channel *rch) | |||
669 | goto done; | 669 | goto done; |
670 | } | 670 | } |
671 | 671 | ||
672 | header = (struct th_sweep *) | 672 | header = kmalloc(sizeof(struct th_sweep), gfp_type()); |
673 | kmalloc(sizeof(struct th_sweep), gfp_type()); | ||
674 | 673 | ||
675 | if (!header) { | 674 | if (!header) { |
676 | dev_kfree_skb_any(sweep_skb); | 675 | dev_kfree_skb_any(sweep_skb); |
@@ -1191,8 +1190,7 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) | |||
1191 | skb_pull(pskb, new_len); /* point to next PDU */ | 1190 | skb_pull(pskb, new_len); /* point to next PDU */ |
1192 | } | 1191 | } |
1193 | } else { | 1192 | } else { |
1194 | mpcginfo = (struct mpcg_info *) | 1193 | mpcginfo = kmalloc(sizeof(struct mpcg_info), gfp_type()); |
1195 | kmalloc(sizeof(struct mpcg_info), gfp_type()); | ||
1196 | if (mpcginfo == NULL) | 1194 | if (mpcginfo == NULL) |
1197 | goto done; | 1195 | goto done; |
1198 | 1196 | ||
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 9b19ea13b4d8..0f19d540b655 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1238,8 +1238,7 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) | |||
1238 | ipm = lcs_check_addr_entry(card, im4, buf); | 1238 | ipm = lcs_check_addr_entry(card, im4, buf); |
1239 | if (ipm != NULL) | 1239 | if (ipm != NULL) |
1240 | continue; /* Address already in list. */ | 1240 | continue; /* Address already in list. */ |
1241 | ipm = (struct lcs_ipm_list *) | 1241 | ipm = kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); |
1242 | kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); | ||
1243 | if (ipm == NULL) { | 1242 | if (ipm == NULL) { |
1244 | pr_info("Not enough memory to add" | 1243 | pr_info("Not enough memory to add" |
1245 | " new multicast entry!\n"); | 1244 | " new multicast entry!\n"); |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index fd1f48c771fc..e862c2d8e5c0 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -606,7 +606,7 @@ static int qeth_setup_channel(struct qeth_channel *channel) | |||
606 | 606 | ||
607 | QETH_DBF_TEXT(SETUP, 2, "setupch"); | 607 | QETH_DBF_TEXT(SETUP, 2, "setupch"); |
608 | for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++) { | 608 | for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++) { |
609 | channel->iob[cnt].data = (char *) | 609 | channel->iob[cnt].data = |
610 | kmalloc(QETH_BUFSIZE, GFP_DMA|GFP_KERNEL); | 610 | kmalloc(QETH_BUFSIZE, GFP_DMA|GFP_KERNEL); |
611 | if (channel->iob[cnt].data == NULL) | 611 | if (channel->iob[cnt].data == NULL) |
612 | break; | 612 | break; |