skd: Fix checkpatch ERRORS and removed unused functions
authorAkhil Bhansali <bhansaliakhil@gmail.com>
Wed, 23 Oct 2013 12:00:08 +0000 (13:00 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 8 Nov 2013 16:10:29 +0000 (09:10 -0700)
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/skd_main.c

index 3110f68ecedd7c54b84fde8b5710fcd5fef602e2..308bf474dc3970d3569c0e11fb70b7a50911f49f 100644 (file)
@@ -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);