Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1276116 > unrolled thread

[PATCH v4] i2c: taos-evm: replace simple_strtoul by kstrtou8

Started byLABBE Corentin <clabbe.montjoie@gmail.com>
First post2015-11-24 08:50 +0100
Last post2015-11-30 15:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4] i2c: taos-evm: replace simple_strtoul by kstrtou8 LABBE Corentin <clabbe.montjoie@gmail.com> - 2015-11-24 08:50 +0100
    Re: [PATCH v4] i2c: taos-evm: replace simple_strtoul by kstrtou8 Wolfram Sang <wsa@the-dreams.de> - 2015-11-30 15:00 +0100

#1276116 — [PATCH v4] i2c: taos-evm: replace simple_strtoul by kstrtou8

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2015-11-24 08:50 +0100
Subject[PATCH v4] i2c: taos-evm: replace simple_strtoul by kstrtou8
Message-ID<qygwq-58x-7@gated-at.bofh.it>
The simple_strtoul function is marked as obsolete.
This patch replace it by kstrtou8.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/i2c/busses/i2c-taos-evm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c
index 4c7fc2d..210ca82 100644
--- a/drivers/i2c/busses/i2c-taos-evm.c
+++ b/drivers/i2c/busses/i2c-taos-evm.c
@@ -130,7 +130,13 @@ static int taos_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
 			return 0;
 	} else {
 		if (p[0] == 'x') {
-			data->byte = simple_strtol(p + 1, NULL, 16);
+			/*
+			 * Voluntarily dropping error code of kstrtou8 since all
+			 * error code that it could return are invalid according
+			 * to Documentation/i2c/fault-codes.
+			 */
+			if (kstrtou8(p + 1, 16, &data->byte))
+				return -EPROTO;
 			return 0;
 		}
 	}
-- 
2.4.10

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

[toc] | [next] | [standalone]


#1279896

FromWolfram Sang <wsa@the-dreams.de>
Date2015-11-30 15:00 +0100
Message-ID<qAx9N-4lF-13@gated-at.bofh.it>
In reply to#1276116

[Multipart message — attachments visible in raw view] — view raw

On Tue, Nov 24, 2015 at 08:43:27AM +0100, LABBE Corentin wrote:
> The simple_strtoul function is marked as obsolete.
> This patch replace it by kstrtou8.
> 
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> Tested-by: Jean Delvare <jdelvare@suse.de>
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Applied to for-next, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web