Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1018791pxb; Wed, 6 Oct 2021 22:01:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwodDAXHKyS5U10cXFK0a01qsVQq/mlCELdpFoVhS+IzoaKJNCRuzX/N6YExrzo/qlaeufS X-Received: by 2002:a05:6a00:b96:b0:44c:65df:2760 with SMTP id g22-20020a056a000b9600b0044c65df2760mr2045911pfj.3.1633582911250; Wed, 06 Oct 2021 22:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633582911; cv=none; d=google.com; s=arc-20160816; b=n0HNoPt6677czpkwUKb78Doszzvgysm9EUm2+oubV6+AL4SRfK0egWmjcJBMK22Bym SzTa2CpxPEUkVqdGvs3XOTXYfH2kBg2LnN+konxK/FPwR2vVyGtoh96ktsajmU1Xg21x XGaCeHtnt1Sb08QHpzva39MbUV+Wd1utW7cdkLgH+EDHeHJ+h4O+Wo7mbE7NemftJZCU nZ3tr1C1YzsppoVKpgluSAqREouwYFM1jqthDOtkNXBufyxvD5GBi0EvipXJMfy6pjp3 K6O6lmxybI99ekSARuEmw6KTen5/t1VCnon0iqmW6c1BMVQGylzQJQHbcKYJ100vs6Rn 8U3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bl/hpSz5jcDjmTbEYwqNRmAWPBuHvZuqODkAVGf2lJE=; b=RdNowFjzK3Pjs83Kinp0uOhRt0BpuVEBXTAWv1zgJcj3iukfH6yAcnWGeCzBx3xZGb Oo81Jlo9GRFDO85f0GTdE5Yn7tUTX58xsdOiJSvdiDEAqJGuiNwrUWlG6qnb9dozzj8F a/q/BB4HIbkJNB+T3x+vWqQO1dFFFKRTRRpBl+u0EOZ5GMUvBbOVZgBcapObJcJxhML8 dGqC0VbCaJWAn4TbYdAYoqNGFh6lvVEC5sEdoxX08+jvrTav1xcGl5aP6xC3Kz2vvsyR SWnEMePWhLXjcU5+i90mMxECsabBwOIjuxnK9o29zFcOby3LuS4bPhVbmL8dJ/CKj7P1 LIGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qoDqw7MM; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si8867052pjt.37.2021.10.06.22.01.35; Wed, 06 Oct 2021 22:01:51 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=qoDqw7MM; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbhJGFCV (ORCPT + 99 others); Thu, 7 Oct 2021 01:02:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:51546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhJGFCU (ORCPT ); Thu, 7 Oct 2021 01:02:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D914A61074; Thu, 7 Oct 2021 05:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633582827; bh=EmOgN58xQNYpXS7Z2g5SK5S8ZjnjUg2XXkF+jhptwns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qoDqw7MMzyWGIynpdX93cxcLtNFc4kuwTz6Qx0bhpn47GfWo5oTbQznN+AOe8vdt9 TOV44L8AueMJXewWXwoB1WKcLLYWz2faYWli2KJw+8KB9NRLVm3CHDzNUCpdwCX1k7 UvJFFHCVi0dntCkgEAFQjdX8WW21SoZa2a9jptcnX0nM74hIzuiCAYNliak922QK65 IHRUkBhS2wb+1Ww3RP5koDU1c34Dj/qU9Zb9jiyfapM9e/S2igU3lFMzIcWrTmAq1G sYWfRiPP7DOvKorRcbkGaa3hpi13ULm00fa0IEpnlZfv0Nhd+Qt1RH4zxDggDz63ff afqMSZBlriLuw== Date: Thu, 7 Oct 2021 13:00:18 +0800 From: Peter Chen To: Manish Narani Cc: gregkh@linuxfoundation.org, michal.simek@xilinx.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, git@xilinx.com, Piyush Mehta Subject: Re: [PATCH 5/6] usb: chipidea: core: Add return value function check Message-ID: <20211007050018.GD4653@Peter> References: <1629825378-8089-1-git-send-email-manish.narani@xilinx.com> <1629825378-8089-6-git-send-email-manish.narani@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1629825378-8089-6-git-send-email-manish.narani@xilinx.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-08-24 22:46:17, Manish Narani wrote: > From: Piyush Mehta > > Add return value validation for function phy exit and phy power off. > > Addresses-Coverity: "USELESS_CALL" > Signed-off-by: Piyush Mehta > Signed-off-by: Manish Narani > --- > drivers/usb/chipidea/core.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > index 676346f..37f619e 100644 > --- a/drivers/usb/chipidea/core.c > +++ b/drivers/usb/chipidea/core.c > @@ -324,7 +324,8 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci) > > ret = phy_power_on(ci->phy); > if (ret) { > - phy_exit(ci->phy); > + if (phy_exit(ci->phy) < 0) > + dev_dbg(ci->dev, "phy exit failed\r\n"); You may not need to debug message, the phy_exit shows error message. You may return 'ret' for phy_exit for error. > return ret; > } > } else { > @@ -341,12 +342,20 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci) > */ > static void ci_usb_phy_exit(struct ci_hdrc *ci) > { > + int ret; > + > if (ci->platdata->flags & CI_HDRC_OVERRIDE_PHY_CONTROL) > return; > > if (ci->phy) { > - phy_power_off(ci->phy); > - phy_exit(ci->phy); > + ret = phy_power_off(ci->phy); > + if (ret < 0) > + dev_dbg(ci->dev, "phy poweroff failed\r\n"); > + > + ret = phy_exit(ci->phy); > + if (ret < 0) > + dev_dbg(ci->dev, "phy exit failed\r\n"); > + Ditto > } else { > usb_phy_shutdown(ci->usb_phy); > } > -- > 2.1.1 > -- Thanks, Peter Chen