Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rob Herring <robh@kernel.org>, Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH] serdev: Get serdev controller's name by dev_name()
Date: Wed, 23 Apr 2025 23:07:03 +0800	[thread overview]
Message-ID: <2130b658-0c7a-497a-99b4-d3a5c4ecd8eb@icloud.com> (raw)
In-Reply-To: <2025042354-imply-pointy-92e5@gregkh>

On 2025/4/23 22:35, Greg Kroah-Hartman wrote:
>> diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
>> index eb2a2e58fe78fbbdb5839232936a994bda86d0b4..971651b8e18dcbb5b7983cdfa19e7d60d4cd292b 100644
>> --- a/drivers/tty/serdev/core.c
>> +++ b/drivers/tty/serdev/core.c
>> @@ -783,8 +783,8 @@ int serdev_controller_add(struct serdev_controller *ctrl)
>>  		goto err_rpm_disable;
>>  	}
>>  
>> -	dev_dbg(&ctrl->dev, "serdev%d registered: dev:%p\n",
>> -		ctrl->nr, &ctrl->dev);
>> +	dev_dbg(&ctrl->dev, "%s registered: dev:%p\n",
>> +		dev_name(&ctrl->dev), &ctrl->dev);
> dev_dbg() already has the name in it, so why repeat it again?

i guess the author wants to print a sentence which is easy to read.

for built in name of dev_dbg(), it always happens at fixed location
and not where good sentence wants.

actually. drivers/tty/serdev/* have other such usages, for example.

dev_dbg(&serdev->dev, "device %s registered\n", dev_name(&serdev->dev));
dev_err(&serdev->dev, "Can't add %s, status
%pe\n",dev_name(&serdev->dev), ERR_PTR(err));


  reply	other threads:[~2025-04-23 15:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 14:27 [PATCH] serdev: Get serdev controller's name by dev_name() Zijun Hu
2025-04-23 14:35 ` Greg Kroah-Hartman
2025-04-23 15:07   ` Zijun Hu [this message]
2025-04-23 16:56     ` Greg Kroah-Hartman
2025-04-24 11:21       ` Zijun Hu

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=2130b658-0c7a-497a-99b4-d3a5c4ecd8eb@icloud.com \
    --to=zijun_hu@icloud.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=robh@kernel.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