From: Yu Watanabe Date: Tue, 25 Jun 2019 02:36:51 +0000 (+0900) Subject: linux: make UBSAN quiet X-Git-Tag: v243-rc1~238^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffba064ae4d178b95733aed7c795ad799ddec2c4;p=thirdparty%2Fsystemd.git linux: make UBSAN quiet --- diff --git a/src/shared/linux/README b/src/shared/linux/README index 38782338b05..46d554764d3 100644 --- a/src/shared/linux/README +++ b/src/shared/linux/README @@ -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() diff --git a/src/shared/linux/ethtool.h b/src/shared/linux/ethtool.h index 742f2fbf3e1..acf346be41e 100644 --- a/src/shared/linux/ethtool.h +++ b/src/shared/linux/ethtool.h @@ -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