Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp409259ybl; Thu, 5 Dec 2019 23:12:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzjEY1sf5voFnrOCjm5pWOLiy9FPDr70vBn0y+XvnidGxVPNSyv3beFE2vUOTlpzIC1TGZB X-Received: by 2002:aca:5fc6:: with SMTP id t189mr9727933oib.166.1575616339460; Thu, 05 Dec 2019 23:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575616339; cv=none; d=google.com; s=arc-20160816; b=R6AzvP4+ucVb8qadEExBUExXIYgjcODZqUrBKRb9dJva75zMmDa6WO15+V9ibnmXj7 ezeIChB4N3Z5Te6NKrAWZ2bGtYB2VAEp7cLhbz1Y7b+AU1z1+EED6FWXbu0s25E49OdA eW/nbL5lOEKC+5Gpf9PuPytQqyzZmXszNudSkz4PK6DvDzB9ldOEmZ3m9bd+8sxaLRaC IBwI4egX5FbRQfrpnTE/PtWanFRkXshnh0HPMjeTPUg3dM7vLKWDVQDgOxDzO4FBFzhe Lra9yslN87O8lqoe+9+bYwR+wdsJBC0bsFzobYtAgH/nVZ6AoFQ3lXABEaLUd/BpkPvc JfVw== 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=HSjwuaCpX24rs1yQFst3Wy1Mk4tJp8AifpQ5usDcTeU=; b=O4AV1ziiyeGB3t8st5bNw0yQnTas0kURHcsKboQ0M8jhSqSzSyxq7Mrj3/AUWCwb7W 0ZPDuyje1hHTzfxBmgxYwgpStHWi8hoDNkICzbuKIRmugiru2K+I5HpUggAa6mt6MvRq FYbkbhpVEr2x3d3LSpzr1qmxWDD5ctmCxXz3+fi0rB321Yc8b2DY139mAWFjj0ugHzUR c1ZMZFBWM+H/VLpRkkQfGJKPB7fJRjbCTHmMpehui9EcWddZz6tuDfFpbhxlkcvKesJ4 /9QQBeDrN7qFva82RCCln2fPQUNWsk37pKTuEsbSLgFDdOYxafPGhbZ/SyzX5n/iKCvM Dzbg== 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 r132si6166092oig.263.2019.12.05.23.12.06; Thu, 05 Dec 2019 23:12:19 -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 S1726370AbfLFHLX (ORCPT + 99 others); Fri, 6 Dec 2019 02:11:23 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:59762 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726283AbfLFHLW (ORCPT ); Fri, 6 Dec 2019 02:11:22 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 322B63A77FAC6FC516EA; Fri, 6 Dec 2019 15:11:21 +0800 (CST) Received: from [127.0.0.1] (10.184.52.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Dec 2019 15:11:11 +0800 Subject: Re: [PATCH] tty: omap-serial: remove set but unused variable To: Jiri Slaby , Greg KH CC: , , , , "balbi@ti.com >> Felipe Balbi" 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:11:10 +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, >