diff mbox series

scsi: sym53c8xx_2: Delete useless if-else in sym_xerr_cam_status

Message ID 20200902061646.576966-1-yebin10@huawei.com (mailing list archive)
State Accepted
Headers show
Series scsi: sym53c8xx_2: Delete useless if-else in sym_xerr_cam_status | expand

Commit Message

yebin (H) Sept. 2, 2020, 6:16 a.m. UTC
Only (x_status & XE_PARITY_ERR) is true we set cam_status = DID_PARITY,
other condition we set cam_status = DID_ERROR. So delete useless if-else.

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 drivers/scsi/sym53c8xx_2/sym_glue.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Martin K. Petersen Sept. 16, 2020, 1:26 a.m. UTC | #1
Ye,

> Only (x_status & XE_PARITY_ERR) is true we set cam_status = DID_PARITY,
> other condition we set cam_status = DID_ERROR. So delete useless if-else.

Applied to 5.10/scsi-staging, thanks!
Martin K. Petersen Sept. 22, 2020, 3:57 a.m. UTC | #2
On Wed, 2 Sep 2020 14:16:46 +0800, Ye Bin wrote:

> Only (x_status & XE_PARITY_ERR) is true we set cam_status = DID_PARITY,
> other condition we set cam_status = DID_ERROR. So delete useless if-else.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: sym53c8xx_2: Delete unnecessary else-if in sym_xerr_cam_status()
      https://git.kernel.org/mkp/scsi/c/bb1932dbb83a
diff mbox series

Patch

diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 28edb6e53ea2..d9a045f9858c 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -156,12 +156,8 @@  void sym_xpt_async_bus_reset(struct sym_hcb *np)
 static int sym_xerr_cam_status(int cam_status, int x_status)
 {
 	if (x_status) {
-		if	(x_status & XE_PARITY_ERR)
+		if (x_status & XE_PARITY_ERR)
 			cam_status = DID_PARITY;
-		else if	(x_status &(XE_EXTRA_DATA|XE_SODL_UNRUN|XE_SWIDE_OVRUN))
-			cam_status = DID_ERROR;
-		else if	(x_status & XE_BAD_PHASE)
-			cam_status = DID_ERROR;
 		else
 			cam_status = DID_ERROR;
 	}