projects
/
platform
/
kernel
/
linux-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9825022
)
MFD: mcp-core: fix mcp_priv() to be more type safe
author
Russell King
<rmk+kernel@arm.linux.org.uk>
Sat, 21 Jan 2012 09:28:53 +0000
(09:28 +0000)
committer
Russell King
<rmk+kernel@arm.linux.org.uk>
Sat, 21 Jan 2012 15:46:25 +0000
(15:46 +0000)
mcp_priv() does unexpected things when passed a void pointer. Make it
a typed inline function, which ensures that it works correctly in
these cases.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
include/linux/mfd/mcp.h
patch
|
blob
|
history
diff --git
a/include/linux/mfd/mcp.h
b/include/linux/mfd/mcp.h
index
ee49670
..
f88c1cc
100644
(file)
--- a/
include/linux/mfd/mcp.h
+++ b/
include/linux/mfd/mcp.h
@@
-64,6
+64,9
@@
void mcp_driver_unregister(struct mcp_driver *);
#define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device)
#define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d)
-#define mcp_priv(mcp) ((void *)((mcp)+1))
+static inline void *mcp_priv(struct mcp *mcp)
+{
+ return mcp + 1;
+}
#endif