wifi: iwlwifi: cfg: reduce mac_type to u8
authorJohannes Berg <johannes.berg@intel.com>
Fri, 2 May 2025 12:56:27 +0000 (15:56 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 6 May 2025 19:22:13 +0000 (22:22 +0300)
In theory, this should be 12 bits, but in practice all the
values we use now fit into 8 bits, so change the mac_type to
make room in struct iwl_dev_info.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250502155404.c17d56f4ae0f.I487c8df18aa33c46aa6813bf5aebb5a23da67600@changeid
drivers/net/wireless/intel/iwlwifi/iwl-config.h
drivers/net/wireless/intel/iwlwifi/pcie/drv.c

index cded707223fe809f69f967c45ea4e05bab42f689..4b43f561bd127f26ba95e2810e966cde4bb27a67 100644 (file)
@@ -459,8 +459,8 @@ struct iwl_cfg {
 struct iwl_dev_info {
        u16 device;
        u16 subdevice;
-       u16 mac_type;
        u16 rf_type;
+       u8 mac_type;
        u8 bw_limit;
        u8 mac_step;
        u8 rf_step;
@@ -477,7 +477,7 @@ extern const struct iwl_dev_info iwl_dev_info_table[];
 extern const unsigned int iwl_dev_info_table_size;
 const struct iwl_dev_info *
 iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
-                     u16 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
+                     u8 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
                      u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step);
 extern const struct pci_device_id iwl_hw_card_ids[];
 #endif
index 0165c06fd7aa4f7dc6d25db4d785d4d4346fcd30..449ed4b02a5f859c876bbc865aadaee2c878f8a6 100644 (file)
@@ -2103,7 +2103,7 @@ out:
 
 VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info *
 iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
-                     u16 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
+                     u8 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
                      u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step)
 {
        int num_devices = ARRAY_SIZE(iwl_dev_info_table);
@@ -2123,7 +2123,7 @@ iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
                    dev_info->subdevice != subsystem_device)
                        continue;
 
-               if (dev_info->mac_type != (u16)IWL_CFG_ANY &&
+               if (dev_info->mac_type != (u8)IWL_CFG_ANY &&
                    dev_info->mac_type != mac_type)
                        continue;