Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <jslaby@suse.com>, <linux-serial@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <huawei.libin@huawei.com>
Subject: Re: [PATCH] tty: omap-serial: remove set but unused variable
Date: Thu, 5 Dec 2019 20:30:25 +0800	[thread overview]
Message-ID: <64810841-5e07-c346-01f3-dfd40a3f2df0@huawei.com> (raw)
In-Reply-To: <20191205121310.GA389695@kroah.com>



On 2019/12/5 20:13, Greg KH wrote:
> On Thu, Dec 05, 2019 at 08:04:36PM +0800, Xiongfeng Wang wrote:
>> Fix the following warning:
>> drivers/tty/serial/omap-serial.c: In function serial_omap_rlsi:
>> drivers/tty/serial/omap-serial.c:496:16: warning: variable ch set but not used [-Wunused-but-set-variable]
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
>> ---
>>  drivers/tty/serial/omap-serial.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index 6420ae5..54ee3ae 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -493,10 +493,9 @@ static unsigned int check_modem_status(struct uart_omap_port *up)
>>  static void serial_omap_rlsi(struct uart_omap_port *up, unsigned int lsr)
>>  {
>>  	unsigned int flag;
>> -	unsigned char ch = 0;
>>  
>>  	if (likely(lsr & UART_LSR_DR))
>> -		ch = serial_in(up, UART_RX);
>> +		serial_in(up, UART_RX);
> 
> Shouldn't you be doing something with 'ch'?

Sorry, my original thought is trying not to modify the existing logic.
I will look into the mechanism to see if I need to check 'ch'.

Thanks,
Xiongfeng

> 
> 
> .
> 


  reply	other threads:[~2019-12-05 12:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 12:04 [PATCH] tty: omap-serial: remove set but unused variable Xiongfeng Wang
2019-12-05 12:13 ` Greg KH
2019-12-05 12:30   ` Xiongfeng Wang [this message]
2019-12-05 12:39     ` Jiri Slaby
2019-12-06  7:11       ` Xiongfeng Wang
2019-12-06  7:38       ` Xiongfeng Wang

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=64810841-5e07-c346-01f3-dfd40a3f2df0@huawei.com \
    --to=wangxiongfeng2@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=huawei.libin@huawei.com \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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