From: Jesse Brandeburg <>
Date: Thu, 13 Oct 2016 16:13:55 -0700

> Sparse was complaining when we went to prototype some code
> using ethtool_cmd_speed_set and SPEED_100000, which uses
> the upper 16 bits of __u32 speed for the first time.
> ...
> .../uapi/linux/ethtool.h:123:28: warning:
>   cast truncates bits from constant value (186a0 becomes 86a0)
> The warning is actually bogus, as no bits are really lost, but
> we can get rid of the sparse warning with this one small change.
> Reported-by: Preethi Banala <>
> Signed-off-by: Jesse Brandeburg <>

Ok, I'll apply this.

There were alternative suggestions but I like this patch
because it makes it explicit what is going on.

Just removing the u16 cast requires the reader to implicitly
understand and know the types in the structure.

Reply via email to