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


Groups > linux.kernel > #1562603

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

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v4 3/5] staging: fbtft: propagate error code from kstrto*()
Date 2017-01-19 12:00 +0100
Message-ID <t1iBI-uk-9@gated-at.bofh.it> (permalink)
References <t1is2-qM-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


kstrto*() functions return proper error code.

Do propogate it to the user.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/5] fbtft: make it work with DMA enabled SPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 11:50 +0100
  [PATCH v4 3/5] staging: fbtft: propagate error code from kstrto*() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 12:00 +0100
  [PATCH v4 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-19 12:30 +0100

csiph-web