In message: <20100610165243.ga18...@oksana.dev.rtsoft.ru> Anton Vorontsov <cbouatmai...@gmail.com> writes: : On Thu, Jun 10, 2010 at 10:01:40AM -0600, M. Warner Losh wrote: : [...] : > But this requires extra, bogus fields in the structure : : False. The [0] field isn't bogus, it has a defined meaning. : It says: here is some amount of resouces may be allocated.
Not false: It is extra fields and extra lines of code. The fact that it is well defined doesn't make it any less bogus. But again, that's just opinion, much like your objection to the equally well defined structure it replaces is bogus. : > and creates a bogus sizeof issue. : : Creates? False. The same sizeof problem exists in Grant's : approach. sizeof(*dev) != what_we_have_allocated. Which is : isn't great, I agree. And that's exactly why I proposed a : dedicated allocation in the first place. Your solution doesn't solve the sizeof issue. Don't pretend it does. Both ways allocate a random amount of memory larger than sizeof the structure. Warner _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev