Skip to content

Commit 6105d1f

Browse files
mgurtovoymstsirkin
authored andcommitted
virtio-blk: remove unneeded "likely" statements
Usually we use "likely/unlikely" to optimize the fast path. Remove redundant "likely/unlikely" statements in the control path to simplify the code and make it easier to read. Reviewed-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Max Gurtovoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]>
1 parent 81a83d7 commit 6105d1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/virtio_blk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static int virtblk_probe(struct virtio_device *vdev)
765765
goto out_free_vblk;
766766

767767
/* Default queue sizing is to fill the ring. */
768-
if (likely(!virtblk_queue_depth)) {
768+
if (!virtblk_queue_depth) {
769769
queue_depth = vblk->vqs[0].vq->num_free;
770770
/* ... but without indirect descs, we use 2 descs per req */
771771
if (!virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC))
@@ -839,7 +839,7 @@ static int virtblk_probe(struct virtio_device *vdev)
839839
else
840840
blk_size = queue_logical_block_size(q);
841841

842-
if (unlikely(blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE)) {
842+
if (blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE) {
843843
dev_err(&vdev->dev,
844844
"block size is changed unexpectedly, now is %u\n",
845845
blk_size);

0 commit comments

Comments
 (0)