aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsfield.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2019-12-13 21:24:27 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-16 16:09:44 -0800
commit1f1c1d7c89ee538f3e36b43098e95973f8fa37db (patch)
tree76eb473383add1ef0a0c92817fc29dd135c37c00 /include/net/dsfield.h
parentr8169: check that Realtek PHY driver module is loaded (diff)
downloadlinux-dev-1f1c1d7c89ee538f3e36b43098e95973f8fa37db.tar.xz
linux-dev-1f1c1d7c89ee538f3e36b43098e95973f8fa37db.zip
ipv6: Annotate bitwise IPv6 dsfield pointer cast
The sparse commit 6002ded74587 ("add a flag to warn on casts to/from bitwise pointers") introduced a check for non-direct casts from/to restricted datatypes (when -Wbitwise-pointer is enabled). This triggered a warning in ipv6_get_dsfield() because sparse doesn't know that the buffer already points to some data in the correct bitwise integer format. This was already fixed in ipv6_change_dsfield() by the __force attribute and can be fixed here the same way. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--include/net/dsfield.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/dsfield.h b/include/net/dsfield.h
index 1a245ee10c95..a59a57ffc546 100644
--- a/include/net/dsfield.h
+++ b/include/net/dsfield.h
@@ -21,7 +21,7 @@ static inline __u8 ipv4_get_dsfield(const struct iphdr *iph)
static inline __u8 ipv6_get_dsfield(const struct ipv6hdr *ipv6h)
{
- return ntohs(*(const __be16 *)ipv6h) >> 4;
+ return ntohs(*(__force const __be16 *)ipv6h) >> 4;
}