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 mellanox: Switch to bitmap_zalloc() 2019-03-04 10:19:33 -08:00
catas.c mlx4: Split restart_one into two functions 2019-09-13 22:11:14 +02:00
cmd.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
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 net/mlx4_en: fix a memory leak bug 2019-08-13 19:42:43 -07:00
en_selftest.c
en_tx.c net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
eq.c ethernet: remove redundant memset 2019-07-15 11:06:27 -07:00
fw_qos.c
fw_qos.h
fw.c
fw.h
icm.c
icm.h
intf.c
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
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 net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
mlx4_stats.h
mlx4.h mlx4: Split restart_one into two functions 2019-09-13 22:11:14 +02:00
mr.c
pd.c
port.c net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query 2019-05-20 11:33:57 -07:00
profile.c
qp.c
reset.c
resource_tracker.c net/mlx4_core: Dynamically set guaranteed amount of counters per VF 2019-10-29 16:29:43 -07:00
sense.c
srq.c