Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Subasri S <subasris1210@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Use %pe to print error pointers
Date: Mon, 13 Jul 2026 12:09:46 +0300	[thread overview]
Message-ID: <alSrWr8kdg7BVHzs@kuha> (raw)
In-Reply-To: <20260709-subasri-usb-ucsi-v1-v1-1-74bed201e489@gmail.com>

On Thu, Jul 09, 2026 at 08:13:33AM +0530, Subasri S wrote:
> Use the %pe format specifier instead of %ld with PTR_ERR() for printing
> error pointers in ucsi_register_plug(), ucsi_register_cable(), and
> ucsi_register_partner(). This prints symbolic error names (e.g.
> -ENOMEM) instead of errno numbers (e.g. -12), making debug logs more
> readable.
> 
> This patch fixes coccinelle reported warnings:
> ./typec/ucsi/ucsi.c:1026:3-10: WARNING: Consider using %pe to print PTR_ERR()
> ./typec/ucsi/ucsi.c:1156:3-10: WARNING: Consider using %pe to print PTR_ERR()
> ./typec/ucsi/ucsi.c:967:3-10: WARNING: Consider using %pe to print PTR_ERR()
> 
> Signed-off-by: Subasri S <subasris1210@gmail.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 92166a3725b1..bf896e5cefc3 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -963,8 +963,8 @@ static int ucsi_register_plug(struct ucsi_connector *con)
>  	plug = typec_register_plug(con->cable, &desc);
>  	if (IS_ERR(plug)) {
>  		dev_err(con->ucsi->dev,
> -			"con%d: failed to register plug (%ld)\n", con->num,
> -			PTR_ERR(plug));
> +			"con%d: failed to register plug (%pe)\n", con->num,
> +			plug);
>  		return PTR_ERR(plug);
>  	}
>  
> @@ -1022,8 +1022,8 @@ static int ucsi_register_cable(struct ucsi_connector *con)
>  	cable = typec_register_cable(con->port, &desc);
>  	if (IS_ERR(cable)) {
>  		dev_err(con->ucsi->dev,
> -			"con%d: failed to register cable (%ld)\n", con->num,
> -			PTR_ERR(cable));
> +			"con%d: failed to register cable (%pe)\n", con->num,
> +			cable);
>  		return PTR_ERR(cable);
>  	}
>  
> @@ -1152,8 +1152,8 @@ static int ucsi_register_partner(struct ucsi_connector *con)
>  	partner = typec_register_partner(con->port, &desc);
>  	if (IS_ERR(partner)) {
>  		dev_err(con->ucsi->dev,
> -			"con%d: failed to register partner (%ld)\n", con->num,
> -			PTR_ERR(partner));
> +			"con%d: failed to register partner (%pe)\n", con->num,
> +			partner);
>  		return PTR_ERR(partner);
>  	}
>  
> 
> ---
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> change-id: 20260708-subasri-usb-ucsi-v1-34dde97e0b61
> 
> Best regards,
> -- 
> Subasri S <subasris1210@gmail.com>

-- 
heikki

      reply	other threads:[~2026-07-13  9:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  2:43 [PATCH] usb: typec: ucsi: Use %pe to print error pointers Subasri S
2026-07-13  9:09 ` Heikki Krogerus [this message]

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=alSrWr8kdg7BVHzs@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=subasris1210@gmail.com \
    /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