Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 16:34 +0200, Takashi Iwai wrote: > Also, another expected problem is that neither card->card_dev nor > card->dev are set when snd_card_err() is called. Many drivers set the > device pointers at the late stage just before the device > registration. So, systematic

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 11:33:44 -0400 (EDT), Alan Stern wrote: > > On Fri, 31 May 2013, Takashi Iwai wrote: > > > > struct snd_card contains pointers to two different devices: dev and > > > card_dev. Some contexts might want to use one of them for log messages > > > while other contexts might

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Alan Stern
On Fri, 31 May 2013, Takashi Iwai wrote: > > struct snd_card contains pointers to two different devices: dev and > > card_dev. Some contexts might want to use one of them for log messages > > while other contexts might want to use the other. > > Yes, there are some corner cases, indeed. > >

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 10:24:51 -0400 (EDT), Alan Stern wrote: > > On Fri, 31 May 2013, Takashi Iwai wrote: > > > > I don't see the complexity/hell in adding functions > > > for specific types of struct * to reduce the complexity > > > of the code though. Centralizing those indirections > > > into

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Alan Stern
On Fri, 31 May 2013, Takashi Iwai wrote: > > I don't see the complexity/hell in adding functions > > for specific types of struct * to reduce the complexity > > of the code though. Centralizing those indirections > > into functions also generally reduces overall code size. > > I don't mind to

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:38:01 -0700, Joe Perches wrote: > > On Fri, 2013-05-31 at 09:35 +0200, Takashi Iwai wrote: > > At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: > > > On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: > > > > At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote:

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 09:35 +0200, Takashi Iwai wrote: > At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: > > On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: > > > At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: > > > > On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: > >

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: > > On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: > > At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: > > > On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: > > > > I think most of snd_printd() and snd_printdd() can be

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: > At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: > > On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: > > > I think most of snd_printd() and snd_printdd() can be kept as is. > > > These are just debug messages, after all. > >

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: > > On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: > > It's a problem only with snd_printk(), as CONFIG_SND_VERBOSE_PRINTK > > influences on the behavior of snd_printk() and not on the debug prints > > with snd_printd() & co. > > Are

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: > It's a problem only with snd_printk(), as CONFIG_SND_VERBOSE_PRINTK > influences on the behavior of snd_printk() and not on the debug prints > with snd_printd() & co. Are you're perhaps confused about how CONFIG_SND_VERBOSE_PRINTK works

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Thu, 30 May 2013 20:49:09 +0200, Jaroslav Kysela wrote: > > Date 30.5.2013 20:14, Alan Stern wrote: > > On Wed, 29 May 2013, Joe Perches wrote: > > > >> On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: > >>> Has there been any thought of improving snd_printk(), or even better, > >>>

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Thu, 30 May 2013 20:49:09 +0200, Jaroslav Kysela wrote: Date 30.5.2013 20:14, Alan Stern wrote: On Wed, 29 May 2013, Joe Perches wrote: On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: Has there been any thought of improving snd_printk(), or even better, changing the call

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: It's a problem only with snd_printk(), as CONFIG_SND_VERBOSE_PRINTK influences on the behavior of snd_printk() and not on the debug prints with snd_printd() co. Are you're perhaps confused about how CONFIG_SND_VERBOSE_PRINTK works with or

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: It's a problem only with snd_printk(), as CONFIG_SND_VERBOSE_PRINTK influences on the behavior of snd_printk() and not on the debug prints with snd_printd() co. Are you're

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: I think most of snd_printd() and snd_printdd() can be kept as is. These are just debug messages, after all. Some of those

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: I think most of snd_printd() and snd_printdd() can be kept as is.

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 09:35 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 08:37 +0200, Takashi Iwai wrote: I think

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 00:38:01 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 09:35 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:30:09 -0700, Joe Perches wrote: On Fri, 2013-05-31 at 09:23 +0200, Takashi Iwai wrote: At Fri, 31 May 2013 00:06:07 -0700, Joe Perches wrote: On

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Alan Stern
On Fri, 31 May 2013, Takashi Iwai wrote: I don't see the complexity/hell in adding functions for specific types of struct * to reduce the complexity of the code though. Centralizing those indirections into functions also generally reduces overall code size. I don't mind to add the

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 10:24:51 -0400 (EDT), Alan Stern wrote: On Fri, 31 May 2013, Takashi Iwai wrote: I don't see the complexity/hell in adding functions for specific types of struct * to reduce the complexity of the code though. Centralizing those indirections into functions also

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Alan Stern
On Fri, 31 May 2013, Takashi Iwai wrote: struct snd_card contains pointers to two different devices: dev and card_dev. Some contexts might want to use one of them for log messages while other contexts might want to use the other. Yes, there are some corner cases, indeed. Also,

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Takashi Iwai
At Fri, 31 May 2013 11:33:44 -0400 (EDT), Alan Stern wrote: On Fri, 31 May 2013, Takashi Iwai wrote: struct snd_card contains pointers to two different devices: dev and card_dev. Some contexts might want to use one of them for log messages while other contexts might want to use

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-31 Thread Joe Perches
On Fri, 2013-05-31 at 16:34 +0200, Takashi Iwai wrote: Also, another expected problem is that neither card-card_dev nor card-dev are set when snd_card_err() is called. Many drivers set the device pointers at the late stage just before the device registration. So, systematic replacements

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Joe Perches
On Thu, 2013-05-30 at 15:43 -0400, Alan Stern wrote: > On Thu, 30 May 2013, Jaroslav Kysela wrote: > > > Date 30.5.2013 20:14, Alan Stern wrote: > > > On Wed, 29 May 2013, Joe Perches wrote: > > > > > >> On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: > > >>> Has there been any thought of

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Alan Stern
On Thu, 30 May 2013, Jaroslav Kysela wrote: > Date 30.5.2013 20:14, Alan Stern wrote: > > On Wed, 29 May 2013, Joe Perches wrote: > > > >> On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: > >>> Has there been any thought of improving snd_printk(), or even better, > >>> changing the call

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Jaroslav Kysela
Date 30.5.2013 20:14, Alan Stern wrote: > On Wed, 29 May 2013, Joe Perches wrote: > >> On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: >>> Has there been any thought of improving snd_printk(), or even better, >>> changing the call sites to use the dev_*() routines instead? >> >> Perhaps

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Jaroslav Kysela
Date 30.5.2013 20:14, Alan Stern wrote: On Wed, 29 May 2013, Joe Perches wrote: On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: Has there been any thought of improving snd_printk(), or even better, changing the call sites to use the dev_*() routines instead? Perhaps better would be to

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Alan Stern
On Thu, 30 May 2013, Jaroslav Kysela wrote: Date 30.5.2013 20:14, Alan Stern wrote: On Wed, 29 May 2013, Joe Perches wrote: On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: Has there been any thought of improving snd_printk(), or even better, changing the call sites to use the

Re: [alsa-devel] Improving or replacing snd_printk()

2013-05-30 Thread Joe Perches
On Thu, 2013-05-30 at 15:43 -0400, Alan Stern wrote: On Thu, 30 May 2013, Jaroslav Kysela wrote: Date 30.5.2013 20:14, Alan Stern wrote: On Wed, 29 May 2013, Joe Perches wrote: On Wed, 2013-05-29 at 15:27 -0400, Alan Stern wrote: Has there been any thought of improving