kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: robin.krahl@ireas.org (Robin Krahl)
To: kernelnewbies@lists.kernelnewbies.org
Subject: bcm2835-audio: logging mechanism
Date: Wed, 8 Mar 2017 00:52:38 +0100	[thread overview]
Message-ID: <20170307235238.GA29696@spectator> (raw)

Hi there,

the TODO file for drivers/staging/vc04_services/bcm2835-audio contains
the following item:

> 4) Cleanup the logging mechanism.  The driver should probably be using
> the standard kernel logging mechanisms such as dev_info, dev_dbg, and
> friends.

Currently there are macros audio_debug, audio_warning, LOG_DBG, LOG_WARN
etc. that call pr_* and use the function name and the line number as a
prefix for the logged message.  Refactoring this driver to use the dev_*
methods would remove this additional information, and would also lead to
some clutter as the driver structure is not directly accessible in most
of the functions, for example
	dev_dbg(alsa_stream->chip->card->dev, "...
instead of
	audio_debug("...

Furthermore, the driver currently uses "IN" and "OUT" debug messages at
the beginning and at the end of some functions, for example
snd_bcm2835_ctl_info in bcm2835-ctl.c.  This is useless if the function
name is not included in the log message.  But on the other hand, I?m not
sure whether it is desirable to have this kind of messages in the kernel
code at all.

So my question is:  Does it make sense to replace the audio_* and LOG_*
macros with the standard dev_* functions?  And is it okay to remove log
messages like "IN" and "OUT" that are only used to track function entries
and exits?

Regards,
Robin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170308/430772fc/attachment.bin 

             reply	other threads:[~2017-03-07 23:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 23:52 Robin Krahl [this message]
2017-03-08  4:58 ` bcm2835-audio: logging mechanism Greg KH
2017-03-08  8:16   ` Robin Krahl

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=20170307235238.GA29696@spectator \
    --to=robin.krahl@ireas.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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;
as well as URLs for NNTP newsgroup(s).