lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 18 Oct 2021 15:23:57 +0200 From: Greg Kroah-Hartman <gregkh@...uxfoundation.org> To: linux-kernel@...r.kernel.org Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, stable@...r.kernel.org, Stefan Hajnoczi <stefanha@...hat.com>, Max Gurtovoy <mgurtovoy@...dia.com>, "Michael S. Tsirkin" <mst@...hat.com>, Chaitanya Kulkarni <ckulkarnilinux@...il.com>, Christoph Hellwig <hch@....de> Subject: [PATCH 5.14 058/151] virtio-blk: remove unneeded "likely" statements From: Max Gurtovoy <mgurtovoy@...dia.com> commit 6105d1fe6f4c24ce8c13e2e6568b16b76e04983d upstream. 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 <stefanha@...hat.com> Signed-off-by: Max Gurtovoy <mgurtovoy@...dia.com> Link: https://lore.kernel.org/r/20210905085717.7427-1-mgurtovoy@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@...hat.com> Reviewed-by: Chaitanya Kulkarni <ckulkarnilinux@...il.com> Reviewed-by: Christoph Hellwig <hch@....de> Reviewed-by: Stefan Hajnoczi <stefanha@...hat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org> --- drivers/block/virtio_blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -765,7 +765,7 @@ static int virtblk_probe(struct virtio_d 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_d 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);
Powered by blists - more mailing lists