On Fri, Jul 01, 2016 at 05:17:11PM +0200, Arnd Bergmann wrote: > On Friday, July 1, 2016 3:52:44 PM CEST Liviu Dudau wrote: > > > > > > > > or do you mean we should have extra alignment in there so the > > > private pointer has a minimum alignment higher than the > > > alignment of struct pci_host_bridge? > > > > but this ^. bridge pointer arithmetic means +1 is not necessarily +sizeof(struct pci_host_bridge) > > bytes. AFAIK that can be rounded to the nearest natural alignment for pointers on that > > architecture. > > No, that's not how it works. Really? If struct foo takes 31 bytes, and struct foo *p = (struct foo*)64, what's p's value after p++ ? 95? I thought the compiler is allowed to consider the structure padded so that p++ is 96. > > > > I'm absolutely fine with any of those suggestions, whichever > > > makes the nicest API. > > > > Does anyone need to subclass the pci_host_bridge structure? And is appending data right > > after the structure useful? > > I was basically following the way alloc_etherdev() and a lot of other > subsystems handle it. Probably valid if casted to char* ? Liviu > > Arnd > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html