lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8b99c89-0feb-5abd-59dd-851e8f0f19d2@kernel.org>
Date:   Tue, 30 Aug 2022 08:45:49 +0200
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] serial: sh-sci: CIRC_CNT_TO_END() is enough

On 23. 08. 22, 16:18, Ilpo Järvinen wrote:
> Testing also CIRC_CNT() with CIRC_CNT_TO_END() is unnecessary because
> to latter alone covers all necessary cases.

Reviewed-by: Jiri Slaby <jirislaby@...nel.org>

> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> ---
>   drivers/tty/serial/sh-sci.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 0075a1420005..6d2f5a08ff1f 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -1408,9 +1408,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work)
>   	head = xmit->head;
>   	tail = xmit->tail;
>   	buf = s->tx_dma_addr + (tail & (UART_XMIT_SIZE - 1));
> -	s->tx_dma_len = min_t(unsigned int,
> -		CIRC_CNT(head, tail, UART_XMIT_SIZE),
> -		CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE));
> +	s->tx_dma_len = CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE);
>   	if (!s->tx_dma_len) {
>   		/* Transmit buffer has been flushed */
>   		spin_unlock_irq(&port->lock);

-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ