Re: Newbie idiotic questions.

Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Sun, 17 Jun 2001 00:01:05 -0300


Em Sat, Jun 16, 2001 at 09:35:34PM -0400, Richard B. Johnson escreveu:
> > [main.c, line 223]
> > if ((card->mpuout = kmalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL))
> >
> > Why is the struct type referenced for the allocation size? Why not,
> >
> > if ((card->mpuout = kmalloc(sizeof(card->mpuout), GFP_KERNEL))
> >
> > This seems to get the size for the actual object being allocated.
> >
>
> Again, you are correct. However, you may not know the history of the
> driver. Perhaps at one time the above statement was correct.

yes, and in fact this should be one of the entries in the kernel Janitor's
TODO list, please take a look at http://bazar.conectiva.com.br/~acme/TODO
and consider submitting some more things to cleanup so that people wanting
to start hacking the kernel can have some easy starting points. Also please
consider reading http://kernel-janitor.sourceforge.net

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/