lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2130b658-0c7a-497a-99b4-d3a5c4ecd8eb@icloud.com>
Date: Wed, 23 Apr 2025 23:07:03 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
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 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));


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ