iwlwifi: fix NUM_IWL_UCODE_TLV_* definitions to avoid sparse errors
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 18 Jun 2021 08:01:20 +0000 (11:01 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 22 Jun 2021 13:57:56 +0000 (16:57 +0300)
We were assigning these macros manually when sparse is running, but
with newer versions of sparse, it started causing other warnings.  Fix
it by making it a macro when sparse is running.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618105614.dc658639e07f.I69ab6d59ff10c55c8517621eb20a52194dc4783a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/file.h

index d189e5d..ef1a245 100644 (file)
@@ -277,10 +277,11 @@ enum iwl_ucode_tlv_api {
        IWL_UCODE_TLV_API_BAND_IN_RX_DATA       = (__force iwl_ucode_tlv_api_t)59,
 
 
-       NUM_IWL_UCODE_TLV_API
 #ifdef __CHECKER__
-               /* sparse says it cannot increment the previous enum member */
-               = 128
+       /* sparse says it cannot increment the previous enum member */
+#define NUM_IWL_UCODE_TLV_API 128
+#else
+       NUM_IWL_UCODE_TLV_API
 #endif
 };
 
@@ -447,10 +448,11 @@ enum iwl_ucode_tlv_capa {
        IWL_UCODE_TLV_CAPA_BIGTK_SUPPORT                = (__force iwl_ucode_tlv_capa_t)100,
        IWL_UCODE_TLV_CAPA_RFIM_SUPPORT                 = (__force iwl_ucode_tlv_capa_t)102,
 
-       NUM_IWL_UCODE_TLV_CAPA
 #ifdef __CHECKER__
-               /* sparse says it cannot increment the previous enum member */
-               = 128
+       /* sparse says it cannot increment the previous enum member */
+#define NUM_IWL_UCODE_TLV_CAPA 128
+#else
+       NUM_IWL_UCODE_TLV_CAPA
 #endif
 };