[PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module

Subsystems: networking drivers, the rest

STALE6931d

2 messages, 2 authors, 2007-08-25 · open the first message on its own page

[PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module

From: Jesper Juhl <hidden>
Date: 2007-08-24 00:10:06

The general kernel memory allocation functions return void pointers
and there is no need to cast their return values.

Signed-off-by: Jesper Juhl <redacted>
---
 drivers/net/bsd_comp.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c
index 202d4a4..88edb98 100644
--- a/drivers/net/bsd_comp.c
+++ b/drivers/net/bsd_comp.c
@@ -406,8 +406,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
  * Allocate space for the dictionary. This may be more than one page in
  * length.
  */
-    db->dict = (struct bsd_dict *) vmalloc (hsize *
-					    sizeof (struct bsd_dict));
+    db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
     if (!db->dict)
       {
 	bsd_free (db);
@@ -426,8 +425,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
  */
     else
       {
-        db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
-					       sizeof (db->lens[0]));
+        db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
 	if (!db->lens)
 	  {
 	    bsd_free (db);
-- 
1.5.2.2

Re: [PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module

From: David Miller <davem@davemloft.net>
Date: 2007-08-25 06:25:18

From: Jesper Juhl <redacted>
Date: Fri, 24 Aug 2007 02:06:58 +0200
The general kernel memory allocation functions return void pointers
and there is no need to cast their return values.

Signed-off-by: Jesper Juhl <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help