mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-10 21:48:45 -04:00
wifi: iwlwifi: mld: tests: simplify le32 bitfield handling
We can use le32_encode_bits() instead of cpu_to_le32() combined with FIELD_PREP(). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250423091408.9155a412dcc7.I8330ca413d6bdf953e79361ac50939176bcc4e6e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* KUnit tests for channel helper functions
|
||||
*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*/
|
||||
#include <kunit/test.h>
|
||||
#include <kunit/static_stub.h>
|
||||
@@ -474,14 +474,14 @@ static struct iwl_rx_mpdu_desc *setup_mpdu_desc(void)
|
||||
KUNIT_ALLOC_AND_ASSERT(test, mpdu_desc);
|
||||
|
||||
mpdu_desc->reorder_data |=
|
||||
cpu_to_le32(FIELD_PREP(IWL_RX_MPDU_REORDER_BAID_MASK,
|
||||
param->rx_pkt.baid));
|
||||
le32_encode_bits(param->rx_pkt.baid,
|
||||
IWL_RX_MPDU_REORDER_BAID_MASK);
|
||||
mpdu_desc->reorder_data |=
|
||||
cpu_to_le32(FIELD_PREP(IWL_RX_MPDU_REORDER_SN_MASK,
|
||||
param->rx_pkt.sn));
|
||||
le32_encode_bits(param->rx_pkt.sn,
|
||||
IWL_RX_MPDU_REORDER_SN_MASK);
|
||||
mpdu_desc->reorder_data |=
|
||||
cpu_to_le32(FIELD_PREP(IWL_RX_MPDU_REORDER_NSSN_MASK,
|
||||
param->rx_pkt.nssn));
|
||||
le32_encode_bits(param->rx_pkt.nssn,
|
||||
IWL_RX_MPDU_REORDER_NSSN_MASK);
|
||||
if (param->rx_pkt.old_sn)
|
||||
mpdu_desc->reorder_data |=
|
||||
cpu_to_le32(IWL_RX_MPDU_REORDER_BA_OLD_SN);
|
||||
|
||||
Reference in New Issue
Block a user