[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025042306-ripping-dental-fc37@gregkh>
Date: Wed, 23 Apr 2025 18:56:19 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Zijun Hu <zijun_hu@...oud.com>
Cc: Rob Herring <robh@...nel.org>, Jiri Slaby <jirislaby@...nel.org>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH] serdev: Get serdev controller's name by dev_name()
On Wed, Apr 23, 2025 at 11:07:03PM +0800, Zijun Hu wrote:
> 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));
Then those should also be fixed.
Powered by blists - more mailing lists