linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Jiri Slaby <jslaby@suse.com>, Chen Wandun <chenwandun@huawei.com>,
	gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, beomho.seo@samsung.com,
	sw0312.kim@samsung.com, youngmin.nam@samsung.com
Subject: Re: [PATCH v2] tty: serial: samsung: remove variable 'ufstat' set but not used
Date: Fri, 22 Nov 2019 15:13:59 +0100	[thread overview]
Message-ID: <4a5c6729-30f3-bcf1-9092-1ea810324f92@samsung.com> (raw)
In-Reply-To: <d7a42300-6c67-70c4-4c90-5f05c65c421c@suse.com>

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@huawei.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


      reply	other threads:[~2019-11-22 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 11:12 [PATCH] {tty: serial, nand: onenand}: remove variable 'ufstat' set but not used Chen Wandun
2019-11-22 11:14 ` Greg KH
2019-11-22 11:33   ` Chen Wandun
2019-11-22 11:38     ` Greg KH
2019-11-22 12:04 ` [PATCH v2] tty: serial: samsung: " Chen Wandun
2019-11-22 12:08   ` Jiri Slaby
2019-11-22 14:13     ` Marek Szyprowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a5c6729-30f3-bcf1-9092-1ea810324f92@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=beomho.seo@samsung.com \
    --cc=chenwandun@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=youngmin.nam@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).