]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: iwlwifi: uefi: remove runtime check of constant values
authorJohannes Berg <johannes.berg@intel.com>
Thu, 28 Aug 2025 08:25:47 +0000 (11:25 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 31 Aug 2025 11:39:25 +0000 (14:39 +0300)
commitf53f2bd8fc5f7d986b676a3f80505ba4d6b0b311
tree55a286f27c77c93c1e9934045de0074d7baa340d
parent5272d45914fff0e68ecb7ee9887f174770236ae3
wifi: iwlwifi: uefi: remove runtime check of constant values

There's no need to check an ARRAY_SIZE() at runtime, it's
already determined at build time, so could be a BUILD_BUG_ON.
However it's not that useful here since the array is defined
using UEFI_MAX_DSM_FUNCS, check DSM_FUNC_NUM_FUNCS instead to
ensure the array cannot be accessed out-of-band, i.e. ensure
the range check there is always good enough.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250828111032.cc3c17327ea2.I99c7175be1f72f29b154454fc24978daafad476f@changeid
drivers/net/wireless/intel/iwlwifi/fw/uefi.c