ethtool: Fix link extended state for big endian
authorMoshe Tal <moshet@nvidia.com>
Thu, 20 Jan 2022 09:55:50 +0000 (11:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:39 +0000 (19:12 +0100)
commit462c5e6cb2414fcde7d0a76f5e0661744caaa0aa
tree8a3553545607fc9322361cdfd245fcf01f94cf0e
parent27e01f10d183cd444eb4a0919934391de4db4ff5
ethtool: Fix link extended state for big endian

[ Upstream commit e2f08207c558bc0bc8abaa557cdb29bad776ac7b ]

The link extended sub-states are assigned as enum that is an integer
size but read from a union as u8, this is working for small values on
little endian systems but for big endian this always give 0. Fix the
variable in the union to match the enum size.

Fixes: ecc31c60240b ("ethtool: Add link extended state")
Signed-off-by: Moshe Tal <moshet@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/ethtool.h