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


Groups > linux.kernel > #1550080 > unrolled thread

[PATCH v3 3/5] staging: fbtft: propagate error code from kstrto*()

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-01-03 19:40 +0100
Last post2017-01-03 19:40 +0100
Articles 1 — 1 participant

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 v3 3/5] staging: fbtft: propagate error code from kstrto*() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-03 19:40 +0100

#1550080 — [PATCH v3 3/5] staging: fbtft: propagate error code from kstrto*()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-01-03 19:40 +0100
Subject[PATCH v3 3/5] staging: fbtft: propagate error code from kstrto*()
Message-ID<sVCa7-1SP-43@gated-at.bofh.it>
kstrto*() functions return proper error code.

Do propogate it to the user.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/staging/fbtft/fbtft-sysfs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 8d8bd12b90a1..5922f1b6d8d6 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -4,7 +4,6 @@
 static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
 {
 	char *p_val;
-	int ret;
 
 	if (!str_p || !(*str_p))
 		return -EINVAL;
@@ -14,11 +13,7 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
 	if (!p_val)
 		return -EINVAL;
 
-	ret = kstrtoul(p_val, base, val);
-	if (ret)
-		return -EINVAL;
-
-	return 0;
+	return kstrtoul(p_val, base, val);
 }
 
 int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves,
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web