mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
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>
This commit is contained in:
parent
95718c1c25
commit
ae57b20a0a
4 changed files with 6 additions and 11 deletions
|
@ -1364,8 +1364,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type,
|
||||||
|
|
||||||
ch->protocol = priv->protocol;
|
ch->protocol = priv->protocol;
|
||||||
if (IS_MPC(priv)) {
|
if (IS_MPC(priv)) {
|
||||||
ch->discontact_th = (struct th_header *)
|
ch->discontact_th = kzalloc(TH_HEADER_LENGTH, gfp_type());
|
||||||
kzalloc(TH_HEADER_LENGTH, gfp_type());
|
|
||||||
if (ch->discontact_th == NULL)
|
if (ch->discontact_th == NULL)
|
||||||
goto nomem_return;
|
goto nomem_return;
|
||||||
|
|
||||||
|
@ -1379,8 +1378,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type,
|
||||||
} else
|
} else
|
||||||
ccw_num = 8;
|
ccw_num = 8;
|
||||||
|
|
||||||
ch->ccw = (struct ccw1 *)
|
ch->ccw = kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
|
||||||
kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
|
|
||||||
if (ch->ccw == NULL)
|
if (ch->ccw == NULL)
|
||||||
goto nomem_return;
|
goto nomem_return;
|
||||||
|
|
||||||
|
|
|
@ -669,8 +669,7 @@ static void ctcmpc_send_sweep_resp(struct channel *rch)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
header = (struct th_sweep *)
|
header = kmalloc(sizeof(struct th_sweep), gfp_type());
|
||||||
kmalloc(sizeof(struct th_sweep), gfp_type());
|
|
||||||
|
|
||||||
if (!header) {
|
if (!header) {
|
||||||
dev_kfree_skb_any(sweep_skb);
|
dev_kfree_skb_any(sweep_skb);
|
||||||
|
@ -1191,8 +1190,7 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
|
||||||
skb_pull(pskb, new_len); /* point to next PDU */
|
skb_pull(pskb, new_len); /* point to next PDU */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mpcginfo = (struct mpcg_info *)
|
mpcginfo = kmalloc(sizeof(struct mpcg_info), gfp_type());
|
||||||
kmalloc(sizeof(struct mpcg_info), gfp_type());
|
|
||||||
if (mpcginfo == NULL)
|
if (mpcginfo == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
@ -1238,8 +1238,7 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
|
||||||
ipm = lcs_check_addr_entry(card, im4, buf);
|
ipm = lcs_check_addr_entry(card, im4, buf);
|
||||||
if (ipm != NULL)
|
if (ipm != NULL)
|
||||||
continue; /* Address already in list. */
|
continue; /* Address already in list. */
|
||||||
ipm = (struct lcs_ipm_list *)
|
ipm = kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
|
||||||
kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
|
|
||||||
if (ipm == NULL) {
|
if (ipm == NULL) {
|
||||||
pr_info("Not enough memory to add"
|
pr_info("Not enough memory to add"
|
||||||
" new multicast entry!\n");
|
" new multicast entry!\n");
|
||||||
|
|
|
@ -606,7 +606,7 @@ static int qeth_setup_channel(struct qeth_channel *channel)
|
||||||
|
|
||||||
QETH_DBF_TEXT(SETUP, 2, "setupch");
|
QETH_DBF_TEXT(SETUP, 2, "setupch");
|
||||||
for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++) {
|
for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++) {
|
||||||
channel->iob[cnt].data = (char *)
|
channel->iob[cnt].data =
|
||||||
kmalloc(QETH_BUFSIZE, GFP_DMA|GFP_KERNEL);
|
kmalloc(QETH_BUFSIZE, GFP_DMA|GFP_KERNEL);
|
||||||
if (channel->iob[cnt].data == NULL)
|
if (channel->iob[cnt].data == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue