The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: linmq006@gmail.com, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe
Date: Wed, 22 Dec 2021 10:31:51 +0100	[thread overview]
Message-ID: <YcLwh06Z/1hBG6IY@kroah.com> (raw)
In-Reply-To: <20211222091444.5034-1-linmq006@gmail.com>

[note, you got the to: line incorrect...]

On Wed, Dec 22, 2021 at 09:14:44AM +0000, Miaoqian Lin wrote:
> Since the acpi_create_platform_device() function may return error
> pointers, dwc3_qcom_create_urs_usb_platdev() function may return errors
> too. Using IS_ERR_OR_NULL() to check the return value to fix this.
> 
> Fixes: c25c210f590e("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot")

Nit, the documentation says this should be:
Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot")


> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 3cb01cdd02c2..df27d903ba98 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -769,9 +769,9 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  
>  		if (qcom->acpi_pdata->is_urs) {
>  			qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev);
> -			if (!qcom->urs_usb) {
> +			if (IS_ERR_OR_NULL(qcom->urs_usb)) {
>  				dev_err(dev, "failed to create URS USB platdev\n");
> -				return -ENODEV;
> +				return qcom->urs_usb ? PTR_ERR(qcom->urs_usb) : -ENODEV;

Please no ? : if at all possible.  Spell it out as a real if statement.

thanks,

greg k-h

  reply	other threads:[~2021-12-22  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  9:14 [PATCH] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe Miaoqian Lin
2021-12-22  9:31 ` Greg Kroah-Hartman [this message]
2021-12-22 10:47   ` [PATCH v2] " Miaoqian Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YcLwh06Z/1hBG6IY@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linmq006@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox