Re: linux-next: suspend tree build warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux