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] [day] [month] [year] [list]
Message-ID: <0885a541-9ea5-ea8c-f3ee-61162ef77d8b@kernel.org>
Date:   Tue, 30 Aug 2022 08:46:24 +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 3/3] serial: pch_uart: 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/pch_uart.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
> index 8a9065e4a903..116a2e76093d 100644
> --- a/drivers/tty/serial/pch_uart.c
> +++ b/drivers/tty/serial/pch_uart.c
> @@ -898,9 +898,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv)
>   		fifo_size--;
>   	}
>   
> -	bytes = min((int)CIRC_CNT(xmit->head, xmit->tail,
> -			     UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head,
> -			     xmit->tail, UART_XMIT_SIZE));
> +	bytes = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
>   	if (!bytes) {
>   		dev_dbg(priv->port.dev, "%s 0 bytes return\n", __func__);
>   		pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT);

-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ