kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* bcm2835-audio: logging mechanism
@ 2017-03-07 23:52 Robin Krahl
  2017-03-08  4:58 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Krahl @ 2017-03-07 23:52 UTC (permalink / raw)
  To: kernelnewbies

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 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bcm2835-audio: logging mechanism
  2017-03-07 23:52 bcm2835-audio: logging mechanism Robin Krahl
@ 2017-03-08  4:58 ` Greg KH
  2017-03-08  8:16   ` Robin Krahl
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2017-03-08  4:58 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Mar 08, 2017 at 12:52:38AM +0100, Robin Krahl wrote:
> So my question is:  Does it make sense to replace the audio_* and LOG_*
> macros with the standard dev_* functions?

Yes.

> And is it okay to remove log messages like "IN" and "OUT" that are
> only used to track function entries and exits?

Yes please!

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bcm2835-audio: logging mechanism
  2017-03-08  4:58 ` Greg KH
@ 2017-03-08  8:16   ` Robin Krahl
  0 siblings, 0 replies; 3+ messages in thread
From: Robin Krahl @ 2017-03-08  8:16 UTC (permalink / raw)
  To: kernelnewbies

On 2017-03-08 05:58:35, Greg KH wrote:
> On Wed, Mar 08, 2017 at 12:52:38AM +0100, Robin Krahl wrote:
> > So my question is:  Does it make sense to replace the audio_* and LOG_*
> > macros with the standard dev_* functions?
> 
> Yes.
> 
> > And is it okay to remove log messages like "IN" and "OUT" that are
> > only used to track function entries and exits?
> 
> Yes please!

Thanks!  I?ll prepare a patch.

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/fa187f17/attachment.bin 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-08  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07 23:52 bcm2835-audio: logging mechanism Robin Krahl
2017-03-08  4:58 ` Greg KH
2017-03-08  8:16   ` Robin Krahl

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).