diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2020-05-28 01:14:31 -0700 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2020-05-29 21:20:21 -0700 |
commit | 9ff2e92c466dc1aa4d970e5027dfd66b1f32b7bc (patch) | |
tree | 673c3d2e9937c634f5d88d7d671334dec8a91fde /drivers/net/ethernet/mellanox/mlx5 | |
parent | c2ba2c2287698bac36bf71e5c4f3be423371bee0 (diff) | |
download | linux-9ff2e92c466dc1aa4d970e5027dfd66b1f32b7bc.tar.bz2 |
net/mlx5: DR: Fix incorrect type in return expression
dr_ste_crc32_calc() calculates crc32 and should return it in HW format.
It is being used to calculate a u32 index, hence we force the return value
of u32 to avoid the sparse warning:
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:115:16:
warning: incorrect type in return expression (different base types)
expected unsigned int
got restricted __be32 [usertype]
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c index 470895016693..00c2f598f034 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c @@ -112,7 +112,7 @@ static u32 dr_ste_crc32_calc(const void *input_data, size_t length) { u32 crc = crc32(0, input_data, length); - return htonl(crc); + return (__force u32)htonl(crc); } u32 mlx5dr_ste_calc_hash_index(u8 *hw_ste_p, struct mlx5dr_ste_htbl *htbl) |