lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181129031855.18701-1-wen.yang99@zte.com.cn>
Date:   Thu, 29 Nov 2018 11:18:55 +0800
From:   Wen Yang <wen.yang99@....com.cn>
To:     jejb@...ux.vnet.ibm.com, martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        zhong.weidong@....com.cn, Wen Yang <wen.yang99@....com.cn>,
        Julia Lawall <julia.lawall@...6.fr>,
        Willem Riede <osst@...de.org>,
        Kashyap Desai <kashyap.desai@...adcom.com>,
        Shivasharan S <shivasharan.srikanteshwara@...adcom.com>
Subject: [PATCH] scsi: Fix bad alignments

As reported by cocinelle:

drivers/scsi/sym53c8xx_2/sym_hipd.c:5411:1-49: code aligned with following code on line 5418
drivers/scsi/osst.c:4701:3-9: code aligned with following code on line 4703
drivers/scsi/osst.c:4206:3-17: code aligned with following code on line 4207
drivers/scsi/osst.c:5570:2-25: code aligned with following code on line 5571
drivers/scsi/osst.c:5572:2-59: code aligned with following code on line 5573
drivers/scsi/osst.c:5574:2-42: code aligned with following code on line 5575
drivers/scsi/megaraid/megaraid_sas_base.c:1825:2-59: code aligned with following code on line 1827

Signed-off-by: Wen Yang <wen.yang99@....com.cn>
CC: Julia Lawall <julia.lawall@...6.fr>
CC: "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@...cle.com>
CC: Willem Riede <osst@...de.org>
CC: Kashyap Desai <kashyap.desai@...adcom.com>
CC: Shivasharan S <shivasharan.srikanteshwara@...adcom.com>
CC: linux-scsi@...r.kernel.org
CC: linux-kernel@...r.kernel.org
---
 drivers/scsi/megaraid/megaraid_sas_base.c |  3 ++-
 drivers/scsi/osst.c                       | 10 +++++-----
 drivers/scsi/sym53c8xx_2/sym_hipd.c       |  8 ++++----
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 9b90c716f06d..e00b44babb28 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1822,7 +1822,8 @@ void megasas_set_dynamic_target_properties(struct scsi_device *sdev,
 		raid = MR_LdRaidGet(ld, local_map_ptr);
 
 		if (raid->capability.ldPiMode == MR_PROT_INFO_TYPE_CONTROLLER)
-		blk_queue_update_dma_alignment(sdev->request_queue, 0x7);
+			blk_queue_update_dma_alignment(
+					sdev->request_queue, 0x7);
 
 		mr_device_priv_data->is_tm_capable =
 			raid->capability.tmCapable;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 7a1a1edde35d..bbf8e60dbb04 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -4698,7 +4698,7 @@ static int __os_scsi_tape_open(struct inode * inode, struct file * filp)
 						    STp->timeout, MAX_RETRIES, 1);
 			if ((SRpnt->sense[0] & 0x70) != 0x70 ||
 			    (SRpnt->sense[2] & 0x0f) == NOT_READY)
-			break;
+				break;
 
 			if ((SRpnt->sense[2] & 0x0f) == UNIT_ATTENTION) {
 				int j;
@@ -5567,13 +5567,13 @@ static int osst_copy_from_buffer(struct osst_buffer *st_bp, unsigned char *ptr)
 static void validate_options (void)
 {
   if (max_dev > 0)
-		osst_max_dev = max_dev;  
+	osst_max_dev = max_dev;
   if (write_threshold_kbs > 0)
-		osst_write_threshold = write_threshold_kbs * ST_KILOBYTE;
+	osst_write_threshold = write_threshold_kbs * ST_KILOBYTE;
   if (osst_write_threshold > osst_buffer_size)
-		osst_write_threshold = osst_buffer_size;
+	osst_write_threshold = osst_buffer_size;
   if (max_sg_segs >= OSST_FIRST_SG)
-		osst_max_sg_segs = max_sg_segs;
+	osst_max_sg_segs = max_sg_segs;
 #if DEBUG
   printk(OSST_DEB_MSG "osst :D: max tapes %d, write threshold %d, max s/g segs %d.\n",
 			   osst_max_dev, osst_write_threshold, osst_max_sg_segs);
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 0a2a54517b15..29be0f4e8bd6 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -5407,8 +5407,8 @@ void sym_complete_error(struct sym_hcb *np, struct sym_ccb *cp)
 		cp->sv_resid = 0;
 	}
 #ifdef DEBUG_2_0_X
-if (resid)
-	printf("XXXX RESID= %d - 0x%x\n", resid, resid);
+	if (resid)
+		printf("XXXX RESID= %d - 0x%x\n", resid, resid);
 #endif
 
 	/*
@@ -5531,8 +5531,8 @@ void sym_complete_ok (struct sym_hcb *np, struct sym_ccb *cp)
 	if (!SYM_SETUP_RESIDUAL_SUPPORT)
 		resid  = 0;
 #ifdef DEBUG_2_0_X
-if (resid)
-	printf("XXXX RESID= %d - 0x%x\n", resid, resid);
+	if (resid)
+		printf("XXXX RESID= %d - 0x%x\n", resid, resid);
 #endif
 
 	/*
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ