linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] skd: Fix checkpatch ERRORS and removed unused functions.
@ 2013-10-23 11:51 Akhil Bhansali
  2013-10-23 12:02 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Akhil Bhansali @ 2013-10-23 11:51 UTC (permalink / raw)
  To: Jens Axboe, OS Engineering
  Cc: Ramprasad Chinthekindi, jmoyer@redhat.com, Ramprasad Chinthekindi,
	'linux kernel (linux-kernel@vger.kernel.org)'

[-- Attachment #1: Type: text/plain, Size: 5626 bytes --]

Hi Jens,

I am sending patch which takes care of
- Removal of unused functions like readq / readl.
- Takes care of 3 errors messages shown by checkpatch.pl

Kindly please apply this patch to 3.13/drivers staging area. 
Thank you.

---
From dcd25c7128e14c90abb6a5d61e0a9ae9b26b6904 Mon Sep 17 00:00:00 2001
From: Akhil Bhansali <bhansaliakhil@gmail.com>
Date: Wed, 23 Oct 2013 14:45:34 +0530
Subject: [PATCH] [PATCH] Fix checkpatch ERRORS and removed unused functions.

This patch fixes checkpatch.pl errors for assignment in if condition.
It also removes unused readq / readl function calls.

As Andrew had disabled the compilation of drivers for 32 bit,
I have modified format specifiers in few VPRINTKs to avoid warnings
during 64 bit compilation.
Signed-off-by: Akhil Bhansali <abhansali@stec-inc.com>
Reviewed-by: Ramprasad Chinthekindi <rchinthekindi@stec-inc.com>
---
 drivers/block/skd_main.c |   53 +++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 22 deletions(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index 3110f68..308bf47 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -420,14 +420,10 @@ static inline void skd_reg_write32(struct skd_device *skdev, u32 val,
 	if (likely(skdev->dbg_level < 2)) {
 		writel(val, skdev->mem_map[1] + offset);
 		barrier();
-		readl(skdev->mem_map[1] + offset);
-		barrier();
 	} else {
 		barrier();
 		writel(val, skdev->mem_map[1] + offset);
 		barrier();
-		readl(skdev->mem_map[1] + offset);
-		barrier();
 		VPRINTK(skdev, "offset %x = %x\n", offset, val);
 	}
 }
@@ -438,14 +434,10 @@ static inline void skd_reg_write64(struct skd_device *skdev, u64 val,
 	if (likely(skdev->dbg_level < 2)) {
 		writeq(val, skdev->mem_map[1] + offset);
 		barrier();
-		readq(skdev->mem_map[1] + offset);
-		barrier();
 	} else {
 		barrier();
 		writeq(val, skdev->mem_map[1] + offset);
 		barrier();
-		readq(skdev->mem_map[1] + offset);
-		barrier();
 		VPRINTK(skdev, "offset %x = %016llx\n", offset, val);
 	}
 }
@@ -1656,18 +1648,36 @@ static int skd_ioctl_sg_io(struct skd_device *skdev, fmode_t mode,
 		goto out;
 	}
 
-	if ((rc = skd_sg_io_get_and_check_args(skdev, &sksgio)) ||
-	    (rc = skd_sg_io_obtain_skspcl(skdev, &sksgio)) ||
-	    (rc = skd_sg_io_prep_buffering(skdev, &sksgio)) ||
-	    (rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_TO_DEV)))
+	rc = skd_sg_io_get_and_check_args(skdev, &sksgio);
+	if (rc)
+		goto out;
+
+	rc = skd_sg_io_obtain_skspcl(skdev, &sksgio);
+	if (rc)
+		goto out;
+
+	rc = skd_sg_io_prep_buffering(skdev, &sksgio);
+	if (rc)
+		goto out;
+
+	rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_TO_DEV);
+	if (rc)
 		goto out;
 
-	if ((rc = skd_sg_io_send_fitmsg(skdev, &sksgio)) ||
-	    (rc = skd_sg_io_await(skdev, &sksgio)))
+	rc = skd_sg_io_send_fitmsg(skdev, &sksgio);
+	if (rc)
 		goto out;
 
-	if ((rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_FROM_DEV)) ||
-	    (rc = skd_sg_io_put_status(skdev, &sksgio)))
+	rc = skd_sg_io_await(skdev, &sksgio);
+	if (rc)
+		goto out;
+
+	rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_FROM_DEV);
+	if (rc)
+		goto out;
+
+	rc = skd_sg_io_put_status(skdev, &sksgio);
+	if (rc)
 		goto out;
 
 	rc = 0;
@@ -4556,11 +4566,10 @@ static int skd_cons_skmsg(struct skd_device *skdev)
 	int rc = 0;
 	u32 i;
 
-	VPRINTK(skdev, "skmsg_table kzalloc, struct %u, count %u total %lu\n",
+	VPRINTK(skdev, "skmsg_table kzalloc, struct %lu, count %u total %lu\n",
 		sizeof(struct skd_fitmsg_context),
 		skdev->num_fitmsg_context,
-		(unsigned long) sizeof(struct skd_fitmsg_context) *
-					skdev->num_fitmsg_context);
+		sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context);
 
 	skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context)
 				     *skdev->num_fitmsg_context, GFP_KERNEL);
@@ -4611,7 +4620,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
 	int rc = 0;
 	u32 i;
 
-	VPRINTK(skdev, "skreq_table kzalloc, struct %u, count %u total %u\n",
+	VPRINTK(skdev, "skreq_table kzalloc, struct %lu, count %u total %lu\n",
 		sizeof(struct skd_request_context),
 		skdev->num_req_context,
 		sizeof(struct skd_request_context) * skdev->num_req_context);
@@ -4623,7 +4632,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
 		goto err_out;
 	}
 
-	VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %u total %u\n",
+	VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %lu total %lu\n",
 		skdev->sgs_per_request, sizeof(struct scatterlist),
 		skdev->sgs_per_request * sizeof(struct scatterlist));
 
@@ -4668,7 +4677,7 @@ static int skd_cons_skspcl(struct skd_device *skdev)
 	int rc = 0;
 	u32 i, nbytes;
 
-	VPRINTK(skdev, "skspcl_table kzalloc, struct %u, count %u total %u\n",
+	VPRINTK(skdev, "skspcl_table kzalloc, struct %lu, count %u total %lu\n",
 		sizeof(struct skd_special_context),
 		skdev->n_special,
 		sizeof(struct skd_special_context) * skdev->n_special);
-- 
1.7.9.5

PROPRIETARY-CONFIDENTIAL INFORMATION INCLUDED

This electronic transmission, and any documents attached hereto, may contain confidential, proprietary and/or legally privileged information. The information is intended only for use by the recipient named above. If you received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited, and violators will be pursued legally.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 5097 bytes --]

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

* Re: [PATCH] skd: Fix checkpatch ERRORS and removed unused functions.
  2013-10-23 11:51 [PATCH] skd: Fix checkpatch ERRORS and removed unused functions Akhil Bhansali
@ 2013-10-23 12:02 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2013-10-23 12:02 UTC (permalink / raw)
  To: Akhil Bhansali
  Cc: OS Engineering, Ramprasad Chinthekindi, jmoyer@redhat.com,
	'linux kernel (linux-kernel@vger.kernel.org)'

On Wed, Oct 23 2013, Akhil Bhansali wrote:
> From dcd25c7128e14c90abb6a5d61e0a9ae9b26b6904 Mon Sep 17 00:00:00 2001
> From: Akhil Bhansali <bhansaliakhil@gmail.com>
> Date: Wed, 23 Oct 2013 14:45:34 +0530
> Subject: [PATCH] [PATCH] Fix checkpatch ERRORS and removed unused functions.

In the future, please ensure that patches are sanity cleaned. There's a
double [PATCH] in that subject, and you should prefix the first line
with the driver/area being modified.

I committed it as:

skd: Fix checkpatch ERRORS and removed unused functions.

> This patch fixes checkpatch.pl errors for assignment in if condition.
> It also removes unused readq / readl function calls.
> 
> As Andrew had disabled the compilation of drivers for 32 bit,
> I have modified format specifiers in few VPRINTKs to avoid warnings
> during 64 bit compilation.
> Signed-off-by: Akhil Bhansali <abhansali@stec-inc.com>
> Reviewed-by: Ramprasad Chinthekindi <rchinthekindi@stec-inc.com>

Leave a line between the commit message and the signed-off/reviewed
lines.

> PROPRIETARY-CONFIDENTIAL INFORMATION INCLUDED
> 
> This electronic transmission, and any documents attached hereto, may
> contain confidential, proprietary and/or legally privileged
> information. The information is intended only for use by the recipient
> named above. If you received this electronic message in error, please
> notify the sender and delete the electronic message. Any disclosure,
> copying, distribution, or use of the contents of information received
> in error is strictly prohibited, and violators will be pursued
> legally.

And you might want to look into getting rid of this if possible, you are
posting to public lists...

-- 
Jens Axboe


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

end of thread, other threads:[~2013-10-23 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 11:51 [PATCH] skd: Fix checkpatch ERRORS and removed unused functions Akhil Bhansali
2013-10-23 12:02 ` Jens Axboe

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).