lib: packing: use GENMASK() for box_mask

This is an u8, so using GENMASK_ULL() for unsigned long long is
unnecessary.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20241002-packing-kunit-tests-and-split-pack-unpack-v2-10-8373e551eae3@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Vladimir Oltean 2024-10-02 14:51:59 -07:00 committed by Jakub Kicinski
parent fb02c7c8a5
commit 46e784e94b

View File

@ -141,7 +141,7 @@ int pack(void *pbuf, u64 uval, size_t startbit, size_t endbit, size_t pbuflen,
proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit; proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit;
proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit; proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit;
proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit); proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit);
box_mask = GENMASK_ULL(box_start_bit, box_end_bit); box_mask = GENMASK(box_start_bit, box_end_bit);
/* Determine the offset of the u8 box inside the pbuf, /* Determine the offset of the u8 box inside the pbuf,
* adjusted for quirks. The adjusted box_addr will be used for * adjusted for quirks. The adjusted box_addr will be used for
@ -249,7 +249,7 @@ int unpack(const void *pbuf, u64 *uval, size_t startbit, size_t endbit,
proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit; proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit;
proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit; proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit;
proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit); proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit);
box_mask = GENMASK_ULL(box_start_bit, box_end_bit); box_mask = GENMASK(box_start_bit, box_end_bit);
/* Determine the offset of the u8 box inside the pbuf, /* Determine the offset of the u8 box inside the pbuf,
* adjusted for quirks. The adjusted box_addr will be used for * adjusted for quirks. The adjusted box_addr will be used for