Skip to content

Commit ffba064

Browse files
committed
linux: make UBSAN quiet
1 parent 2824ed6 commit ffba064

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/shared/linux/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ The files in this directory are copied from kernel-5.2, and the following modifi
55
- bpf_insn.h: BPF_JMP_A() macro is also imported from include/linux/filter.h
66
- dm-ioctl.h: set DM_VERSION_MINOR to 27
77
- ethtool.h: define __KERNEL_DIV_ROUND_UP if not defined
8+
- ethtool.h: add casts in ethtool_cmd_speed()

src/shared/linux/ethtool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
126126

127127
static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
128128
{
129-
return (ep->speed_hi << 16) | ep->speed;
129+
return ((__u32) ep->speed_hi << 16) | (__u32) ep->speed;
130130
}
131131

132132
/* Device supports clause 22 register access to PHY or peripherals

0 commit comments

Comments
 (0)