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-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3847d15b41ce43a0c2beb3251ca43a2119b865df;p=users%2Fjedix%2Flinux-maple.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 cc93c16cc8222..408b651174cf4 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -391,7 +391,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; @@ -416,7 +416,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)