Re: [PATCH v2] drivers/net/usb/hso.c: prevent readinguninitialized memory

From: Steven Rostedt
Date: Thu Sep 16 2010 - 13:36:31 EST


On Thu, 2010-09-16 at 18:47 +0100, Alan Cox wrote:

> If you want to micro-optimise it you can enumerate the cases that
> tiocmget can be NULL in that driver..

Heh, I think that's going a bit too far. Of course mico-optimizations
usually make the system go faster, but not enough to show out of the
noise, and micro-optimizations most of the time just make the code
harder to understand and more error prone.

A lot of the patches in this patch set could just do the:

struct foo bar = { 0 };

This would let gcc optimize what needs to be done, and avoids a function
call to memset.

-- Steve


--
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/