Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2024 20:43:04 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d207a2dee332 - main - LinuxKPI: Add kstrtoll to linux/kstrtox.h
Message-ID:  <202406062043.456Kh4BI046452@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf:

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

commit d207a2dee332706c352bf35c7e6ecea5240b1ceb
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: Add kstrtoll to linux/kstrtox.h
    
    kstrtoll converts a string to a long long.
    
    Sponsored by:   Serenity Cyber Security, LLC
    MFC after:      1 week
    Reviewed by:    bz, emaste
    Differential Revision:  https://reviews.freebsd.org/D45455
---
 sys/compat/linuxkpi/common/include/linux/kstrtox.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/kstrtox.h b/sys/compat/linuxkpi/common/include/linux/kstrtox.h
index 5dfc56d40d6e..b723bd4a6fd0 100644
--- a/sys/compat/linuxkpi/common/include/linux/kstrtox.h
+++ b/sys/compat/linuxkpi/common/include/linux/kstrtox.h
@@ -7,6 +7,7 @@
  * Copyright (c) 2018 Johannes Lundberg <johalun0@gmail.com>
  * Copyright (c) 2020-2022 The FreeBSD Foundation
  * Copyright (c) 2021 Vladimir Kondratyev <wulf@FreeBSD.org>
+ * Copyright (c) 2023 Serenity Cyber Security, LLC
  *
  * Portions of this software were developed by Bjoern A. Zeeb and
  * Emmanuel Vadot under sponsorship from the FreeBSD Foundation.
@@ -193,6 +194,12 @@ kstrtos64(const char *cp, unsigned int base, s64 *res)
 	return (0);
 }
 
+static inline int
+kstrtoll(const char *cp, unsigned int base, long long *res)
+{
+	return (kstrtos64(cp, base, (s64 *)res));
+}
+
 static inline int
 kstrtou64(const char *cp, unsigned int base, u64 *res)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406062043.456Kh4BI046452>