From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: alsa-devel@alsa-project.org, vinod.koul@linaro.org,
tiwai@suse.de, linux-kernel@vger.kernel.org, vkoul@kernel.org,
broonie@kernel.org, srinivas.kandagatla@linaro.org,
sanyog.r.kale@intel.com,
Bard Liao <yung-chuan.liao@linux.intel.com>,
bard.liao@intel.com
Subject: Re: [PATCH 1/2] soundwire: intel: uniquify debug message
Date: Mon, 13 Jun 2022 14:21:31 -0500 [thread overview]
Message-ID: <15ef4ec4-14ae-27fc-919d-b0933454455f@linux.intel.com> (raw)
In-Reply-To: <YqdyErIYYk85NV41@kroah.com>
>>>>>> @@ -1549,8 +1549,8 @@ static int __maybe_unused intel_pm_prepare(struct device *dev)
>>>>>> int ret;
>>>>>>
>>>>>> if (bus->prop.hw_disabled || !sdw->startup_done) {
>>>>>> - dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
>>>>>> - bus->link_id);
>>>>>> + dev_dbg(dev, "%s: SoundWire master %d is disabled or not-started, ignoring\n",
>>>>>> + __func__, bus->link_id);
>>>>>
>>>>> Not needed, it is provided automatically if you ask the kernel for this.
>>>>> Same for all other instances in this patch.
>>>>
>>>> provided how? Your comment is a bit cryptic here.
>>>
>>> the dynamic debug code in the kernel already adds the function name
>>> where the message was sent from, if you want to know this in userspace.
>>> Please read the documentation for details (I think the key is the 'f'
>>> flag to be enabled in userspace).
>>>
>>> So adding __func__ to dev_dbg() calls are redundant and never needed.
>>
>> Oh wow, I had no idea - and I am not the only one :-)
>>
>> Here's what I get with a grep on the kernel code
>>
>> git grep __func__ | grep dev_dbg | wc -l
>>
>> 3122
>>
>>
>> Doing this for sound/ gives me 356, and that's for single-line logs only.
>>
>> There's clearly something that was missed by tons of people.
>
> Yes, it's not commonly known so cleanups are always welcome. Perhaps
> some of those usages predate the feature being added as well.
Yep, looks like no one in our team knew about this. We've changed our
scripts and I started cleaning this up, changes will be posted upstream
soon.
https://github.com/thesofproject/linux/pull/3695
This patch will be reverted in our tree, completely unnecessary indeed.
next prev parent reply other threads:[~2022-06-13 20:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 2:35 [PATCH 0/2] soundwire: Intel: add trigger callback Bard Liao
2022-06-10 2:35 ` [PATCH 1/2] soundwire: intel: uniquify debug message Bard Liao
2022-06-10 5:25 ` Greg KH
2022-06-10 15:06 ` Pierre-Louis Bossart
2022-06-11 7:20 ` Greg KH
2022-06-13 12:48 ` Pierre-Louis Bossart
2022-06-13 17:21 ` Greg KH
2022-06-13 19:21 ` Pierre-Louis Bossart [this message]
2022-06-10 2:35 ` [PATCH 2/2] soundwire: Intel: add trigger callback Bard Liao
2022-06-10 5:26 ` Greg KH
2022-06-10 14:53 ` Pierre-Louis Bossart
2022-06-14 7:13 ` Liao, Bard
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=15ef4ec4-14ae-27fc-919d-b0933454455f@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.de \
--cc=vinod.koul@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox