mlx4: remove unused fields
Subsystems (4)
PATCH 1/1 mlx4: remove unused fields
From: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/[email protected]>
This also can address following UBSAN warnings:
[ 36.640343] ================================================================================ [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26 [ 36.656853] shift exponent 64 is too large for 32-bit type 'int' [ 36.663348] ================================================================================ [ 36.671783] ================================================================================ [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27 [ 36.688297] shift exponent 35 is too large for 32-bit type 'int' [ 36.694702] ================================================================================
Tested:
reboot with UBSAN, no warning.
--- drivers/net/ethernet/mellanox/mlx4/fw.c | 4 ---- drivers/net/ethernet/mellanox/mlx4/fw.h | 2 -- 2 files changed, 6 deletions(-)
drivers/net/ethernet/mellanox/mlx4/fw.c +0 -4
@@ -853,12 +853,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev_cap->max_eqs =1 << (field &0xf );MLX4_GET (field, outbox,QUERY_DEV_CAP_RSVD_MTT_OFFSET ); dev_cap->reserved_mtts =1 << (field >>4 ); -MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET ); - dev_cap->max_mrw_sz =1 << field;MLX4_GET (field, outbox,QUERY_DEV_CAP_RSVD_MRW_OFFSET ); dev_cap->reserved_mrws =1 << (field &0xf ); -MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_MTT_SEG_OFFSET ); - dev_cap->max_mtt_seg =1 << (field &0x3f );MLX4_GET (size, outbox,QUERY_DEV_CAP_NUM_SYS_EQ_OFFSET ); dev_cap->num_sys_eqs = size &0xfff ;MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_REQ_QP_OFFSET );
drivers/net/ethernet/mellanox/mlx4/fw.h +0 -2
@@ -80,9 +80,7 @@ struct mlx4_dev_cap {int max_eqs;int num_sys_eqs;int reserved_mtts; -int max_mrw_sz;int reserved_mrws; -int max_mtt_seg;int max_requester_per_qp;int max_responder_per_qp;int max_rdma_global;
Signature · 6 lines
2.8.0.rc3.226.g39d4020 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 12 lines · David Decotigny
From: David Decotigny <[email protected]>
This also can address following UBSAN warnings:
[ 36.640343] ================================================================================ [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26 [ 36.656853] shift exponent 64 is too large for 32-bit type 'int' [ 36.663348] ================================================================================ [ 36.671783] ================================================================================ [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27 [ 36.688297] shift exponent 35 is too large for 32-bit type 'int' [ 36.694702] ================================================================================
Quoted 5 lines
Tested:
reboot with UBSAN, no warning.Signed-off-by David Decotigny <[email protected]>---
Note this patch was cooked/tested using net-next, but can be applied to net tree, with minor fuzz.
Thanks David.
Quoted 43 lines · David Decotigny
From: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/[email protected]>
This also can address following UBSAN warnings:
[ 36.640343] ================================================================================ [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26 [ 36.656853] shift exponent 64 is too large for 32-bit type 'int' [ 36.663348] ================================================================================ [ 36.671783] ================================================================================ [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27 [ 36.688297] shift exponent 35 is too large for 32-bit type 'int' [ 36.694702] ================================================================================Tested:
reboot with UBSAN, no warning.--- drivers/net/ethernet/mellanox/mlx4/fw.c | 4 ---- drivers/net/ethernet/mellanox/mlx4/fw.h | 2 -- 2 files changed, 6 deletions(-)drivers/net/ethernet/mellanox/mlx4/fw.c +0
-4@@ -853,12 +853,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev_cap->max_eqs =1 << (field &0xf );MLX4_GET (field, outbox,QUERY_DEV_CAP_RSVD_MTT_OFFSET ); dev_cap->reserved_mtts =1 << (field >>4 ); -MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET ); - dev_cap->max_mrw_sz =1 << field;MLX4_GET (field, outbox,QUERY_DEV_CAP_RSVD_MRW_OFFSET ); dev_cap->reserved_mrws =1 << (field &0xf ); -MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_MTT_SEG_OFFSET ); - dev_cap->max_mtt_seg =1 << (field &0x3f );MLX4_GET (size, outbox,QUERY_DEV_CAP_NUM_SYS_EQ_OFFSET ); dev_cap->num_sys_eqs = size &0xfff ;MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_REQ_QP_OFFSET );drivers/net/ethernet/mellanox/mlx4/fw.h +0
-0
drivers/net/ethernet/mellanox/mlx4/fw.h struct mlx4_dev_cap { · line 86
Quoted 9 lines
drivers/net/ethernet/mellanox/mlx4/fw.h +0
-2@@ -80,9 +80,7 @@ struct mlx4_dev_cap {int max_eqs;int num_sys_eqs;int reserved_mtts; -int max_mrw_sz;int reserved_mrws; -int max_mtt_seg;int max_requester_per_qp;int max_responder_per_qp;int max_rdma_global;
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: David Decotigny <[email protected]>
Date: Wed, 28 Sep 2016 11:00:04 -0700
Quoted 12 lines
From: David Decotigny <[email protected]>
This also can address following UBSAN warnings:
[ 36.640343] ================================================================================ [ 36.648772] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:857:26 [ 36.656853] shift exponent 64 is too large for 32-bit type 'int' [ 36.663348] ================================================================================ [ 36.671783] ================================================================================ [ 36.680213] UBSAN: Undefined behaviour in drivers/net/ethernet/mellanox/mlx4/fw.c:861:27 [ 36.688297] shift exponent 35 is too large for 32-bit type 'int' [ 36.694702] ================================================================================
Quoted 4 lines
Tested:
reboot with UBSAN, no warning.Signed-off-by David Decotigny <[email protected]>
Applied to net-next, thanks.