git: db42bd1f71b1 - main - LinuxKPI: Convert Linux integer types to ISO C99 in linux/kstrtox.h

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Thu, 06 Jun 2024 20:43:05 UTC
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=db42bd1f71b1a29b392aacbd5b7aaca4c8d7e85d

commit db42bd1f71b1a29b392aacbd5b7aaca4c8d7e85d
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2024-06-06 20:42:07 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-06-06 20:42:07 +0000

    LinuxKPI: Convert Linux integer types to ISO C99 in linux/kstrtox.h
    
    Sponsored by:   Serenity Cyber Security, LLC
    MFC after:      1 week
    Reviewed by:    bz, emaste
    Differential Revision:  https://reviews.freebsd.org/D45465
---
 sys/compat/linuxkpi/common/include/linux/kstrtox.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/kstrtox.h b/sys/compat/linuxkpi/common/include/linux/kstrtox.h
index b723bd4a6fd0..0567aa99f7a4 100644
--- a/sys/compat/linuxkpi/common/include/linux/kstrtox.h
+++ b/sys/compat/linuxkpi/common/include/linux/kstrtox.h
@@ -137,7 +137,7 @@ kstrtouint(const char *cp, unsigned int base, unsigned int *res)
 }
 
 static inline int
-kstrtou8(const char *cp, unsigned int base, u8 *res)
+kstrtou8(const char *cp, unsigned int base, uint8_t *res)
 {
 	char *end;
 	unsigned long temp;
@@ -149,13 +149,13 @@ kstrtou8(const char *cp, unsigned int base, u8 *res)
 		end++;
 	if (*cp == 0 || *end != 0)
 		return (-EINVAL);
-	if (temp != (u8)temp)
+	if (temp != (uint8_t)temp)
 		return (-ERANGE);
 	return (0);
 }
 
 static inline int
-kstrtou16(const char *cp, unsigned int base, u16 *res)
+kstrtou16(const char *cp, unsigned int base, uint16_t *res)
 {
 	char *end;
 	unsigned long temp;
@@ -167,20 +167,20 @@ kstrtou16(const char *cp, unsigned int base, u16 *res)
 		end++;
 	if (*cp == 0 || *end != 0)
 		return (-EINVAL);
-	if (temp != (u16)temp)
+	if (temp != (uint16_t)temp)
 		return (-ERANGE);
 	return (0);
 }
 
 static inline int
-kstrtou32(const char *cp, unsigned int base, u32 *res)
+kstrtou32(const char *cp, unsigned int base, uint32_t *res)
 {
 
 	return (kstrtouint(cp, base, res));
 }
 
 static inline int
-kstrtos64(const char *cp, unsigned int base, s64 *res)
+kstrtos64(const char *cp, unsigned int base, int64_t *res)
 {
 	char *end;
 
@@ -197,7 +197,7 @@ kstrtos64(const char *cp, unsigned int base, s64 *res)
 static inline int
 kstrtoll(const char *cp, unsigned int base, long long *res)
 {
-	return (kstrtos64(cp, base, (s64 *)res));
+	return (kstrtos64(cp, base, (int64_t *)res));
 }
 
 static inline int
@@ -218,7 +218,7 @@ kstrtou64(const char *cp, unsigned int base, u64 *res)
 static inline int
 kstrtoull(const char *cp, unsigned int base, unsigned long long *res)
 {
-	return (kstrtou64(cp, base, (u64 *)res));
+	return (kstrtou64(cp, base, (uint64_t *)res));
 }
 
 static inline int
@@ -301,7 +301,7 @@ kstrtou32_from_user(const char __user *s, size_t count, unsigned int base,
 
 static inline int
 kstrtou8_from_user(const char __user *s, size_t count, unsigned int base,
-    u8 *p)
+    uint8_t *p)
 {
 	char buf[8] = {};