lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291571382-2719-16-git-send-email-adobriyan@gmail.com>
Date:	Sun,  5 Dec 2010 19:49:13 +0200
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, Alexey Dobriyan <adobriyan@...il.com>
Subject: [PATCH 16/45] kstrtox: convert drivers/bluetooth/


Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
 drivers/bluetooth/btmrvl_debugfs.c |   50 +++++++++++++++++------------------
 1 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c
index fd6305b..ffc4324 100644
--- a/drivers/bluetooth/btmrvl_debugfs.c
+++ b/drivers/bluetooth/btmrvl_debugfs.c
@@ -56,16 +56,16 @@ static ssize_t btmrvl_hscfgcmd_write(struct file *file,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 10, &result);
-
-	priv->btmrvl_dev.hscfgcmd = result;
+	ret = kstrtou8(buf, 10, &priv->btmrvl_dev.hscfgcmd);
+	if (ret < 0)
+		return ret;
 
 	if (priv->btmrvl_dev.hscfgcmd) {
 		btmrvl_prepare_command(priv);
@@ -100,17 +100,16 @@ static ssize_t btmrvl_psmode_write(struct file *file, const char __user *ubuf,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 10, &result);
-
-	priv->btmrvl_dev.psmode = result;
-
+	ret = kstrtou8(buf, 10, &priv->btmrvl_dev.psmode);
+	if (ret < 0)
+		return ret;
 	return count;
 }
 
@@ -139,16 +138,16 @@ static ssize_t btmrvl_pscmd_write(struct file *file, const char __user *ubuf,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 10, &result);
-
-	priv->btmrvl_dev.pscmd = result;
+	ret = kstrtou8(buf, 10, &priv->btmrvl_dev.pscmd);
+	if (ret < 0)
+		return ret;
 
 	if (priv->btmrvl_dev.pscmd) {
 		btmrvl_prepare_command(priv);
@@ -183,17 +182,16 @@ static ssize_t btmrvl_gpiogap_write(struct file *file, const char __user *ubuf,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 16, &result);
-
-	priv->btmrvl_dev.gpio_gap = result;
-
+	ret = kstrtou16(buf, 16, &priv->btmrvl_dev.gpio_gap);
+	if (ret < 0)
+		return ret;
 	return count;
 }
 
@@ -222,16 +220,17 @@ static ssize_t btmrvl_hscmd_write(struct file *file, const char __user *ubuf,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 10, &result);
+	ret = kstrtou8(buf, 10, &priv->btmrvl_dev.hscmd);
+	if (ret < 0)
+		return ret;
 
-	priv->btmrvl_dev.hscmd = result;
 	if (priv->btmrvl_dev.hscmd) {
 		btmrvl_prepare_command(priv);
 		wake_up_interruptible(&priv->main_thread.wait_q);
@@ -264,17 +263,16 @@ static ssize_t btmrvl_hsmode_write(struct file *file, const char __user *ubuf,
 {
 	struct btmrvl_private *priv = file->private_data;
 	char buf[16];
-	long result, ret;
+	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	ret = strict_strtol(buf, 10, &result);
-
-	priv->btmrvl_dev.hsmode = result;
-
+	ret = kstrtou8(buf, 10, &priv->btmrvl_dev.hsmode);
+	if (ret < 0)
+		return ret;
 	return count;
 }
 
-- 
1.7.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ