]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
linux: make UBSAN quiet
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Jun 2019 02:36:51 +0000 (11:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Jun 2019 02:44:08 +0000 (11:44 +0900)
src/shared/linux/README
src/shared/linux/ethtool.h

index 38782338b05049e1aff39a491b67735fa1246f56..46d554764d3edbf191c26196e3383d86b132fda8 100644 (file)
@@ -5,3 +5,4 @@ The files in this directory are copied from kernel-5.2, and the following modifi
 - bpf_insn.h: BPF_JMP_A() macro is also imported from include/linux/filter.h
 - dm-ioctl.h: set DM_VERSION_MINOR to 27
 - ethtool.h: define __KERNEL_DIV_ROUND_UP if not defined
+- ethtool.h: add casts in ethtool_cmd_speed()
index 742f2fbf3e19dd66121b8de7faf3df8731d1b768..acf346be41e42149cb20005a9be5b940fd18f0d8 100644 (file)
@@ -126,7 +126,7 @@ static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
 
 static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
 {
-       return (ep->speed_hi << 16) | ep->speed;
+       return ((__u32) ep->speed_hi << 16) | (__u32) ep->speed;
 }
 
 /* Device supports clause 22 register access to PHY or peripherals