Re: linux-next: suspend tree build warnings

From: Patrick Boettcher
Date: Thu Aug 20 2009 - 03:35:26 EST


Hi,

On Wed, 19 Aug 2009, Andy Walls wrote:
Ick. struct device should _never_ be on the stack, why would this code
want to do such a thing?

When you are doing a thing it does not necessarily you know that you're doing it.

It appears that the state object is a dummy being used to detect and
twiddle some identical chips on the i2c bus. The functions called only
use the "i2c_adapter" and "cfg" member of the dummy state object, but
those functions want that state object as an input argument.

<obvious>
The simplest fix is dynamic allocation of the dummy state object with
kmalloc() and then to free it before exiting the function.
</obvious>

Even more obvious: Fix the function with simpler code to do the same thing.

I will try to fetch some time from somewhere to work on it.

--

Patrick http://www.kernellabs.com/
--
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/