From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
bard.liao@intel.com
Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs
Date: Wed, 15 Mar 2023 09:38:40 -0500 [thread overview]
Message-ID: <c40192e9-6207-3204-819f-abbabc320c38@linux.intel.com> (raw)
In-Reply-To: <ZBGZR2ACa8AbNmvy@matsya>
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@linux.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@linux.intel.com>
>> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
>> Signed-off-by: Bard Liao <yung-chuan.liao@linux.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.
next prev parent reply other threads:[~2023-03-15 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 5:49 [PATCH] soundwire: stream: uniquify dev_err() logs Bard Liao
2023-03-15 10:09 ` Vinod Koul
2023-03-15 14:38 ` Pierre-Louis Bossart [this message]
2023-03-17 13:37 ` Vinod Koul
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=c40192e9-6207-3204-819f-abbabc320c38@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.