[PATCH 11/18] spi/xilinx: Remove rx_fn and tx_fn pointer

Ricardo Ribalda Delgado ricardo.ribalda at gmail.com
Tue Jan 27 02:00:51 PST 2015

Hello Mark

> Perhaps I'm missing something here but we only seem to be incrementing
> rx_ptr for the 32 bit case here...

The unified diff is a bit confusing this time.

This is how the function looks after the patch.
All the modes are handled in a generic way.

Which I believe it is right:

static void xilinx_spi_rx(struct xilinx_spi *xspi)
u32 data = xspi->read_fn(xspi->regs + XSPI_RXD_OFFSET);

if (!xspi->rx_ptr)

switch (xspi->bits_per_word) {
case 8:
    *(u8 *)(xspi->rx_ptr) = data;
case 16:
    *(u16 *)(xspi->rx_ptr) = data;
case 32:
    *(u32 *)(xspi->rx_ptr) = data;

xspi->rx_ptr += xspi->bits_per_word/8;

>> +     xspi->rx_ptr += xspi->bits_per_word/8;
> ...which looks to duplicate this which handles all cases.  Also there's
> a coding style thing - spaces around the / please.

I am fixing this on the next version. (and  xspi->tx_ptr +=

I am also cc: the maintainers of checkpatch, because for whatever
reason, this was not found by the script

ricardo at neopili:~/curro/qtec/linux-upstream$ scripts/checkpatch.pl
total: 0 errors, 0 warnings, 109 lines checked

xilinx-spi2/0011-spi-xilinx-Remove-rx_fn-and-tx_fn-pointer.patch has
no obvious style problems and is ready for submission.


Ricardo Ribalda

More information about the linux-arm-kernel mailing list