]> exis.tech > repos - linux.git/commit
initramfs: Refactor to use hex2bin() instead of custom approach
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 31 Mar 2026 06:57:34 +0000 (17:57 +1100)
committerChristian Brauner <brauner@kernel.org>
Thu, 21 May 2026 07:32:46 +0000 (09:32 +0200)
commitec03d259f67bab506dc176a661210a3ee15e31b6
tree6e7054fb358812421f70b8417c11bbec1957d5e0
parenta4d6170e86c72fad45257e189bbd901f64dfb40a
initramfs: Refactor to use hex2bin() instead of custom approach

There is a simple_strntoul() function used solely as a shortcut
for hex2bin() with proper endianess conversions. Replace that
and drop the unneeded function in the next changes.

This implementation will abort if we fail to parse the cpio header,
instead of using potentially bogus header values.

Co-developed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260331070519.5974-5-ddiss@suse.de
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
init/initramfs.c
init/initramfs_test.c