Skip to content

Commit

Permalink
net/mlx5: DR: Fix incorrect type in return expression
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Mark Bloch <[email protected]>
  • Loading branch information
Saeed Mahameed committed May 30, 2020
1 parent c2ba2c2 commit 9ff2e92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9ff2e92

Please sign in to comment.