[PATCH] iwlwifi: pcie: fix a warning / build failure

Subsystems: intel wireless wifi link (iwlwifi), the rest

STALE1719d

2 messages, 2 authors, 2021-11-24 · open the first message on its own page

[PATCH] iwlwifi: pcie: fix a warning / build failure

From: Adam Borowski <hidden>
Date: 2021-11-24 01:58:00

drivers/net/wireless/intel/iwlwifi/pcie/drv.c:
        In function ‘iwl_pci_find_dev_info’:
./include/linux/kernel.h:46:25: error: overflow in conversion from
        ‘long unsigned int’ to ‘int’ changes value from
        ‘18446744073709551615’ to ‘-1’ [-Werror=overflow]

Signed-off-by: Adam Borowski <redacted>
---
Another option would be to #ifdef away iwl_pci_find_dev_info().

 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index c574f041f096..81e8f2fc4982 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1341,7 +1341,7 @@ iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
 {
 	int i;
 
-	for (i = ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) {
+	for (i = (int)ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) {
 		const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
 
 		if (dev_info->device != (u16)IWL_CFG_ANY &&
-- 
2.34.0

Re: [PATCH] iwlwifi: pcie: fix a warning / build failure

From: Kalle Valo <hidden>
Date: 2021-11-24 08:12:41

Adam Borowski [off-list ref] writes:
quoted hunk
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:
        In function ‘iwl_pci_find_dev_info’:
./include/linux/kernel.h:46:25: error: overflow in conversion from
        ‘long unsigned int’ to ‘int’ changes value from
        ‘18446744073709551615’ to ‘-1’ [-Werror=overflow]

Signed-off-by: Adam Borowski <redacted>
---
Another option would be to #ifdef away iwl_pci_find_dev_info().

 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index c574f041f096..81e8f2fc4982 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1341,7 +1341,7 @@ iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
 {
 	int i;
 
-	for (i = ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) {
+	for (i = (int)ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) {
 		const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
 
 		if (dev_info->device != (u16)IWL_CFG_ANY &&
There's already fix for this:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git/commit/?id=fe785f56ad5886c08d1cadd9e8b4e1ff6a1866f6

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help