From: Vinod Koul <vkoul@kernel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
bard.liao@intel.com
Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs
Date: Fri, 17 Mar 2023 19:07:15 +0530 [thread overview]
Message-ID: <ZBRtCwtmFsQQ+Oo0@matsya> (raw)
In-Reply-To: <c40192e9-6207-3204-819f-abbabc320c38@linux.intel.com>
On 15-03-23, 09:38, Pierre-Louis Bossart wrote:
>
>
> 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.
Thanks, that would be better way
--
~Vinod
prev parent reply other threads:[~2023-03-17 13:37 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
2023-03-17 13:37 ` Vinod Koul [this message]
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=ZBRtCwtmFsQQ+Oo0@matsya \
--to=vkoul@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox