netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * [PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module
           [not found] <1554af80879a7ef2f78a4d654f23c248203500d9.1187912217.git.jesper.juhl@gmail.com>
           [not found] ` <1554af80879a7ef2f78a4d654f23c248203500d9.1187912217.git.jesper.juhl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    @ 2007-08-24  0:06 ` Jesper Juhl
      2007-08-25  6:25   ` David Miller
           [not found] ` <c4e095af9df5ab47e7d1c8e4f3d256d74576a0c9.1187912217.git.jesper.juhl@gmail.com>
           [not found] ` <d551047daed1cb4d9de1eff956268a468c9837f6.1187912217.git.jesper.juhl@gmail.com>
      3 siblings, 1 reply; 13+ messages in thread
    From: Jesper Juhl @ 2007-08-24  0:06 UTC (permalink / raw)
      To: Linux Kernel Mailing List; +Cc: netdev, davem, Jesper Juhl
    
    The general kernel memory allocation functions return void pointers
    and there is no need to cast their return values.
    
    Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
    ---
     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
    
    
    ^ permalink raw reply related	[flat|nested] 13+ messages in thread
  • [parent not found: <c4e095af9df5ab47e7d1c8e4f3d256d74576a0c9.1187912217.git.jesper.juhl@gmail.com>]
  • [parent not found: <d551047daed1cb4d9de1eff956268a468c9837f6.1187912217.git.jesper.juhl@gmail.com>]

  • end of thread, other threads:[~2007-08-31  9:30 UTC | newest]
    
    Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1554af80879a7ef2f78a4d654f23c248203500d9.1187912217.git.jesper.juhl@gmail.com>
         [not found] ` <1554af80879a7ef2f78a4d654f23c248203500d9.1187912217.git.jesper.juhl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    2007-08-24  0:03   ` [PATCH 14/30] net: Kill some unneeded allocation return value casts in libertas Jesper Juhl
         [not found]     ` <2ac91f5f0eed967cf1709cfbe476b351e536c299.1187912217.git.jesper.juhl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    2007-08-24 15:50       ` Dan Williams
    2007-08-24  0:06 ` [PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module Jesper Juhl
    2007-08-25  6:25   ` David Miller
         [not found] ` <c4e095af9df5ab47e7d1c8e4f3d256d74576a0c9.1187912217.git.jesper.juhl@gmail.com>
    2007-08-24  7:25   ` [PATCH 12/30] net: No point in casting kmalloc return values in Gianfar Ethernet Driver Kumar Gala
         [not found] ` <d551047daed1cb4d9de1eff956268a468c9837f6.1187912217.git.jesper.juhl@gmail.com>
         [not found]   ` <d551047daed1cb4d9de1eff956268a468c9837f6.1187912217.git.jesper.juhl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    2007-08-30 17:54     ` [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver Daniel Drake
         [not found]       ` <46D70467.1040109-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
    2007-08-30 20:20         ` Jesper Juhl
    2007-08-30 23:47           ` Daniel Drake
         [not found]           ` <9a8748490708301320o49d8e794vc5c37ffc938006f1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2007-08-30 22:19             ` Joe Perches
    2007-08-30 22:30               ` [PATCH] Don't needlessly initialize variable to NULL in zd_chip (was: Re: [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver) Jesper Juhl
         [not found]                 ` <200708310030.31713.jesper.juhl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    2007-08-30 22:42                   ` Randy Dunlap
         [not found]                     ` <20070830154255.6a146c21.randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
    2007-08-30 23:04                       ` Jesper Juhl
    2007-08-31  9:30             ` [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver Herbert Xu
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).