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: <4a5c6729-30f3-bcf1-9092-1ea810324f92@samsung.com>
Date:   Fri, 22 Nov 2019 15:13:59 +0100
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     Jiri Slaby <jslaby@...e.com>, Chen Wandun <chenwandun@...wei.com>,
        gregkh@...uxfoundation.org, linux-serial@...r.kernel.org,
        linux-kernel@...r.kernel.org, beomho.seo@...sung.com,
        sw0312.kim@...sung.com, youngmin.nam@...sung.com
Subject: Re: [PATCH v2] tty: serial: samsung: remove variable 'ufstat' set
 but not used

Hi Jiri,

On 22.11.2019 13:08, Jiri Slaby wrote:
> On 22. 11. 19, 13:04, Chen Wandun wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/tty/serial/samsung_tty.c: In function s3c24xx_serial_rx_chars_dma:
>> drivers/tty/serial/samsung_tty.c:549:24: warning: variable ufstat set but not used [-Wunused-but-set-variable]
>>
>> Signed-off-by: Chen Wandun <chenwandun@...wei.com>
>> ---
>>   drivers/tty/serial/samsung_tty.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
>> index 83fd516..ab3c7d1 100644
>> --- a/drivers/tty/serial/samsung_tty.c
>> +++ b/drivers/tty/serial/samsung_tty.c
>> @@ -546,7 +546,7 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport);
>>   
>>   static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id)
>>   {
>> -	unsigned int utrstat, ufstat, received;
>> +	unsigned int utrstat, received;
>>   	struct s3c24xx_uart_port *ourport = dev_id;
>>   	struct uart_port *port = &ourport->port;
>>   	struct s3c24xx_uart_dma *dma = ourport->dma;
>> @@ -556,7 +556,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id)
>>   	struct dma_tx_state state;
>>   
>>   	utrstat = rd_regl(port, S3C2410_UTRSTAT);
>> -	ufstat = rd_regl(port, S3C2410_UFSTAT);
>> +	rd_regl(port, S3C2410_UFSTAT);
> The question (CCed some samsung people) is whether we have to spend the
> cycles reading the register at all? Does it have side-effects?

Reading this register doesn't have any side effects, so it is safe to 
remove rd_regl(port, S3C2410_UFSTAT) at all in this function. Tested on 
Exynos5422-based OdroidXU3 board.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ