Re: [PATCH] serial: xuartps: Fix register access macros.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2015-03-12 at 09:07AM +0100, Thomas Betker wrote:
> From: Thomas Betker <thomas.betker@xxxxxxxxxxxxxxxxx>
> 
> cdns_uart_readl() and cdns_uart_writel() depend on a local variable
> 'struct uart_port *port' as a hidden parameter. This is discouraged by
> the kernel coding rules for good reason, so fix it.
> 
> The patch was created by a simple search-and-replace, plus breaking
> some lines longer than 80 columns:
> * s/cdns_uart_readl(/cdns_uart_readl(port, /g
> * s/cdns_uart_writel(/cdns_uart_writel(port, /g
> 
> Signed-off-by: Thomas Betker <thomas.betker@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/tty/serial/xilinx_uartps.c |  203 +++++++++++++++++++-----------------
>  1 file changed, 107 insertions(+), 96 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 392d636..1ff06eb 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -39,8 +39,8 @@
>  #define CDNS_UART_FIFO_SIZE	64	/* FIFO size */
>  #define CDNS_UART_REGISTER_SPACE	0x1000
>  
> -#define cdns_uart_readl(offset)		ioread32(port->membase + offset)
> -#define cdns_uart_writel(val, offset)	iowrite32(val, port->membase + offset)
> +#define cdns_uart_readl(up, reg)	ioread32((up)->membase + (reg))
> +#define cdns_uart_writel(up, val, reg)	iowrite32(val, (up)->membase + (reg))

IMHO, we could get rid of this indirection layer completely and just
directly call io(read|write).

	Sören
--
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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux