1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/qlogic/qed
Justin Stitt b6afeb87ad qlogic: qed: fix clang -Wformat warnings
When building with Clang we encounter these warnings:
| drivers/net/ethernet/qlogic/qed/qed_dev.c:416:30: error: format
| specifies type 'char' but the argument has type 'u32' (aka 'unsigned
| int') [-Werror,-Wformat] i);
-
| drivers/net/ethernet/qlogic/qed/qed_dev.c:630:13: error: format
| specifies type 'char' but the argument has type 'int' [-Werror,-Wformat]
| p_llh_info->num_ppfid - 1);

For the first warning, `i` is a u32 which is much wider than the format
specifier `%hhd` describes. This results in a loss of bits after 2^7.

The second warning involves implicit integer promotion as the resulting
type of addition cannot be smaller than an int.

example:
``
uint8_t a = 4, b = 7;
int size = sizeof(a + b - 1);
printf("%d\n", size);
// output: 4
```

See more:
(https://wiki.sei.cmu.edu/confluence/display/c/INT02-C.+Understand+integer+conversion+rules)
"Integer types smaller than int are promoted when an operation is
performed on them. If all values of the original type can be represented
as an int, the value of the smaller type is converted to an int;
otherwise, it is converted to an unsigned int."

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20220711232404.2189257-1-justinstitt@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-07-12 20:36:41 -07:00
..
Makefile qed: Remove IP services API. 2022-04-22 15:15:23 -07:00
qed.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_chain.c qed: fix the allocation of the chains with an external PBL 2020-07-27 12:17:14 -07:00
qed_cxt.c qed: Use the bitmap API to simplify some functions 2021-11-22 14:30:57 +00:00
qed_cxt.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_dbg_hsi.h qed: fix typos in comments 2022-05-22 20:44:30 +01:00
qed_dcbx.c net: qed: remove unneeded return variables 2021-07-27 11:55:19 +01:00
qed_dcbx.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_debug.c qed: fix ethtool register dump 2022-04-04 12:42:52 +01:00
qed_debug.h qed: Update debug related changes 2021-10-04 12:55:49 +01:00
qed_dev.c qlogic: qed: fix clang -Wformat warnings 2022-07-12 20:36:41 -07:00
qed_dev_api.h ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
qed_devlink.c qed: Move devlink registration to be last devlink command 2021-09-27 16:31:59 +01:00
qed_devlink.h qed: use devlink logic to report errors 2020-08-24 18:01:33 -07:00
qed_fcoe.c qed: Add '_GTT' suffix to the IRO RAM macros 2021-10-04 12:55:49 +01:00
qed_fcoe.h net: qed: cleanup global structs declarations 2020-07-06 13:18:55 -07:00
qed_hsi.h qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_hw.c net: qed: correct qed_hw_err_notify() prototype 2020-07-06 13:18:55 -07:00
qed_hw.h qed: Fix kernel-doc warnings 2021-10-04 12:55:48 +01:00
qed_init_fw_funcs.c qed: remove unnecessary memset in qed_init_fw_funcs 2022-03-21 10:59:56 +00:00
qed_init_ops.c qed: Update FW init functions to support FW 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_init_ops.h qed: Update FW init functions to support FW 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_int.c qlogic/qed: fix repeated words in comments 2022-07-01 20:13:50 -07:00
qed_int.h qed*: enhance tx timeout debug info 2021-12-03 18:24:20 -08:00
qed_iro_hsi.h qed: Add '_GTT' suffix to the IRO RAM macros 2021-10-04 12:55:49 +01:00
qed_iscsi.c qed: Add '_GTT' suffix to the IRO RAM macros 2021-10-04 12:55:49 +01:00
qed_iscsi.h qed: Fix kernel-doc warnings 2021-10-04 12:55:48 +01:00
qed_iwarp.c qed: Update the TCP active termination 2 MSL timer ("TIME_WAIT") 2021-10-04 12:55:49 +01:00
qed_iwarp.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_l2.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
qed_l2.h qed: Update qed_hsi.h for fw 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_ll2.c qed: Change the TCP common variable - "iscsi_ooo" 2021-10-18 15:58:21 -07:00
qed_ll2.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_main.c qed: Remove unnecessary synchronize_irq() before free_irq() 2022-05-17 13:02:34 +02:00
qed_mcp.c qed: prevent a fw assert during device shutdown 2022-02-10 15:27:44 +00:00
qed_mcp.h qed: prevent a fw assert during device shutdown 2022-02-10 15:27:44 +00:00
qed_mfw_hsi.h treewide: Replace zero-length arrays with flexible-array members 2022-02-17 07:00:39 -06:00
qed_mng_tlv.c qed: Add NVMeTCP Offload PF Level FW and HW HSI 2021-06-03 14:04:17 -07:00
qed_nvmetcp.c qed: Add NVMeTCP Offload IO Level FW Initializations 2021-06-03 14:04:17 -07:00
qed_nvmetcp.h qed: Add NVMeTCP Offload Connection Level FW and HW HSI 2021-06-03 14:04:17 -07:00
qed_nvmetcp_fw_funcs.c qed: Remove duplicated include of kernel.h 2021-08-03 11:49:28 +01:00
qed_nvmetcp_fw_funcs.h qed: Fix duplicate included linux/kernel.h 2021-06-07 13:29:50 -07:00
qed_ooo.c qed: Optimize the ll2 ooo flow 2021-10-18 15:58:21 -07:00
qed_ooo.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_ptp.c net: qed_ptp: fix check of true !rc expression 2021-10-25 19:11:13 -07:00
qed_ptp.h net: qed: cleanup global structs declarations 2020-07-06 13:18:55 -07:00
qed_rdma.c qed: Use bitmap_empty() 2022-07-06 19:55:14 -07:00
qed_rdma.h qed: Split huge qed_hsi.h header file 2021-10-04 12:55:48 +01:00
qed_reg_addr.h qed*: enhance tx timeout debug info 2021-12-03 18:24:20 -08:00
qed_roce.c qed: replace bitmap_weight with bitmap_empty in qed_roce_stop() 2022-05-02 06:30:40 -07:00
qed_roce.h net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_selftest.c net: qed: update copyright years 2020-06-30 15:51:40 -07:00
qed_selftest.h qed: Fix kernel-doc warnings 2021-10-04 12:55:48 +01:00
qed_sp.h qed: Update qed_hsi.h for fw 8.59.1.0 2021-10-04 12:55:49 +01:00
qed_sp_commands.c qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_spq.c qed: Enhance rammod debug prints to provide pretty details 2021-12-02 12:22:17 +00:00
qed_sriov.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-10 17:16:56 -08:00
qed_sriov.h qed: validate and restrict untrusted VFs vlan promisc mode 2022-03-03 10:26:20 +00:00
qed_vf.c net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare() 2022-03-07 11:28:38 +00:00
qed_vf.h qed: fix typos in comments 2022-05-22 20:44:30 +01:00