lkml.org 
[lkml]   [2005]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] SMP alternatives
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-23 16:14    [from the cache]
©2003-2011 Jasper Spaans