[PATCH 436/437] kstrtox: remove (now) dead helpers

From: Jens Axboe
Date: Thu Apr 11 2024 - 13:20:34 EST


This drops:

kstrtoll_from_user()
kstrtol_from_user()
kstrtouint_from_user()
kstrtou16_from_user()
kstrtos16_from_user()
kstrtos8_from_user()
kstrtou64_from_user()
kstrtos64_from_user()
kstrtou32_from_user()
kstrtos32_from_user()

as they are no longer used in the code base.

Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
include/linux/kstrtox.h | 26 --------------------------
lib/kstrtox.c | 6 ------
2 files changed, 32 deletions(-)

diff --git a/include/linux/kstrtox.h b/include/linux/kstrtox.h
index 229e0162849a..2fa469860c42 100644
--- a/include/linux/kstrtox.h
+++ b/include/linux/kstrtox.h
@@ -98,15 +98,9 @@ int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
int __must_check kstrtobool(const char *s, bool *res);

int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
-int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
-int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
-int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
-int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
-int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
-int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
int __must_check kstrtobool_from_user(const char __user *s, size_t count, bool *res);

struct iov_iter;
@@ -119,36 +113,16 @@ int __must_check kstrtou16_from_iter(struct iov_iter *s, size_t count, unsigned
int __must_check kstrtou8_from_iter(struct iov_iter *s, size_t count, unsigned int base, u8 *res);
int __must_check kstrtobool_from_iter(struct iov_iter *src, size_t count, bool *res);

-static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
-{
- return kstrtoull_from_user(s, count, base, res);
-}
-
static inline int __must_check kstrtou64_from_iter(struct iov_iter *src, size_t count, unsigned int base, u64 *res)
{
return kstrtoull_from_iter(src, count, base, res);
}

-static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
-{
- return kstrtoll_from_user(s, count, base, res);
-}
-
-static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
-{
- return kstrtouint_from_user(s, count, base, res);
-}
-
static inline int __must_check kstrtou32_from_iter(struct iov_iter *src, size_t count, unsigned int base, u32 *res)
{
return kstrtouint_from_iter(src, count, base, res);
}

-static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
-{
- return kstrtoint_from_user(s, count, base, res);
-}
-
static inline int __must_check kstrtos32_from_iter(struct iov_iter *src, size_t count, unsigned int base, s32 *res)
{
return kstrtoint_from_iter(src, count, base, res);
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 111231cb4148..e8a603954396 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -438,15 +438,9 @@ int f(const char __user *s, size_t count, unsigned int base, type *res) \
EXPORT_SYMBOL(f)

kstrto_from_user(kstrtoull_from_user, kstrtoull, unsigned long long);
-kstrto_from_user(kstrtoll_from_user, kstrtoll, long long);
kstrto_from_user(kstrtoul_from_user, kstrtoul, unsigned long);
-kstrto_from_user(kstrtol_from_user, kstrtol, long);
-kstrto_from_user(kstrtouint_from_user, kstrtouint, unsigned int);
kstrto_from_user(kstrtoint_from_user, kstrtoint, int);
-kstrto_from_user(kstrtou16_from_user, kstrtou16, u16);
-kstrto_from_user(kstrtos16_from_user, kstrtos16, s16);
kstrto_from_user(kstrtou8_from_user, kstrtou8, u8);
-kstrto_from_user(kstrtos8_from_user, kstrtos8, s8);

#define kstrto_from_iter(f, g, type) \
int f(struct iov_iter *s, size_t count, unsigned int base, type *res) \
--
2.43.0