linux/drivers/net/ethernet/huawei/hinic
Arnd Bergmann 84c7f6c33f hinic: avoid gcc -Wrestrict warning
With extra warnings enabled, gcc complains that snprintf should not
take the same buffer as source and destination:

drivers/net/ethernet/huawei/hinic/hinic_ethtool.c: In function 'hinic_set_settings_to_hw':
drivers/net/ethernet/huawei/hinic/hinic_ethtool.c:480:9: error: 'snprintf' argument 4 overlaps destination object 'set_link_str' [-Werror=restrict]
  480 |   err = snprintf(set_link_str, SET_LINK_STR_MAX_LEN,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  481 |           "%sspeed %d ", set_link_str, speed);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_ethtool.c:464:7: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
  464 |  char set_link_str[SET_LINK_STR_MAX_LEN] = {0};

Rewrite this to avoid the nested sprintf and instead use separate
buffers, which is simpler.

Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-24 18:00:32 -07:00
..
hinic_common.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
hinic_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
hinic_debugfs.c hinic: add support to query function table 2020-08-31 12:21:27 -07:00
hinic_debugfs.h hinic: add support to query function table 2020-08-31 12:21:27 -07:00
hinic_dev.h hinic: add support to query function table 2020-08-31 12:21:27 -07:00
hinic_devlink.c devlink: move request_firmware out of driver 2020-11-19 21:40:57 -08:00
hinic_devlink.h hinic: add support to handle hw abnormal event 2020-07-28 17:22:02 -07:00
hinic_ethtool.c hinic: avoid gcc -Wrestrict warning 2021-03-24 18:00:32 -07:00
hinic_hw_api_cmd.c net: hinic: Remove unnecessary 'out of memory' message 2021-03-19 11:53:17 -07:00
hinic_hw_api_cmd.h hinic: add log in exception handling processes 2020-07-28 17:22:03 -07:00
hinic_hw_cmdq.c hinic: improve the comments of function header 2020-09-23 13:20:29 -07:00
hinic_hw_cmdq.h hinic: add check for mailbox msg from VF 2020-08-04 12:17:06 -07:00
hinic_hw_csr.h hinic: add mailbox function support 2020-04-25 20:46:27 -07:00
hinic_hw_dev.c hinic: improve the comments of function header 2020-09-23 13:20:29 -07:00
hinic_hw_dev.h hinic: add support to query function table 2020-08-31 12:21:27 -07:00
hinic_hw_eqs.c hinic: improve the comments of function header 2020-09-23 13:20:29 -07:00
hinic_hw_eqs.h hinic: modify irq name 2020-09-18 14:34:24 -07:00
hinic_hw_if.c net: hinic: remove the repeat word "the" in comment. 2021-03-19 11:53:17 -07:00
hinic_hw_if.h hinic: add log in exception handling processes 2020-07-28 17:22:03 -07:00
hinic_hw_io.c hinic: Fix some kernel-doc warnings in hinic_hw_io.c 2020-09-10 15:18:18 -07:00
hinic_hw_io.h hinic: add support to query sq info 2020-08-31 12:21:26 -07:00
hinic_hw_mbox.c hinic: add check for mailbox msg from VF 2020-08-04 12:17:06 -07:00
hinic_hw_mbox.h hinic: add check for mailbox msg from VF 2020-08-04 12:17:06 -07:00
hinic_hw_mgmt.c hinic: Remove unused variable. 2021-03-19 12:02:54 -07:00
hinic_hw_mgmt.h hinic: add generating mailbox random index support 2020-08-04 12:17:06 -07:00
hinic_hw_qp_ctxt.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-17 20:20:36 -07:00
hinic_hw_qp.c net: hinic: Remove unnecessary 'out of memory' message 2021-03-19 11:53:17 -07:00
hinic_hw_qp.h hinic: add support to query rq info 2020-08-31 12:21:27 -07:00
hinic_hw_wq.c hinic: add sriov feature support 2020-04-25 20:46:28 -07:00
hinic_hw_wq.h hinic: add sriov feature support 2020-04-25 20:46:28 -07:00
hinic_hw_wqe.h hinic: add vlan offload support 2019-06-29 10:28:23 -07:00
hinic_main.c net: hinic: simplify the return hinic_configure_max_qnum() 2020-12-09 17:05:37 -08:00
hinic_port.c hinic: fix wrong return value of mac-set cmd 2020-09-24 20:00:40 -07:00
hinic_port.h net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
hinic_rx.c net: hinic: Remove unnecessary 'out of memory' message 2021-03-19 11:53:17 -07:00
hinic_rx.h hinic: implement the statistical interface of ethtool 2019-06-24 07:18:11 -07:00
hinic_sriov.c hinic: fix wrong return value of mac-set cmd 2020-09-24 20:00:40 -07:00
hinic_sriov.h hinic: add three net_device_ops of vf 2020-05-09 15:28:21 -07:00
hinic_tx.c net: hinic: add a blank line after declarations 2021-03-19 11:53:17 -07:00
hinic_tx.h hinic: add self test support 2020-06-28 20:40:58 -07:00
Kconfig net: hinic: fix DEVLINK build errors 2020-10-03 16:52:19 -07:00
Makefile hinic: add support to query sq info 2020-08-31 12:21:26 -07:00