[PATCH 03/20] headers: add kstrtox.h backport
Yi Cong <[email protected]> Wed, 24 Jun 2026 15:38:27 +0800
| Newsgroups | org.kernel.vger.backports |
|---|---|
| Message-ID | <[email protected]> |
From: Yi Cong <[email protected]> The separate <linux/kstrtox.h> header was introduced in v5.14 (commit 29b25d81ef62). Before that, kstrto*() declarations live in <linux/kernel.h>. Provide a compatibility wrapper that includes <linux/kernel.h> on kernels older than v5.14. Signed-off-by: Yi Cong <[email protected]> --- backport/backport-include/linux/kstrtox.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 backport/backport-include/linux/kstrtox.h diff --git a/backport/backport-include/linux/kstrtox.h b/backport/backport-include/linux/kstrtox.h new file mode 100644 index 00000000..a17d072b --- /dev/null +++ b/backport/backport-include/linux/kstrtox.h @@ -0,0 +1,17 @@ +#ifndef __BACKPORT_KSTRTOX_H +#define __BACKPORT_KSTRTOX_H +#include <linux/version.h> + +#if LINUX_VERSION_IS_LESS(5,14,0) +/* + * Before Linux 5.14, kstrto* functions were declared in linux/kernel.h. + * The separate linux/kstrtox.h header was introduced in commit + * 29b25d81ef62 ("lib/kstrtox: move kstrto*() from lib/cmdline.c to + * lib/kstrtox.c, add tests"). + */ +#include <linux/kernel.h> +#else +#include_next <linux/kstrtox.h> +#endif + +#endif /* __BACKPORT_KSTRTOX_H */ -- 2.43.0