summaryrefslogtreecommitdiffstats
path: root/include/utils.h
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-04-09 16:51:21 +0200
committerPatrick McHardy <kaber@trash.net>2014-04-09 16:51:21 +0200
commit21966fa7e242c58c2d581c406af4e7978c981465 (patch)
tree4b9a67a5faa7def47fff66d7757023ce4cbdbcdb /include/utils.h
parent89596a35c4741cb99664e66da438992c2a907a71 (diff)
utils: fix -Wcast-align warnings on sparc
The cast to char * in the container_of() marcro causes warnings for all list iteration helpers on sparc: warning: cast increases required alignment of target type [-Wcast-align] Fix by using a void * for address calculations. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/utils.h')
-rw-r--r--include/utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/utils.h b/include/utils.h
index 854986f2..88ee0c9c 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -44,7 +44,7 @@
#define container_of(ptr, type, member) ({ \
typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+ (type *)( (void *)__mptr - offsetof(type,member) );})
#define field_sizeof(t, f) (sizeof(((t *)NULL)->f))
#define array_size(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))