Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6812507pxb; Wed, 17 Feb 2021 14:19:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrtuAy9ZF3eQJYf6WkTDIV09RkUJLcye5D48fPv5BUvlGltkAe3bw4cfbOSoKc17eMHkYg X-Received: by 2002:aa7:d6d7:: with SMTP id x23mr954365edr.73.1613600379293; Wed, 17 Feb 2021 14:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613600379; cv=none; d=google.com; s=arc-20160816; b=08xjJL/h60C/dV5KW+QJMCFCol56nMBhnWxQ+vY5cuPArvgAFMdmYQ5qnG1DmYP5aM bPsn2HjQyMzIriMBH52p/fSFDHQ1HgspDIucVfxUHRConKG4G1rbPK4y3JD9xgc9xZHO RjQE1ymUh8YmKgcjAEFOTUxBe3lyP3R/u3+53s5sMCgfyh6135u9da+lvt8ktDE7tfob f9H67I5wDjyNHh5mYT8OuIsipees//vY7lrKfC+hdIUh7ilgr+pJfOi/KE+jSiVxdRtE WGRgRcwVH+2ZlpBeS0lNIPiaHTNKaWTc41BXXk+eNuBIYcUeR7yCSRlERShTjqdhbA3W L00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Umkkn1s1heqSfUE9bVr0PbKoq2Y4J9beIKh4Qxtjpc=; b=d5h2KqLvZP5YmMaU+fSP7ZfSuurI1xkuJ9g15XiHNeFHXYM9cN5u9Kux8hpbQdRxOP SU+LPBoeBX2Sdeu7RJ6SjIj/qJskEEdaJbWJuK9axU++EQKr0lnMyG6QZFMVSUCTIqZG 2lv5i47Ly/hqDsCjmlcKa7aPpn7ZU0icE6rL72gIolKpPKt4cNWkQLAAhCu/l2J8Capb ZRU5hdo7p/l11Yz3mkVwfpq9i/X6+Ya4lGLT4av/wXw43V09qaYxoIak1WETpK1n3yIk YN42rNJW+aIAlIJXSiudBekPt0uLkVA1dhtOVHcFsGY+Z88zN0QhiUheTAPkQWECxNRB qpBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PHxaH8e7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si2253330edy.244.2021.02.17.14.19.16; Wed, 17 Feb 2021 14:19:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PHxaH8e7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234548AbhBQRjd (ORCPT + 99 others); Wed, 17 Feb 2021 12:39:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53159 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234477AbhBQRdz (ORCPT ); Wed, 17 Feb 2021 12:33:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613583149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Umkkn1s1heqSfUE9bVr0PbKoq2Y4J9beIKh4Qxtjpc=; b=PHxaH8e7HvD98+H8MIqVGZjoV4dppJNf+tuIvELpksjWJloU3g4tGNfbb/yfE4O7IT9CqE +jxI6OKCBLYTi2hnfFifBbsWn1TNR6ImyP6MDXEe1mK0tHVtgvRa2OsvFxFz+VvOdKSEZr SEJ7WSWTAx4f06w959+MeKpXz2v5ZU4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-hK0Mxl0YOCSg5UbiiPDWOA-1; Wed, 17 Feb 2021 12:32:27 -0500 X-MC-Unique: hK0Mxl0YOCSg5UbiiPDWOA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C91F91020C21; Wed, 17 Feb 2021 17:32:25 +0000 (UTC) Received: from plouf.redhat.com (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23DCD60C62; Wed, 17 Feb 2021 17:32:23 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Roderick Colenbrander , =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Cc: linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 08/11] HID: playstation: fix unused variable in ps_battery_get_property. Date: Wed, 17 Feb 2021 18:31:55 +0100 Message-Id: <20210217173158.3122868-9-benjamin.tissoires@redhat.com> In-Reply-To: <20210217173158.3122868-1-benjamin.tissoires@redhat.com> References: <20210217173158.3122868-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roderick Colenbrander 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 --- drivers/hid/hid-playstation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 84f484fce1ee..f279064e74a5 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) -- 2.29.2