summaryrefslogtreecommitdiff
path: root/src/shared/linux
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-25 11:36:51 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-25 11:44:08 +0900
commitffba064ae4d178b95733aed7c795ad799ddec2c4 (patch)
tree3468990e4a53fd6edbac0478f73be7978a3f6755 /src/shared/linux
parent2824ed64a151dacf7f42720d60b2e023f1736bee (diff)
downloadsystemd-ffba064ae4d178b95733aed7c795ad799ddec2c4.tar.gz
systemd-ffba064ae4d178b95733aed7c795ad799ddec2c4.tar.bz2
systemd-ffba064ae4d178b95733aed7c795ad799ddec2c4.zip
linux: make UBSAN quiet
Diffstat (limited to 'src/shared/linux')
-rw-r--r--src/shared/linux/README1
-rw-r--r--src/shared/linux/ethtool.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/linux/README b/src/shared/linux/README
index 38782338b0..46d554764d 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 742f2fbf3e..acf346be41 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