> Minor question - is that not just (len + 3) >> 2 ? Yes, I'll update it in another mail. Thanks. Chao -----Original Message----- From: Alan Cox [mailto:alan@xxxxxxxxxxxxxxxxxxx] Sent: Wednesday, October 24, 2012 8:31 PM To: Bi, Chao Cc: alan@xxxxxxxxxxxxxxx; linux-serial@xxxxxxxxxxxxxxx; Gorby, Russ; Liu, Chuansheng; Chen, Jun D Subject: Re: [PATCH] serial:ifx6x60:different SPI word width configure requires different swap process On Wed, 24 Oct 2012 14:48:48 +0800 chao bi <chao.bi@xxxxxxxxx> wrote: > > SPI protocol driver only provide one function (swap_buf()) to swap SPI > data into big endian format, which is only available when SPI > controller's word width is 16 bits. But word width could be configured > as 8/16/32 bits, different word width configure should be mapped to > different swap methods.This patch is to make SPI protocol driver > choose the right swap function corresponding to SPI word width configuration. > > cc: liu chuansheng <chuansheng.liu@xxxxxxxxx> > cc: Chen Jun <jun.d.chen@xxxxxxxxx> > Signed-off-by: channing <chao.bi@xxxxxxxxx> > + len = (0 == (len&0x03)) ? (len >> 2) : ((len >> 2) + 1); Minor question - is that not just (len + 3) >> 2 ? The SPI swapping stuff at runtime looks right so. Acked-by: Alan Cox <alan@xxxxxxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html