Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f1c8232 authored by David Woodhouse's avatar David Woodhouse Committed by David S. Miller
Browse files

libertas: remove casts from lbs_cmd() and lbs_cmd_with_response() macros



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: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 301eacbf
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -7,11 +7,11 @@
#include "dev.h"
#include "dev.h"


#define lbs_cmd(priv, cmdnr, cmd, callback, callback_arg) \
#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)
			callback, callback_arg)


#define lbs_cmd_with_response(priv, cmdnr, cmd) \
#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)
		  lbs_cmd_copyback, (unsigned long) &cmd)
 
 
int __lbs_cmd(struct lbs_private *priv, uint16_t command,
int __lbs_cmd(struct lbs_private *priv, uint16_t command,