linux_dsm_epyc7002/drivers/net/ethernet/mellanox/mlx4
Jacob Keller 41b145024c mlx4: fix "initializer element not constant" compiler error
A recent commit e893768179 ("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: e893768179 ("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>
2020-03-29 22:09:39 -07:00
..
alloc.c
catas.c
cmd.c
cq.c
crdump.c mlx4: fix "initializer element not constant" compiler error 2020-03-29 22:09:39 -07:00
en_clock.c
en_cq.c
en_dcb_nl.c
en_ethtool.c net: mlx4: reject unsupported coalescing params 2020-03-10 16:28:53 -07:00
en_main.c
en_netdev.c mlx4: use new txqueue timeout argument 2019-12-12 21:38:57 -08:00
en_port.c
en_port.h
en_resources.c
en_rx.c
en_selftest.c
en_tx.c
eq.c
fw_qos.c
fw_qos.h
fw.c
fw.h
icm.c
icm.h
intf.c
Kconfig
main.c devlink: disallow reload operation during device cleanup 2019-11-09 19:38:36 -08:00
Makefile
mcg.c net: mlx4: Use scnprintf() for avoiding potential buffer overflow 2020-03-15 17:06:22 -07:00
mlx4_en.h
mlx4_stats.h
mlx4.h
mr.c
pd.c
port.c
profile.c
qp.c
reset.c
resource_tracker.c
sense.c
srq.c