Re: [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Daniel Drake <dsd@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, <netdev@...>, David S. Miller <davem@...>, Ulrich Kunitz <kune@...>, <linux-wireless@...>
Date: Thursday, August 30, 2007 - 4:20 pm

On 30/08/2007, Daniel Drake <dsd@gentoo.org> wrote:
Ok, I must admit I didn't check with sparse since it seemed pointless
- we usually never cast void pointers to other pointer types,
specifically because the C language nicely guarantees that the right
thing will happen without the cast.  Sometimes we have to cast them to
integer types, su sure we need the cast there.   But what on earth
makes a "zd_addr_t *" so special that we have to explicitly cast a
"void *" to that type?

I see it's defined as
  typedef u32 __nocast zd_addr_t;
in drivers/net/wireless/zd1211rw/zd_types.h , but why the __nocast ?

What would be wrong in applying my patch that removes the cast of the
kmalloc() return value and then also remove the "__nocast" here?


-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 13/30] net: Don't do pointless kmalloc return val..., Jesper Juhl, (Thu Aug 30, 4:20 pm)