libertas: remove casts from lbs_cmd() and lbs_cmd_with_response() macros
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 11 Dec 2007 20:28:18 +0000 (15:28 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:06:47 +0000 (15:06 -0800)
If stupid people like me give it arguments with the wrong type (like a
pointer to the structure, for example, instead of the structure itself),
then we should probably notice that at compile time. Otherwise, much
confusion ensues.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.h

index 716f25be5b3e92bbb4e8407e1256b99e13755bc0..950acce3baafd0a6b873c6a2c5f765ecf0ec90db 100644 (file)
@@ -7,11 +7,11 @@
 #include "dev.h"
 
 #define lbs_cmd(priv, cmdnr, cmd, callback, callback_arg) \
-       __lbs_cmd(priv, cmdnr, (struct cmd_header *) &cmd, sizeof(cmd), \
+       __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd),   \
                        callback, callback_arg)
 
 #define lbs_cmd_with_response(priv, cmdnr, cmd) \
-       __lbs_cmd(priv, cmdnr, (struct cmd_header *) &cmd, sizeof(cmd), \
+       __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd), \
                  lbs_cmd_copyback, (unsigned long) &cmd)
  
 int __lbs_cmd(struct lbs_private *priv, uint16_t command,