]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib: packing: create __pack() and __unpack() variants without error checking
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 10 Dec 2024 20:27:10 +0000 (12:27 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Dec 2024 04:12:59 +0000 (20:12 -0800)
commitc4117091d029087abde76e6947d43dca8f1db20b
tree2f023638b28f29618d836a5f4561d32a63f34919
parentae7837bb3d9d0bad1230353bbafb92b3e6ad3941
lib: packing: create __pack() and __unpack() variants without error checking

A future variant of the API, which works on arrays of packed_field
structures, will make most of these checks redundant. The idea will be
that we want to perform sanity checks at compile time, not once
for every function call.

Introduce new variants of pack() and unpack(), which elide the sanity
checks, assuming that the input was pre-sanitized.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241210-packing-pack-fields-and-ice-implementation-v10-1-ee56a47479ac@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
lib/packing.c