On Thu, 18 Oct 2007, Matthew Wilcox wrote: > > I will grab your tool and play with it. The sglist pointer shuffle > > is good, and also I know that if you put the scsi_data_buffer > > at the beginning of scsi_cmnd, than you can fill the holes with small types > > following the sub-structure. I'll give it a try. > > No, that doesn't work ;-( > > I think a macro to hide the ugliness of my earlier suggestion might fly. > Something like ... > > #define STRUCT_PACK(a, b, c, d) \ > union { a; struct { \ > char _packed_ ## __stringify(a) [sizeof(a) - sizeof(c) + sizeof(d)]; \ > b; \ > }; } > > then we use it like: > > struct scsi_cmnd { > ... > STRUCT_PACK(struct scsi_data_buffer sdb, int result, > sizeof(long), sizeof(int)); > } > > Even that's still pretty foul (and i have my grave doubts about using > stringify in that manner). It's definitely past my bedtime now ... but > a hack like that could save us another 8 bytes on x86-64. This may seem heretical, but I doubt there's much point to saving a few bytes if it's going to incur this much work and confusion. Rearranging the order of structure members is fine, it's easy, it won't bother anybody. But this sort of thing is just beyond the bounds of reason. Alan Stern - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html