Skip to content

Commit a650f67

Browse files
committed
lib: packing: use GENMASK() for box_mask
JIRA: https://issues.redhat.com/browse/RHEL-92666 Upstream commit(s): commit 46e784e Author: Vladimir Oltean <vladimir.oltean@nxp.com> Date: Wed Oct 2 14:51:59 2024 -0700 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> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent b961986 commit a650f67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/packing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int pack(void *pbuf, u64 uval, size_t startbit, size_t endbit, size_t pbuflen,
141141
proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit;
142142
proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit;
143143
proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit);
144-
box_mask = GENMASK_ULL(box_start_bit, box_end_bit);
144+
box_mask = GENMASK(box_start_bit, box_end_bit);
145145

146146
/* Determine the offset of the u8 box inside the pbuf,
147147
* 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,
249249
proj_start_bit = ((box * BITS_PER_BYTE) + box_start_bit) - endbit;
250250
proj_end_bit = ((box * BITS_PER_BYTE) + box_end_bit) - endbit;
251251
proj_mask = GENMASK_ULL(proj_start_bit, proj_end_bit);
252-
box_mask = GENMASK_ULL(box_start_bit, box_end_bit);
252+
box_mask = GENMASK(box_start_bit, box_end_bit);
253253

254254
/* Determine the offset of the u8 box inside the pbuf,
255255
* adjusted for quirks. The adjusted box_addr will be used for

0 commit comments

Comments
 (0)