Hi Stéphane, On Tue, Dec 22, 2009 at 07:00:49PM +0100, Stéphane Chatty wrote: > Hi Dmitry, > > I am working on the 3M driver and taking your comments into account (and > applying them to the Stantum driver as well) but I have an question on > the comment below: > >> >>> +struct mmm_finger { >>> + __s32 x, y; >>> + __u8 rank; >>> + int touch:1, valid:1; >>> +}; >> >> Does it make sense to turn access to touch and valid into >> read-modify-write sequence? Just change them to be 'bool's, it won't >> cause your structures to grow in size. >> >>> +struct mmm_data { >>> + struct mmm_finger f[10]; >>> + __u8 curid, num; >>> + int touch:1, valid:1; >> >> Same as above. > > Why do you think a read-modify-write sequence would be better? in my > mind these were just cached values, just like x and y. I meant "read-modify-write" is worse. To modify a bitfiled the processor has to fetch data from memory (or cache if it is in cache) perform a logical operation on it, and store it back in teh memory. With boolean occupying 1 byte, on most architectures (older alphas is one exception I know of) var=true can be done by simple store, no need for "read-modify" part. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html