Re: [patch] SMP alternatives

From: Vincent Hanquez
Date: Wed Nov 23 2005 - 10:11:48 EST


On Tue, Nov 22, 2005 at 06:48:07PM +0100, Gerd Knorr wrote:
> + smp = kmalloc(sizeof(*smp), GFP_KERNEL);
> + if (NULL == smp)
> + return; /* we'll run the (safe but slow) SMP code then ... */
> +
> + memset(smp,0,sizeof(*smp));

what about using kzalloc ?

> + if (ALT_UP == smp_alt_state)
> + goto out;

any chance to write it smp_alt_state == ALT_UP ?

IMHO, this way of writting equal condition is backward (like giving
answer before asking the question). I do know of the (pseudo-)benefit
to write it this way, but that's not worth it.

Plus, nowadays, gcc warns you about simple equal in if.

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