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]
Date:   Wed, 15 Mar 2023 09:38:40 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Vinod Koul <vkoul@...nel.org>,
        Bard Liao <yung-chuan.liao@...ux.intel.com>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        bard.liao@...el.com
Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs



On 3/15/23 05:09, Vinod Koul wrote:
> On 09-03-23, 13:49, Bard Liao wrote:
>> From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
>>
>> There are a couple of duplicate logs which makes harder than needed to
>> follow the error flows. Add __func__ or make the log unique.
>>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
>> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
>> Signed-off-by: Bard Liao <yung-chuan.liao@...ux.intel.com>
>> ---
>>  drivers/soundwire/stream.c | 18 ++++++++++--------
>>  1 file changed, 10 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
>> index 2e39587ed1de..dd09855caac9 100644
>> --- a/drivers/soundwire/stream.c
>> +++ b/drivers/soundwire/stream.c
>> @@ -1389,7 +1389,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
>>  
>>  	ret = do_bank_switch(stream);
>>  	if (ret < 0) {
>> -		dev_err(bus->dev, "Bank switch failed: %d\n", ret);
>> +		pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
> 
> why make it pr_ and loose the dev name? There is a trick to emit
> function for dev_err too using dynamic debug

a stream can be cased on multiple managers/buses.

It's incorrect to use bus->dev in this case, see all other error cases
in stream.c, they all use pr_err already for the same reason. bus->dev
is only valid when dealing with a single bus, typically in loops in that
file.

That said we could have split the two changes where dev_err() is changed
as pr_err() for clarity.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ