Skip to content

Commit f721bb0

Browse files
bhansaliakhilaxboe
authored andcommitted
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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 8c49a77 commit f721bb0

1 file changed

Lines changed: 31 additions & 22 deletions

File tree

‎drivers/block/skd_main.c‎

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,10 @@ static inline void skd_reg_write32(struct skd_device *skdev, u32 val,
420420
if (likely(skdev->dbg_level < 2)) {
421421
writel(val, skdev->mem_map[1] + offset);
422422
barrier();
423-
readl(skdev->mem_map[1] + offset);
424-
barrier();
425423
} else {
426424
barrier();
427425
writel(val, skdev->mem_map[1] + offset);
428426
barrier();
429-
readl(skdev->mem_map[1] + offset);
430-
barrier();
431427
VPRINTK(skdev, "offset %x = %x\n", offset, val);
432428
}
433429
}
@@ -438,14 +434,10 @@ static inline void skd_reg_write64(struct skd_device *skdev, u64 val,
438434
if (likely(skdev->dbg_level < 2)) {
439435
writeq(val, skdev->mem_map[1] + offset);
440436
barrier();
441-
readq(skdev->mem_map[1] + offset);
442-
barrier();
443437
} else {
444438
barrier();
445439
writeq(val, skdev->mem_map[1] + offset);
446440
barrier();
447-
readq(skdev->mem_map[1] + offset);
448-
barrier();
449441
VPRINTK(skdev, "offset %x = %016llx\n", offset, val);
450442
}
451443
}
@@ -1656,18 +1648,36 @@ static int skd_ioctl_sg_io(struct skd_device *skdev, fmode_t mode,
16561648
goto out;
16571649
}
16581650

1659-
if ((rc = skd_sg_io_get_and_check_args(skdev, &sksgio)) ||
1660-
(rc = skd_sg_io_obtain_skspcl(skdev, &sksgio)) ||
1661-
(rc = skd_sg_io_prep_buffering(skdev, &sksgio)) ||
1662-
(rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_TO_DEV)))
1651+
rc = skd_sg_io_get_and_check_args(skdev, &sksgio);
1652+
if (rc)
1653+
goto out;
1654+
1655+
rc = skd_sg_io_obtain_skspcl(skdev, &sksgio);
1656+
if (rc)
1657+
goto out;
1658+
1659+
rc = skd_sg_io_prep_buffering(skdev, &sksgio);
1660+
if (rc)
1661+
goto out;
1662+
1663+
rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_TO_DEV);
1664+
if (rc)
16631665
goto out;
16641666

1665-
if ((rc = skd_sg_io_send_fitmsg(skdev, &sksgio)) ||
1666-
(rc = skd_sg_io_await(skdev, &sksgio)))
1667+
rc = skd_sg_io_send_fitmsg(skdev, &sksgio);
1668+
if (rc)
16671669
goto out;
16681670

1669-
if ((rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_FROM_DEV)) ||
1670-
(rc = skd_sg_io_put_status(skdev, &sksgio)))
1671+
rc = skd_sg_io_await(skdev, &sksgio);
1672+
if (rc)
1673+
goto out;
1674+
1675+
rc = skd_sg_io_copy_buffer(skdev, &sksgio, SG_DXFER_FROM_DEV);
1676+
if (rc)
1677+
goto out;
1678+
1679+
rc = skd_sg_io_put_status(skdev, &sksgio);
1680+
if (rc)
16711681
goto out;
16721682

16731683
rc = 0;
@@ -4556,11 +4566,10 @@ static int skd_cons_skmsg(struct skd_device *skdev)
45564566
int rc = 0;
45574567
u32 i;
45584568

4559-
VPRINTK(skdev, "skmsg_table kzalloc, struct %u, count %u total %lu\n",
4569+
VPRINTK(skdev, "skmsg_table kzalloc, struct %lu, count %u total %lu\n",
45604570
sizeof(struct skd_fitmsg_context),
45614571
skdev->num_fitmsg_context,
4562-
(unsigned long) sizeof(struct skd_fitmsg_context) *
4563-
skdev->num_fitmsg_context);
4572+
sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context);
45644573

45654574
skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context)
45664575
*skdev->num_fitmsg_context, GFP_KERNEL);
@@ -4611,7 +4620,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
46114620
int rc = 0;
46124621
u32 i;
46134622

4614-
VPRINTK(skdev, "skreq_table kzalloc, struct %u, count %u total %u\n",
4623+
VPRINTK(skdev, "skreq_table kzalloc, struct %lu, count %u total %lu\n",
46154624
sizeof(struct skd_request_context),
46164625
skdev->num_req_context,
46174626
sizeof(struct skd_request_context) * skdev->num_req_context);
@@ -4623,7 +4632,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
46234632
goto err_out;
46244633
}
46254634

4626-
VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %u total %u\n",
4635+
VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %lu total %lu\n",
46274636
skdev->sgs_per_request, sizeof(struct scatterlist),
46284637
skdev->sgs_per_request * sizeof(struct scatterlist));
46294638

@@ -4668,7 +4677,7 @@ static int skd_cons_skspcl(struct skd_device *skdev)
46684677
int rc = 0;
46694678
u32 i, nbytes;
46704679

4671-
VPRINTK(skdev, "skspcl_table kzalloc, struct %u, count %u total %u\n",
4680+
VPRINTK(skdev, "skspcl_table kzalloc, struct %lu, count %u total %lu\n",
46724681
sizeof(struct skd_special_context),
46734682
skdev->n_special,
46744683
sizeof(struct skd_special_context) * skdev->n_special);

0 commit comments

Comments
 (0)