Thread (5 messages) flat view 5 messages, 2 authors, 2015-12-03

Re: [PATCH v3 1/1] atm: solos-pci: Replace simple_strtol by kstrtoint

From: "Charles (Chas) Williams" <3chas3@gmail.com>
Date: 2015-12-03 11:26:34
Also in: lkml

On Thu, 2015-12-03 at 09:06 +0100, LABBE Corentin wrote:
quoted hunk ↗ jump to hunk
@@ -357,11 +357,11 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
 	if (!str)
 		return -EIO;
 
-	ver = simple_strtol(str, NULL, 10);
-	if (ver < 1) {
+	err = kstrtoint(str, 10, &ver);
+	if (err || ver < 1) {
 		dev_warn(&card->dev->dev, "Unexpected status interrupt version %d\n",
 			 ver);
-		return -EIO;
+		return err;

If ver < 1 then you might return a 0 here.  Always returning -EIO is
probably just fine.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help