Re: Newbie idiotic questions.

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Sat Jun 16 2001 - 20:32:50 EST


Bill Pringlemeir wrote:
> [main.c, line 175]
>
> for (count = 0; count < sizeof(card->digmix) / sizeof(card->digmix[0]); count++) {
>
> Isn't there some sort of `ALEN' macro available, or is this
> considered to muddy things by using a macro?

Yes, we have array size

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

because then you would be allocating the size of a pointer, not the size
of a structure

> Why aren't all the gobs of constant data in this driver declared as
> constant? Do it give a performance advantage by having the data in a
> different MMU section and better cache effects or something?

Marking data const is usually a good idea.

        Jeff

-- 
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |
-
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/



This archive was generated by hypermail 2b29 : Sat Jun 23 2001 - 21:00:16 EST