From: Roderick Colenbrander Date: Fri, 12 Feb 2021 06:41:00 +0000 (-0800) Subject: HID: playstation: fix unused variable in ps_battery_get_property. X-Git-Tag: accepted/tizen/unified/20230118.172025~7762^2~2^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fb52551248f54ddc8f72bc252661468b603cfcc;p=platform%2Fkernel%2Flinux-rpi.git HID: playstation: fix unused variable in ps_battery_get_property. The ret variable in ps_battery_get_property is set in an error path, but never actually returned. Change the function to return ret. Reported-by: kernel test robot Signed-off-by: Roderick Colenbrander Signed-off-by: Benjamin Tissoires --- diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 84f484f..f279064 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -333,7 +333,7 @@ static int ps_battery_get_property(struct power_supply *psy, uint8_t battery_capacity; int battery_status; unsigned long flags; - int ret; + int ret = 0; spin_lock_irqsave(&dev->lock, flags); battery_capacity = dev->battery_capacity; @@ -358,7 +358,7 @@ static int ps_battery_get_property(struct power_supply *psy, break; } - return 0; + return ret; } static int ps_device_register_battery(struct ps_device *dev)