Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1472380ybz; Sat, 18 Apr 2020 01:33:34 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3WpdMNUj0vgibcnA/JYWHc7LVQBC/F5/MIhnwUtfIJ181awMP0NHGCN6scmK9sUtiX+JI X-Received: by 2002:a05:6402:b99:: with SMTP id cf25mr6345083edb.372.1587198814101; Sat, 18 Apr 2020 01:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587198814; cv=none; d=google.com; s=arc-20160816; b=PU2X2gofcQ8MnicFAfIFnIu4SrWyFx7784+IA9TUiUoQktlgXUgTipEt3ytnhrEmWF yRJpnF8Zxl2iom0zu8tKuprHPOxWuH+U8CXzLloZ9wz5ArEnwUJKx3nmfvnLncPMZQFH TX+dj230l1iKW9cfNu9gkzZVUco7rVTbZjELy0hkXK482UgWlGvxaS88gbVpVg+L7Kpx hEaqeQTkAlqsot7hscb8g8l7lpXBltWr8C3/BPHbCRSbHxbJXtkds/UwSr5ydJNCzrKH 4rOSCneYJAf5t21VSu2zMT8p8XWBe/nUaJN6a5lUUIHhaeyz8s8hxlCmdKSk3EY2sTyW RKIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Ag0TrTbVCjydIb08GaJYUKI+AyXOmivXa61epiJyFw8=; b=Io8pMX4mbN+s5BCiHRLcHgt9s3C2iolCH59yjqxFk93kWRZ78Ley9MtofiSGIUaZes qP3A3kCIGY8lidcfOBu2+F1uwoABuooI1o80RzHx15gjG/sqM0Ml/NRIYn6RKewKeKTx EtIpbaEndAjeKNFf3zWzFrkQ1eLY/hoJQ2QFsT1Zl3Rqx6luu0x3+PcqItWCKc3ASIkv c57iEjQD2AgNEvyt3PHQyNMts4R8AKYFX+/LQZbUfzeJi0YUyRzNoWkrGJ6lExCT55ZE b9aVY0kDVxqp9PGJ0M9lyNELwO8jWOK0fQSENI3bst6geVyDc8v3KWsuEZoxiBpbMpbb cvdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch12si4941883ejb.36.2020.04.18.01.33.11; Sat, 18 Apr 2020 01:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726036AbgDRIbi convert rfc822-to-8bit (ORCPT + 99 others); Sat, 18 Apr 2020 04:31:38 -0400 Received: from vs25.mail.saunalahti.fi ([62.142.117.202]:47350 "EHLO vs25.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgDRIbh (ORCPT ); Sat, 18 Apr 2020 04:31:37 -0400 X-Greylist: delayed 408 seconds by postgrey-1.27 at vger.kernel.org; Sat, 18 Apr 2020 04:31:35 EDT Received: from vs25.mail.saunalahti.fi (localhost [127.0.0.1]) by vs25.mail.saunalahti.fi (Postfix) with ESMTP id F120220DC3; Sat, 18 Apr 2020 11:24:45 +0300 (EEST) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by vs25.mail.saunalahti.fi (Postfix) with ESMTP id E5B2820D7E; Sat, 18 Apr 2020 11:24:45 +0300 (EEST) Received: from [192.168.1.20] (87-100-216-152.bb.dnainternet.fi [87.100.216.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kh8831) by gw01.mail.saunalahti.fi (Postfix) with ESMTPSA id 9DDAF40006; Sat, 18 Apr 2020 11:24:38 +0300 (EEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH] scsi: st: remove unneeded variable 'result' in st_release() From: =?utf-8?B?IkthaSBNw6RraXNhcmEgKEtvbHVtYnVzKSI=?= In-Reply-To: <20200418070605.11450-1-yanaijie@huawei.com> Date: Sat, 18 Apr 2020 11:24:38 +0300 Cc: "James E.J. Bottomley" , martin.petersen@oracle.com, arnd@arndb.de, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Hulk Robot Content-Transfer-Encoding: 8BIT Message-Id: References: <20200418070605.11450-1-yanaijie@huawei.com> To: Jason Yan X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 18. Apr 2020, at 10.06, Jason Yan wrote: > > Also remove a strange '^L' after this function. > It is the FormFeed character, put there to make viewing the source easier (the following functions are helpers). (The FormFeed may not be as familiar to the younger generations than it is to us who have used line printers with hammers and drums or chains :-) > Fix the following coccicheck warning: > > drivers/scsi/st.c:1460:5-11: Unneeded variable: "result". Return "0" on > line 1473 > The variable is related to the style of programming: default the return value to zero and modify it in the code if necessary. In the current version, there is no need (may have been at some time). IMHO, the code checking tools should have some understanding of the style issues. However, if the common opinion is to remove the variable, I have to accept that. Kai > Reported-by: Hulk Robot > Signed-off-by: Jason Yan Acked-by: Kai Mäkisara > --- > drivers/scsi/st.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c > index c5f9b348b438..4bf4ab3b70f4 100644 > --- a/drivers/scsi/st.c > +++ b/drivers/scsi/st.c > @@ -1457,7 +1457,6 @@ static int st_flush(struct file *filp, fl_owner_t id) > accessing this tape. */ > static int st_release(struct inode *inode, struct file *filp) > { > - int result = 0; > struct scsi_tape *STp = filp->private_data; > > if (STp->door_locked == ST_LOCKED_AUTO) > @@ -1470,9 +1469,9 @@ static int st_release(struct inode *inode, struct file *filp) > scsi_autopm_put_device(STp->device); > scsi_tape_put(STp); > > - return result; > + return 0; > } > - > + > /* The checks common to both reading and writing */ > static ssize_t rw_checks(struct scsi_tape *STp, struct file *filp, size_t count) > { > -- > 2.21.1 >