Skip to content

Commit

Permalink
scsi: st: remove unneeded variable 'result' in st_release()
Browse files Browse the repository at this point in the history
Also remove a strange '^L' after this function.

Fix the following coccicheck warning:

drivers/scsi/st.c:1460:5-11: Unneeded variable: "result". Return "0" on
line 1473

Link: https://lore.kernel.org/r/20200418070605.11450-1-yanaijie@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Jason Yan authored and Martin K. Petersen committed Apr 22, 2020
1 parent 7109cb5 commit ec34143
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
{
Expand Down

0 comments on commit ec34143

Please sign in to comment.