summaryrefslogtreecommitdiff
path: root/include/linux/tcp.h
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2020-03-27 14:08:35 -0700
committerDavid S. Miller <davem@davemloft.net>2020-03-29 22:09:39 -0700
commit41b145024ca717254bb6882f1312299db958bf0c (patch)
tree5006ad7c37d4c92fbb2f178454c74de0d1ebb491 /include/linux/tcp.h
parent9c11cc784963597eb2796b544bfd98bfb5612c2b (diff)
downloadlwn-41b145024ca717254bb6882f1312299db958bf0c.tar.gz
lwn-41b145024ca717254bb6882f1312299db958bf0c.zip
mlx4: fix "initializer element not constant" compiler error
A recent commit e8937681797c ("devlink: prepare to support region operations") used the region_cr_space_str and region_fw_health_str variables as initializers for the devlink_region_ops structures. This can result in compiler errors: drivers/net/ethernet/mellanox//mlx4/crdump.c:45:10: error: initializer element is not constant .name = region_cr_space_str, ^ drivers/net/ethernet/mellanox//mlx4/crdump.c:45:10: note: (near initialization for ‘region_cr_space_ops.name’) drivers/net/ethernet/mellanox//mlx4/crdump.c:50:10: error: initializer element is not constant .name = region_fw_health_str, The variables were made to be "const char * const", indicating that both the pointer and data were constant. This was enough to resolve this on recent GCC (gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1) for this author). Unfortunately this is not enough for older compilers to realize that the variable can be treated as a constant expression. Fix this by introducing macros for the string and use those instead of the variable name in the region ops structures. Reported-by: tanhuazhong <tanhuazhong@huawei.com> Fixes: e8937681797c ("devlink: prepare to support region operations") Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/tcp.h')
0 files changed, 0 insertions, 0 deletions