Re: [PATCH 1/8] spi: spi-ep93xx: use read,write instead of __raw_*variants

From: Ryan Mallon
Date: Fri Jun 28 2013 - 19:16:02 EST


On 29/06/13 04:42, H Hartley Sweeten wrote:

> The memory resource used by this driver is ioremap()'d and the normal
> read,write calls can be used instead of the __raw_* variants.
>
> Remove the inline read,write helpers and just do the read,write
> directly in the callers.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> Cc: Ryan Mallon <rmallon@xxxxxxxxx>
> Cc: Mika Westerberg <mika.westerberg@xxxxxx>
> Cc: Mark Brown <broonie@xxxxxxxxxx>
> Cc: Grant Likely <grant.likely@xxxxxxxxxx>
> ---
> drivers/spi/spi-ep93xx.c | 64 +++++++++++++++---------------------------------
> 1 file changed, 20 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index d7bac60..c633cd0 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -158,30 +158,6 @@ struct ep93xx_spi_chip {
> /* converts bits per word to CR0.DSS value */
> #define bits_per_word_to_dss(bpw) ((bpw) - 1)
>
> -static inline void
> -ep93xx_spi_write_u8(const struct ep93xx_spi *espi, u16 reg, u8 value)
> -{
> - __raw_writeb(value, espi->regs_base + reg);
> -}
> -
> -static inline u8
> -ep93xx_spi_read_u8(const struct ep93xx_spi *spi, u16 reg)
> -{
> - return __raw_readb(spi->regs_base + reg);
> -}


Is there a particular reason to drop these functions? It's basically just
bike-shedding, but they can make the code more readable at very little
cost. Even dropping the inline (which is preferred nowdays) the compiler
will still inline these, and it would also make this patch much smaller
to keep them.

~Ryan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/