time: Fix signedness bug in sysfs_get_uname() and its callers
sysfs_get_uname() is erroneously declared as returning size_t even though it may return a negative value, specifically -EINVAL. Its callers then check whether its return value is less than zero and indeed that is never the case for size_t. This patch changes sysfs_get_uname() to return ssize_t and makes sure its callers use ssize_t accordingly. Signed-off-by: Patrick Palka <patrick@parcs.ath.cx> [jstultz: Didn't apply cleanly, as a similar partial fix was also applied so had to resolve the collisions] Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:

committed by
John Stultz

parent
b7bc50e451
commit
891292a767
@@ -909,7 +909,7 @@ sysfs_show_current_clocksources(struct device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
|
||||
ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
|
||||
{
|
||||
size_t ret = cnt;
|
||||
|
||||
|
Reference in New Issue
Block a user