public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8)
@ 2004-06-08 21:24 Pekka J Enberg
  2004-06-09  6:20 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pekka J Enberg @ 2004-06-08 21:24 UTC (permalink / raw)
  To: linux-kernel, tiwai

This patch introduces a kcalloc() and replaces ALSA magic allocator
snd_kcalloc() and snd_magic_kcalloc() with it.  I also fixed a memory
leak in the arm sa11xx driver and added a BUG() in seq_oss_synth to
catch failing allocations.

I kept the snd_magic_cast macro in place just in case someone wants to
add a generic type checking facility in the kernel and convert the users
to use it.

The patch is against 2.6.6 and was compile-tested with allyesconfig.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>

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

* Re: [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8)
  2004-06-08 21:24 [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8) Pekka J Enberg
@ 2004-06-09  6:20 ` Arjan van de Ven
  2004-06-09  7:08 ` Jaroslav Kysela
  2004-06-09  8:57 ` Takashi Iwai
  2 siblings, 0 replies; 5+ messages in thread
From: Arjan van de Ven @ 2004-06-09  6:20 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel, tiwai

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

On Tue, 2004-06-08 at 23:24, Pekka J Enberg wrote:
> This patch introduces a kcalloc() 

too bad you didn't make kcalloc an array allocator, which then could
check for multiplication overfow nicely.....

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8)
  2004-06-08 21:24 [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8) Pekka J Enberg
  2004-06-09  6:20 ` Arjan van de Ven
@ 2004-06-09  7:08 ` Jaroslav Kysela
  2004-06-09  8:57 ` Takashi Iwai
  2 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2004-06-09  7:08 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel, tiwai

On Wed, 9 Jun 2004, Pekka J Enberg wrote:

> This patch introduces a kcalloc() and replaces ALSA magic allocator
> snd_kcalloc() and snd_magic_kcalloc() with it.  I also fixed a memory
> leak in the arm sa11xx driver and added a BUG() in seq_oss_synth to
> catch failing allocations.
> 
> I kept the snd_magic_cast macro in place just in case someone wants to
> add a generic type checking facility in the kernel and convert the users
> to use it.

I suggest to Linus and Andrew to postpone applying of these patches into
mainstream. We'll integrate them (maybe in a slightly modified form - 
after discussion on the alsa-devel mailing list) to our ALSA tree at 
first. Thanks.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

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

* Re: [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8)
  2004-06-08 21:24 [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8) Pekka J Enberg
  2004-06-09  6:20 ` Arjan van de Ven
  2004-06-09  7:08 ` Jaroslav Kysela
@ 2004-06-09  8:57 ` Takashi Iwai
  2004-06-09  9:03   ` Takashi Iwai
  2 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2004-06-09  8:57 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel

At Wed, 9 Jun 2004 00:24:53 +0300,
Pekka J Enberg wrote:
> 
> This patch introduces a kcalloc() and replaces ALSA magic allocator
> snd_kcalloc() and snd_magic_kcalloc() with it.  I also fixed a memory
> leak in the arm sa11xx driver and added a BUG() in seq_oss_synth to
> catch failing allocations.
> 
> I kept the snd_magic_cast macro in place just in case someone wants to
> add a generic type checking facility in the kernel and convert the users
> to use it.
> 
> The patch is against 2.6.6 and was compile-tested with allyesconfig.

no, this patch breaks when CONFIG_SND_DEBUG=y.  the compile is ok but
it won't work, as long as you leave snd_magic_cast.


Takashi

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

* Re: [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8)
  2004-06-09  8:57 ` Takashi Iwai
@ 2004-06-09  9:03   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2004-06-09  9:03 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel

At Wed, 09 Jun 2004 10:57:45 +0200,
I wrote:
> 
> At Wed, 9 Jun 2004 00:24:53 +0300,
> Pekka J Enberg wrote:
> > 
> > This patch introduces a kcalloc() and replaces ALSA magic allocator
> > snd_kcalloc() and snd_magic_kcalloc() with it.  I also fixed a memory
> > leak in the arm sa11xx driver and added a BUG() in seq_oss_synth to
> > catch failing allocations.
> > 
> > I kept the snd_magic_cast macro in place just in case someone wants to
> > add a generic type checking facility in the kernel and convert the users
> > to use it.
> > 
> > The patch is against 2.6.6 and was compile-tested with allyesconfig.
> 
> no, this patch breaks when CONFIG_SND_DEBUG=y.  the compile is ok but
> it won't work, as long as you leave snd_magic_cast.

sorry, i overlooked the patch 8/8.

but i don't see no reason to leave only snd_magic_cast.
if there is no cast checking facility, we should remove them all.


Takashi

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

end of thread, other threads:[~2004-06-09  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-08 21:24 [RFC][PATCH] ALSA: Remove subsystem-specific malloc (0/8) Pekka J Enberg
2004-06-09  6:20 ` Arjan van de Ven
2004-06-09  7:08 ` Jaroslav Kysela
2004-06-09  8:57 ` Takashi Iwai
2004-06-09  9:03   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox