]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib: packing: duplicate pack() and unpack() implementations
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 2 Oct 2024 21:51:54 +0000 (14:51 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Oct 2024 22:32:04 +0000 (15:32 -0700)
commit28aec9ca29f05dabb835293acc6e202bf51b8092
tree86e96b24a4a21b550cdcce9a60c45ded39565492
parent7263f64e16d90ded44ce211381b2def83db32fd9
lib: packing: duplicate pack() and unpack() implementations

packing() is now used in some hot paths, and it would be good to get rid
of some ifs and buts that depend on "op", to speed things up a little bit.

With the main implementations now taking size_t endbit, we no longer
have to check for negative values. Update the local integer variables to
also be size_t to match.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241002-packing-kunit-tests-and-split-pack-unpack-v2-5-8373e551eae3@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/packing.h
lib/packing.c