From: Andy Shevchenko Date: Mon, 10 Aug 2015 16:56:48 +0000 (+0300) Subject: device property: attach 'else if' to the proper 'if' X-Git-Tag: v5.15~15174^2~5^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dc59dc938f034c69dcf9080d45b936882b7ffa3;p=platform%2Fkernel%2Flinux-starfive.git device property: attach 'else if' to the proper 'if' Obviously in the current place the 'else' keyword is redundant, though it seems quite correct when we check if nval is in allowed range. Reattach the condition branch there. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 7836e2e..6d99450 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -528,13 +528,14 @@ int acpi_dev_prop_read(struct acpi_device *adev, const char *propname, if (!val) return obj->package.count; - else if (nval <= 0) - return -EINVAL; if (nval > obj->package.count) return -EOVERFLOW; + else if (nval <= 0) + return -EINVAL; items = obj->package.elements; + switch (proptype) { case DEV_PROP_U8: ret = acpi_copy_property_array_u8(items, (u8 *)val, nval);