From: Johannes Berg Date: Sat, 10 May 2025 18:48:21 +0000 (+0300) Subject: wifi: iwlwifi: tests: make subdev match test more precise X-Git-Tag: v6.16-rc1~132^2~46^2~8^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3de6694beb491b086a538e18c6e20f4434366525;p=thirdparty%2Fkernel%2Flinux.git wifi: iwlwifi: tests: make subdev match test more precise It's OK to match with subdevice_mask as long as that doesn't overlap the RF ID/BW limit/cores fields in that. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20250510214621.87cc0ad360a8.I9be361caedd7258e8e817d4100c549681396f307@changeid --- diff --git a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c index 115642c75d100..bd0102ef73848 100644 --- a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c +++ b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c @@ -104,9 +104,17 @@ static void devinfo_check_subdev_match(struct kunit *test) if (di->bw_limit == 1) KUNIT_EXPECT_NE(test, di->cfg->bw_limit, 0); + /* if subdevice is ANY we can have RF ID/BW limit/cores */ if (di->subdevice == (u16)IWL_CFG_ANY) continue; + /* same if the subdevice mask doesn't overlap them */ + if (IWL_SUBDEVICE_RF_ID(di->subdevice_mask) == 0 && + IWL_SUBDEVICE_BW_LIM(di->subdevice_mask) == 0 && + IWL_SUBDEVICE_CORES(di->subdevice_mask) == 0) + continue; + + /* but otherwise they shouldn't be used */ KUNIT_EXPECT_EQ(test, di->rf_id, (u8)IWL_CFG_ANY); KUNIT_EXPECT_EQ(test, di->bw_limit, (u8)IWL_CFG_ANY); KUNIT_EXPECT_EQ(test, di->cores, (u8)IWL_CFG_ANY);