mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
net: add a CMSG_USER_DATA macro
Add a variant of CMSG_DATA that operates on user pointer to avoid sparse warnings about casting to/from user pointers. Also fix up CMSG_DATA to rely on the gcc extension that allows void pointer arithmetics to cut down on the amount of casts. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3242956bd6
commit
0462b6bdb6
@@ -94,7 +94,10 @@ struct cmsghdr {
|
||||
|
||||
#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
|
||||
|
||||
#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + sizeof(struct cmsghdr)))
|
||||
#define CMSG_DATA(cmsg) \
|
||||
((void *)(cmsg) + sizeof(struct cmsghdr))
|
||||
#define CMSG_USER_DATA(cmsg) \
|
||||
((void __user *)(cmsg) + sizeof(struct cmsghdr))
|
||||
#define CMSG_SPACE(len) (sizeof(struct cmsghdr) + CMSG_ALIGN(len))
|
||||
#define CMSG_LEN(len) (sizeof(struct cmsghdr) + (len))
|
||||
|
||||
|
Reference in New Issue
Block a user