mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] regmap: debugfs: remove bogus check
@ 2015-09-28 22:29 Rasmus Villemoes
  2015-09-28 22:29 ` [PATCH 2/2] regmap: debugfs: improve regmap_reg_ranges_read_file() Rasmus Villemoes
  2015-09-29 18:14 ` [PATCH 1/2] regmap: debugfs: remove bogus check Mark Brown
  0 siblings, 2 replies; 13+ messages in thread
From: Rasmus Villemoes @ 2015-09-28 22:29 UTC (permalink / raw)
  To: Mark Brown, Greg Kroah-Hartman; +Cc: Rasmus Villemoes, linux-kernel

snprintf cannot return a negative value (unless map->dev->driver->name
happens to be over 2G long). So remove the bogus check.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/base/regmap/regmap-debugfs.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 4a4737887cce..9fb3f6fc26b0 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -48,10 +48,6 @@ static ssize_t regmap_name_read_file(struct file *file,
 		return -ENOMEM;
 
 	ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
-	if (ret < 0) {
-		kfree(buf);
-		return ret;
-	}
 
 	ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
 	kfree(buf);
-- 
2.1.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-30 18:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 22:29 [PATCH 1/2] regmap: debugfs: remove bogus check Rasmus Villemoes
2015-09-28 22:29 ` [PATCH 2/2] regmap: debugfs: improve regmap_reg_ranges_read_file() Rasmus Villemoes
2015-09-29 18:30   ` Mark Brown
2015-09-30  9:51     ` Rasmus Villemoes
2015-09-30 17:18       ` Mark Brown
2015-09-30 18:30   ` [PATCH v2 1/3] regmap: debugfs: use snprintf return value in regmap_reg_ranges_read_file() Rasmus Villemoes
2015-09-30 18:30     ` [PATCH v2 2/3] regmap: debugfs: use memcpy instead of snprintf Rasmus Villemoes
2015-09-30 18:30     ` [PATCH v2 3/3] regmap: debugfs: simplify regmap_reg_ranges_read_file() slightly Rasmus Villemoes
2015-09-29 18:14 ` [PATCH 1/2] regmap: debugfs: remove bogus check Mark Brown
2015-09-30  7:27   ` Rasmus Villemoes
2015-09-30 17:20     ` Mark Brown
2015-09-30 17:52       ` Rasmus Villemoes
2015-09-30 18:14         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®