Re: [PATCH 1/2] regmap: debugfs: remove bogus check

From: Mark Brown
Date: Tue Sep 29 2015 - 14:15:13 EST


On Tue, Sep 29, 2015 at 12:29:01AM +0200, Rasmus Villemoes wrote:
> snprintf cannot return a negative value (unless map->dev->driver->name
> happens to be over 2G long). So remove the bogus check.

> ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
> - if (ret < 0) {
> - kfree(buf);
> - return ret;
> - }

It's hard to see a great value in removing error checking, even error
checking that's currently unlikely to ever trigger...

Attachment: signature.asc
Description: Digital signature