Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp428049ybl; Thu, 5 Dec 2019 23:40:08 -0800 (PST) X-Google-Smtp-Source: APXvYqz/2E/IUkGipX1koMlYeoWE/UMIWo1Oo584rhrv9pZDDj7QJArwEDQFYCn//vkJdmVedMVr X-Received: by 2002:aca:f20b:: with SMTP id q11mr10430047oih.78.1575618008473; Thu, 05 Dec 2019 23:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575618008; cv=none; d=google.com; s=arc-20160816; b=DLXnjGVqyGm8971xLSas/cu8BOQtkJkMEVyGEF9L7+F8A2Ph5ok2H9wj0xYtkUSGc2 +FqzkXip8oaRX6ohhUJVqlOOBpxPUlHrK3fsLfE0TExsIhS+HpgAI7b9tqe4zi0MtQbU mfZYOLsxSAQk/w2mTA4Lpol9Y0+nbNVvyMRxezZ7mNJsMF7CbVyja5gn5+0ON15B10Zt X2iBKWPCmdaoQcpLSvLAZGYgFXJ5TI+1rL/FdAfb1VWZ0Ak+g1mQvgzKMnCEGy2FXhVT 8se9oVUgB/QAX0zK1l5jkHIwYG5rfVptjQzwPecX9MMgWuT34jlErp3oUf77+l07UjCE R/9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ibtv2BP8/y83uIJwRStaOwIjlECWAetFNVC0/LQ1Q1o=; b=S+HvaPftWSy/cMNcecGiFK3lKwocmSb8yPASFwu37IYmk2whi2bfcOlrdtHSLiznh/ 8pvtAs2Z+TwHhRo++QrP3yN/fKbiNtjsf082So7Szs4s/Uk+g2vhbPWQtoTJLMk/jPau MJVYom34bh9YRGNmxW3U5uOW7S1KrmM612KdlWyaUx0qUSREQ52Fz/NizXmXmFhQQ9YX v1DhYZbPE8HZsINnyseqhI4EBH3/GQj2VpILKacPma3+dnt4z2PrnadcnaV+coRwpdxW mrwZ5ksyb0lrwS+RAIh6hthtv5zZH2Y64xUawvV3F7EOfVp3Qj8m+/bkZR+pjyvLdTPV F1Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si6532671otd.190.2019.12.05.23.39.56; Thu, 05 Dec 2019 23:40:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbfLFHjA (ORCPT + 99 others); Fri, 6 Dec 2019 02:39:00 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7644 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725858AbfLFHjA (ORCPT ); Fri, 6 Dec 2019 02:39:00 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6DA0866EB6B8F55B86A0; Fri, 6 Dec 2019 15:38:55 +0800 (CST) Received: from [127.0.0.1] (10.184.52.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Dec 2019 15:38:48 +0800 Subject: Re: [PATCH] tty: omap-serial: remove set but unused variable To: Jiri Slaby , Greg KH CC: , , References: <1575547476-51996-1-git-send-email-wangxiongfeng2@huawei.com> <20191205121310.GA389695@kroah.com> <64810841-5e07-c346-01f3-dfd40a3f2df0@huawei.com> <0d5c4085-a6dc-ae06-34f2-7d4221baa5e9@suse.com> From: Xiongfeng Wang Message-ID: Date: Fri, 6 Dec 2019 15:38:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <0d5c4085-a6dc-ae06-34f2-7d4221baa5e9@suse.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.52.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/5 20:39, Jiri Slaby wrote: > On 05. 12. 19, 13:30, Xiongfeng Wang wrote: >> >> >> 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 >>>> Signed-off-by: Xiongfeng Wang >>>> --- >>>> 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'. > > The change looks in fact correct, see: > commit 9a12fcf8b1543c99ffcec3d61db86f0dea52dc9d > Author: Shubhrajyoti D > Date: Fri Sep 21 20:07:19 2012 +0530 > > serial: omap: fix the reciever line error case > > It also says: "This is recommended in the interrupt reset method in the > table 23-246 of the omap4 TRM." > > The character read is erroneous and should be apparently dropped. But > you should add a comment about it, though. > Thanks a lot. I will add it in the comment and send another version. Thanks, Xiongfeng > thanks, >