Skip to content

Commit 46dc11b

Browse files
committed
Merge branch 'address-remaining-wtautological-constant-out-of-range-compare'
Arnd Bergmann says: ==================== address remaining -Wtautological-constant-out-of-range-compare The warning option was introduced a few years ago but left disabled by default. All of the actual bugs that this has found have been fixed in the meantime, and this series should address the remaining false-positives, as tested on arm/arm64/x86 randconfigs as well as allmodconfig builds for all architectures supported by clang. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 06c2a5c + a5535e5 commit 46dc11b

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/xsk

1 file changed

+4
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ bool mlx5e_validate_xsk_param(struct mlx5e_params *params,
2828
struct mlx5e_xsk_param *xsk,
2929
struct mlx5_core_dev *mdev)
3030
{
31-
/* AF_XDP doesn't support frames larger than PAGE_SIZE. */
32-
if (xsk->chunk_size > PAGE_SIZE || xsk->chunk_size < MLX5E_MIN_XSK_CHUNK_SIZE) {
31+
/* AF_XDP doesn't support frames larger than PAGE_SIZE,
32+
* and xsk->chunk_size is limited to 65535 bytes.
33+
*/
34+
if ((size_t)xsk->chunk_size > PAGE_SIZE || xsk->chunk_size < MLX5E_MIN_XSK_CHUNK_SIZE) {
3335
mlx5_core_err(mdev, "XSK chunk size %u out of bounds [%u, %lu]\n", xsk->chunk_size,
3436
MLX5E_MIN_XSK_CHUNK_SIZE, PAGE_SIZE);
3537
return false;

0 commit comments

Comments
 (0)