linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: ufs: fix sparse tool warning in ufs driver
@ 2014-07-23  6:31 Dolev Raviv
  2014-07-23  6:31 ` [PATCH 1/2] scsi: ufs: make undeclared functions static Dolev Raviv
  2014-07-23  6:31 ` [PATCH 2/2] scsi: ufs: fix endianness sparse warnings Dolev Raviv
  0 siblings, 2 replies; 3+ messages in thread
From: Dolev Raviv @ 2014-07-23  6:31 UTC (permalink / raw)
  To: James.Bottomley, hch
  Cc: linux-scsi, linux-scsi-owner, sthumma, linux-arm-msm, santoshsy,
	Dolev Raviv

Few fixes noted by the sparse tool:
- make undeclared functions static
- fix endianness sparse warnings

Sujit Reddy Thumma (2):
  scsi: ufs: make undeclared functions static
  scsi: ufs: fix endianness sparse warnings

 drivers/scsi/ufs/ufshcd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

-- 
1.8.5.2

--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] scsi: ufs: make undeclared functions static
  2014-07-23  6:31 [PATCH 0/2] scsi: ufs: fix sparse tool warning in ufs driver Dolev Raviv
@ 2014-07-23  6:31 ` Dolev Raviv
  2014-07-23  6:31 ` [PATCH 2/2] scsi: ufs: fix endianness sparse warnings Dolev Raviv
  1 sibling, 0 replies; 3+ messages in thread
From: Dolev Raviv @ 2014-07-23  6:31 UTC (permalink / raw)
  To: James.Bottomley, hch
  Cc: linux-scsi, linux-scsi-owner, sthumma, linux-arm-msm, santoshsy,
	Dolev Raviv

From: Sujit Reddy Thumma <sthumma@codeaurora.org>

Make undeclared functions static to suppress warnings
from sparse tool.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d412339..a450407 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1314,7 +1314,7 @@ out:
  * The buf_len parameter will contain, on return, the length parameter
  * received on the response.
  */
-int ufshcd_query_descriptor(struct ufs_hba *hba,
+static int ufshcd_query_descriptor(struct ufs_hba *hba,
 			enum query_opcode opcode, enum desc_idn idn, u8 index,
 			u8 selector, u8 *desc_buf, int *buf_len)
 {
@@ -2018,7 +2018,8 @@ static int ufshcd_slave_alloc(struct scsi_device *sdev)
  * Change queue depth according to the reason and make sure
  * the max. limits are not crossed.
  */
-int ufshcd_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
+static int ufshcd_change_queue_depth(struct scsi_device *sdev,
+		int depth, int reason)
 {
 	struct ufs_hba *hba = shost_priv(sdev->host);
 
-- 
1.8.5.2

--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] scsi: ufs: fix endianness sparse warnings
  2014-07-23  6:31 [PATCH 0/2] scsi: ufs: fix sparse tool warning in ufs driver Dolev Raviv
  2014-07-23  6:31 ` [PATCH 1/2] scsi: ufs: make undeclared functions static Dolev Raviv
@ 2014-07-23  6:31 ` Dolev Raviv
  1 sibling, 0 replies; 3+ messages in thread
From: Dolev Raviv @ 2014-07-23  6:31 UTC (permalink / raw)
  To: James.Bottomley, hch
  Cc: linux-scsi, linux-scsi-owner, sthumma, linux-arm-msm, santoshsy,
	Dolev Raviv

From: Sujit Reddy Thumma <sthumma@codeaurora.org>

Fix many warnings with incorrect endian assumptions
which makes the code unportable to new architectures.

The UFS specification defines the byte order as big-endian
for UPIU structure and little-endian for the host controller
transfer/task management descriptors.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a450407..ba27215 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -464,7 +464,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 		/* data segment length */
 		resp_len = be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_2) &
 						MASK_QUERY_DATA_SEG_LEN;
-		buf_len = hba->dev_cmd.query.request.upiu_req.length;
+		buf_len = be16_to_cpu(
+				hba->dev_cmd.query.request.upiu_req.length);
 		if (likely(buf_len >= resp_len)) {
 			memcpy(hba->dev_cmd.query.descriptor, descp, resp_len);
 		} else {
@@ -1342,7 +1343,7 @@ static int ufshcd_query_descriptor(struct ufs_hba *hba,
 	ufshcd_init_query(hba, &request, &response, opcode, idn, index,
 			selector);
 	hba->dev_cmd.query.descriptor = desc_buf;
-	request->upiu_req.length = *buf_len;
+	request->upiu_req.length = cpu_to_be16(*buf_len);
 
 	switch (opcode) {
 	case UPIU_QUERY_OPCODE_WRITE_DESC:
@@ -1368,7 +1369,7 @@ static int ufshcd_query_descriptor(struct ufs_hba *hba,
 	}
 
 	hba->dev_cmd.query.descriptor = NULL;
-	*buf_len = response->upiu_res.length;
+	*buf_len = be16_to_cpu(response->upiu_res.length);
 
 out_unlock:
 	mutex_unlock(&hba->dev_cmd.lock);
-- 
1.8.5.2

--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-23  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23  6:31 [PATCH 0/2] scsi: ufs: fix sparse tool warning in ufs driver Dolev Raviv
2014-07-23  6:31 ` [PATCH 1/2] scsi: ufs: make undeclared functions static Dolev Raviv
2014-07-23  6:31 ` [PATCH 2/2] scsi: ufs: fix endianness sparse warnings Dolev Raviv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).