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 <[email protected]>
---
 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

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

Reply via email to