提交 7c8347a9 编写于 作者: J Jesper Juhl 提交者: David S. Miller

[ISDN]: Get rid of some pointless allocation casts in common and bsd comp.

vmalloc() returns a void pointer - no need to cast the return value.
Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c573f73c
...@@ -341,7 +341,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data) ...@@ -341,7 +341,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
* Allocate space for the dictionary. This may be more than one page in * Allocate space for the dictionary. This may be more than one page in
* length. * length.
*/ */
db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict)); db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
if (!db->dict) { if (!db->dict) {
bsd_free (db); bsd_free (db);
return NULL; return NULL;
...@@ -354,8 +354,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data) ...@@ -354,8 +354,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
if (!decomp) if (!decomp)
db->lens = NULL; db->lens = NULL;
else { else {
db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) * db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
sizeof (db->lens[0]));
if (!db->lens) { if (!db->lens) {
bsd_free (db); bsd_free (db);
return (NULL); return (NULL);
......
...@@ -2291,7 +2291,7 @@ static int __init isdn_init(void) ...@@ -2291,7 +2291,7 @@ static int __init isdn_init(void)
int i; int i;
char tmprev[50]; char tmprev[50];
if (!(dev = (isdn_dev *) vmalloc(sizeof(isdn_dev)))) { if (!(dev = vmalloc(sizeof(isdn_dev)))) {
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
return -EIO; return -EIO;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册