This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Mon Apr 29 10:28:51 2024 >From mailfetcher Sat Apr 18 10:32:03 2020 Envelope-to: lkml@grols.ch Delivery-date: Sat, 18 Apr 2020 10:31:42 +0200 Received: from stout.grols.ch [195.201.141.146] by 72459556e3a9 with IMAP (fetchmail-6.3.26) for (single-drop); Sat, 18 Apr 2020 10:32:03 +0200 (CEST) Received: from vger.kernel.org ([23.128.96.18]) by stout.grols.ch with esmtp (Exim 4.89) (envelope-from ) id 1jPit3-0007iY-Ib for lkml@grols.ch; Sat, 18 Apr 2020 10:31:42 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgDRIbi convert rfc822-to-8bit (ORCPT ); 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: 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.sauna 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 Received-SPF: pass client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: 0.2 X-Spam-Score-Bar: / X-Spam-Action: no action X-Spam-Report: Action: no action Symbol: ARC_NA(0.00) Symbol: RCVD_VIA_SMTP_AUTH(0.00) Symbol: RCVD_COUNT_FIVE(0.00) Symbol: MID_RHS_MATCH_FROM(0.00) Symbol: FROM_HAS_DN(0.00) Symbol: TO_DN_SOME(0.00) Symbol: R_SPF_ALLOW(-0.20) Symbol: PRECEDENCE_BULK(0.00) Symbol: MIM > 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 >