spi: zynq_spi.c:Optmizations done in spi_xfer func
Subsystems (2)
PATCH 1/1 spi: zynq_spi.c:Optmizations done in spi_xfer func
This Patch replaces the arithmatic operators with bitwise operators for optimizations hoping it would save some cycles
Signed-off-by Chakra Divi <[email protected]>
---
Note: Jagan or anyone please test this patch, I don't have hardware with me.
--- drivers/spi/zynq_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/zynq_spi.c +2 -2
@@ -218,7 +218,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, void *din, unsigned long flags) {struct zynq_spi_slave *zslave =to_zynq_spi_slave (slave); -u32 len = bitlen /8 ; +u32 len = bitlen >>3 ;u32 tx_len = len, rx_len = len, tx_tvl;const u8 *tx_buf = dout;u8 *rx_buf = din, buf;
@@ -227,7 +227,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,debug ("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , slave->bus, slave->cs, bitlen, len, flags); -if (bitlen %8 ) { +if (bitlen &0x7 ) {debug ("spi_xfer: Non byte aligned SPI transfer\n" );return -1 ; }
Signature · 1 line
1.7.9.5