Kernel permits pointer arithmetic on "void*" so might as well use it
without casts back and forth.
Signed-off-by: Alexey Dobriyan <redacted>
---
include/net/netlink.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -587,8 +587,7 @@ static inline int nlmsg_len(const struct nlmsghdr *nlh)
static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh,
int hdrlen)
{
- unsigned char *data = nlmsg_data(nlh);
- return (struct nlattr *) (data + NLMSG_ALIGN(hdrlen));
+ return nlmsg_data(nlh) + NLMSG_ALIGN(hdrlen);
}
/**