Skip to content

Commit 292660f

Browse files
Dima Stepanovaxboe
authored andcommitted
block/rnbd: Fix style issues
This patch fixes some style issues detected by scripts/checkpatch.pl * Resolve spacing and tab issues * Remove extra braces in rnbd_get_iu * Use num_possible_cpus() instead of NR_CPUS in alloc_sess * Fix the comments styling in rnbd_queue_rq Signed-off-by: Dima Stepanov <dmitrii.stepanov@ionos.com> Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com> Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com> Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Link: https://lore.kernel.org/r/20210428061359.206794-3-gi-oh.kim@ionos.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 80d43cb commit 292660f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/block/rnbd/rnbd-clt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int rnbd_clt_set_dev_attr(struct rnbd_clt_dev *dev,
8888
dev->discard_alignment = le32_to_cpu(rsp->discard_alignment);
8989
dev->secure_discard = le16_to_cpu(rsp->secure_discard);
9090
dev->rotational = rsp->rotational;
91-
dev->wc = !!(rsp->cache_policy & RNBD_WRITEBACK);
91+
dev->wc = !!(rsp->cache_policy & RNBD_WRITEBACK);
9292
dev->fua = !!(rsp->cache_policy & RNBD_FUA);
9393

9494
dev->max_hw_sectors = sess->max_io_size / SECTOR_SIZE;
@@ -351,9 +351,8 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess,
351351
struct rtrs_permit *permit;
352352

353353
iu = kzalloc(sizeof(*iu), GFP_KERNEL);
354-
if (!iu) {
354+
if (!iu)
355355
return NULL;
356-
}
357356

358357
permit = rnbd_get_permit(sess, con_type, wait);
359358
if (unlikely(!permit)) {
@@ -805,7 +804,7 @@ static struct rnbd_clt_session *alloc_sess(const char *sessname)
805804
mutex_init(&sess->lock);
806805
INIT_LIST_HEAD(&sess->devs_list);
807806
INIT_LIST_HEAD(&sess->list);
808-
bitmap_zero(sess->cpu_queues_bm, NR_CPUS);
807+
bitmap_zero(sess->cpu_queues_bm, num_possible_cpus());
809808
init_waitqueue_head(&sess->rtrs_waitq);
810809
refcount_set(&sess->refcount, 1);
811810

@@ -1148,7 +1147,8 @@ static blk_status_t rnbd_queue_rq(struct blk_mq_hw_ctx *hctx,
11481147
iu->sgt.sgl = iu->first_sgl;
11491148
err = sg_alloc_table_chained(&iu->sgt,
11501149
/* Even-if the request has no segment,
1151-
* sglist must have one entry at least */
1150+
* sglist must have one entry at least.
1151+
*/
11521152
blk_rq_nr_phys_segments(rq) ? : 1,
11531153
iu->sgt.sgl,
11541154
RNBD_INLINE_SG_CNT);

0 commit comments

Comments
 (0)