Skip to contentSkip to conversation

Clean up of ALSA kernel codes: Update

DISCUSSION Takashi Iwai 3 participants 5 messages Oct 28, 2005 – Nov 2, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

as you may have already found, I did some clean-up works for the latest version of ALSA. The following have been already merged:

- Remove vmalloc wrapper
- Remove kmalloc wrappers from kernel codes
- Remove snd_runtime_check()
- Remove snd_timestamp_*
- Put KERN_* prefix to [snd_]printk()

They will be included in 2.6.15 kernel.

The following items are still pending:

1. Clean up of PM codes

- Removal of the central suspend/resume control

Since 2.6 kernel can control the power state of each device via sysfs, it's overfluous to have a PM control function over ALSA control API. Let's remove the central PM stuff.

- Rewrite PCI drivers using direct suspend/resume callbacks

This one is easy. Can be merged to 2.6.15.

- ISA drivers

We need to rewrite the code to use platform_device for non-pnp. Since (ISA)PnP has still no suspend/resume callbacks, we may need a hack until they are properly implemented.
So this can be postponed after 2.6.15.

- Others

Rewrite with platform_device. Can be in 2.6.15.

2. Replacement of xxx_t with struct xxx

For example, "snd_card_t" will be replaced with "struct snd_card", and "snd_pcm_substream_t" will be "struct snd_pcm_substream".

For out-of-kernel drivers, the definitions of xxx_t remain for a while, but will be removed in future.

The work would be technically easy by using a script. Can be done in 2.6.15 timeline.

3. Removal of central memory allocator

Remove the allocator in memalloc.c (snd-page-alloc module). Instead, alloc_buffer and free_buffer callbacks will be added to each PCM.

But, better to wait until page-reserve-removal patch (currently on mm tree) is merged. Otherwise we would need some hacks for dma_alloc_coherent().

4. Rewrite of SG-buffer handler

Ditto, wait for the merge of page-reserve-removal patch.

====

Now, some questions reagarding 2:

A. What about names without snd_ like ac97_t?
Should it be "struct ac97" or "struct snd_ac97"?

B. The biggest question:
Does anyone have strong objection against replacement of xxx_t?

Any comments welcome.

Thanks,

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#1 lore raw
Quoted 2 lines · Takashi Iwai

A. What about names without snd_ like ac97_t?
Should it be "struct ac97" or "struct snd_ac97"?

The snd_ prefix isn't really necessary in these cases because structure tag names are in a seperate namespace and are always local to the compilation unit, so they aren't likely to conflict with other symbols.

The only reason to add snd_ would be consistency with other ALSA symbols.

BTW: Why didn't ac97_t get a snd_ prefix in the first place?

Regards,
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#2 lore raw

At Fri, 28 Oct 2005 14:10:28 +0200 (METDST),

Quoted 5 lines · Clemens Ladisch
Quoted 2 lines · Takashi Iwai

A. What about names without snd_ like ac97_t?
Should it be "struct ac97" or "struct snd_ac97"?

Quoted 7 lines

The snd_ prefix isn't really necessary in these cases because structure tag names are in a seperate namespace and are always local to the compilation unit, so they aren't likely to conflict with other symbols.

The only reason to add snd_ would be consistency with other ALSA symbols.

Yes, I think "struct ac97" is OK, too.

Quoted 1 line

BTW: Why didn't ac97_t get a snd_ prefix in the first place?

I don't remember. No strong reasons, I guess.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#3 lore raw
In reply to Takashi Iwai
Quoted 4 lines · Takashi Iwai

Now, some questions reagarding 2:

A. What about names without snd_ like ac97_t?
Should it be "struct ac97" or "struct snd_ac97"?

I would keep the namespace (naming) consistent, so I vote for the second (struct snd_ac97) variant.

Quoted 2 lines

B. The biggest question:
Does anyone have strong objection against replacement of xxx_t?

None from my side. I think that the objection/idea from kernel developers to "know the real type of variable on first glance" is a good idea.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#4 lore raw

At Tue, 1 Nov 2005 08:59:49 +0100 (CET),

Quoted 10 lines · Jaroslav
Quoted 4 lines · Takashi Iwai

Now, some questions reagarding 2:

A. What about names without snd_ like ac97_t?
Should it be "struct ac97" or "struct snd_ac97"?

I would keep the namespace (naming) consistent, so I vote for the second (struct snd_ac97) variant.

OK. Let's keep snd_ prefix for struct, too.

Takashi

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php