Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx4: make the array states static const, makes object smaller

Don't populate the array states on the stack but instead it
static const. Makes the object code smaller by 79 bytes.

Before:
text data bss dec hex filename
21309 8304 192 29805 746d drivers/net/ethernet/mellanox/mlx4/qp.o

After:
text data bss dec hex filename
21166 8368 192 29726 741e drivers/net/ethernet/mellanox/mlx4/qp.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20210801153742.147304-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Colin Ian King and committed by
Jakub Kicinski
7cdd0a89 771edeab

+1 -1
+1 -1
drivers/net/ethernet/mellanox/mlx4/qp.c
··· 917 917 { 918 918 int err; 919 919 int i; 920 - enum mlx4_qp_state states[] = { 920 + static const enum mlx4_qp_state states[] = { 921 921 MLX4_QP_STATE_RST, 922 922 MLX4_QP_STATE_INIT, 923 923 MLX4_QP_STATE_RTR,