diff options
author | Ido Schimmel <idosch@mellanox.com> | 2020-06-21 11:29:17 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-22 16:29:51 -0700 |
commit | f3fe412b0a634286a6a3753c3f9ff201e6bec716 (patch) | |
tree | 49bd6016b54e1d33f1469cc223240e8b15599886 /ipc/shm.c | |
parent | 6d61f483f148b856d47a6c96d5d84054d5a9f849 (diff) |
mlxsw: spectrum: Do not rely on machine endianness
The second commit cited below performed a cast of 'u32 buffsize' to
'(u16 *)' when calling mlxsw_sp_port_headroom_8x_adjust():
mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, (u16 *) &buffsize);
Colin noted that this will behave differently on big endian
architectures compared to little endian architectures.
Fix this by following Colin's suggestion and have the function accept
and return 'u32' instead of passing the current size by reference.
Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC")
Fixes: 60833d54d56c ("mlxsw: spectrum: Adjust headroom buffers for 8x ports")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Suggested-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'ipc/shm.c')
0 files changed, 0 insertions, 0 deletions