All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] virtio-blk: remove unneeded "likely" statements
@ 2021-08-30 12:01 Max Gurtovoy
  2021-09-02 15:00   ` Stefan Hajnoczi
  0 siblings, 1 reply; 6+ messages in thread
From: Max Gurtovoy @ 2021-08-30 12:01 UTC (permalink / raw)
  To: mst, virtualization, kvm, stefanha; +Cc: oren, linux-block, axboe, Max Gurtovoy

Usually we use "likely/unlikely" to optimize the fast path. Remove
redundant "likely" statements in the control path to ease on the code.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/block/virtio_blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index afb37aac09e8..e574fbf5e6df 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -765,7 +765,7 @@ static int virtblk_probe(struct virtio_device *vdev)
 		goto out_free_vblk;
 
 	/* Default queue sizing is to fill the ring. */
-	if (likely(!virtblk_queue_depth)) {
+	if (!virtblk_queue_depth) {
 		queue_depth = vblk->vqs[0].vq->num_free;
 		/* ... but without indirect descs, we use 2 descs per req */
 		if (!virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC))
@@ -839,7 +839,7 @@ static int virtblk_probe(struct virtio_device *vdev)
 	else
 		blk_size = queue_logical_block_size(q);
 
-	if (unlikely(blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE)) {
+	if (blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE) {
 		dev_err(&vdev->dev,
 			"block size is changed unexpectedly, now is %u\n",
 			blk_size);
-- 
2.18.1


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

end of thread, other threads:[~2021-09-03  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 12:01 [PATCH 1/1] virtio-blk: remove unneeded "likely" statements Max Gurtovoy
2021-09-02 15:00 ` Stefan Hajnoczi
2021-09-02 15:00   ` Stefan Hajnoczi
2021-09-02 19:13   ` Max Gurtovoy
2021-09-03  9:04     ` Michael S. Tsirkin
2021-09-03  9:04       ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.