Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3028920pxb; Mon, 18 Oct 2021 06:55:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyIobr7XL44qpdLjtExAxT0Jx9ohskplGbfEHWA7son6bPL6xMPJYVd0tFwu9MQk0+vMKP X-Received: by 2002:a17:907:1b04:: with SMTP id mp4mr17855683ejc.57.1634565355296; Mon, 18 Oct 2021 06:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565355; cv=none; d=google.com; s=arc-20160816; b=GOPEds1AQKlJSrjJvC47bG9zqcWzg9CKMswasGKNtARb4WlALq92MAxlT1g14PkC8e 1ZFfZiPnKNyRIYMEI5ShxARDFEio69viuQXQcsQI53aTzXEBHNe4a0aPtmklEme4WIPU VqTdgQk6IFzPnVl1r22OMhM5bqZQEH0e0A1ARcLNyKU2LHxj0k1Lt3BND2qAYKtfU728 3bAv+hY9c8pjbFlaIAbHftkabZalhp8eYTESDOG+iL34+WrgEEqhtqgzQg2aSh8ALVn4 NhHzis4azhbY1gkSs5nmQ1f1n8nMh0iDeejwhLv5OPvoHqtznw7cLI09PWA4seZYZnum lUrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l0+zQutQWyAtOt98PwcERErd9vn6urWgILGY60Ibm2I=; b=GXjbYjnhjXPT+024tEngqAFsCEy/u8b19Ais7XYTTiLDUoP6/Tm/Vb0lFEAR1e6eMc hiIpPJg+SQGMckjcvdRciZ0E3/XxVV2IpoM809insfpsq4UES6WoA+o2ESBzj12Du3qP 0MW8k8MVyzmAQh9In3QwF/mQy5YG8gmdx5xQ00i6EhAALWmpbciJ4dIaZuWr+g3FIlfh FX28eMoiTtw+anD6dzH8EGTF2NlmWQiY16lUmwh44EnpuAQwy8WIlwEJrBrmxT9keY85 8yh10n2fAygA0l1Buh4QvN6DMwTtdKzhkfwiNwo7qKuG0L8z6bBPSyoFaWzkhmsp+ntl gOXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f9SDli1d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si21091705edk.180.2021.10.18.06.55.31; Mon, 18 Oct 2021 06:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f9SDli1d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234414AbhJRNz7 (ORCPT + 99 others); Mon, 18 Oct 2021 09:55:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:58122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234425AbhJRNxv (ORCPT ); Mon, 18 Oct 2021 09:53:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 84A08619E4; Mon, 18 Oct 2021 13:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564356; bh=ib/xevrLUR0c/2TEb2suW9cNY1t6krRKSP7YFHh3+sA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f9SDli1dXBFu9DcjENpm1FR2+UMFRtKNT1iu1/JrBghBsPJb+KdNXcZ8cIpSY8zlO idpnfBfeuVmQfRYSsjRsQdmF/4ZxhOZ7vnvpzpdANAHkS7oMIdOil5syjMmK4vuWBY QXPwSA7+UgU58M2oxHRMCw8WbCMnBe0oi4q3YtCE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Hajnoczi , Max Gurtovoy , "Michael S. Tsirkin" , Chaitanya Kulkarni , Christoph Hellwig Subject: [PATCH 5.14 058/151] virtio-blk: remove unneeded "likely" statements Date: Mon, 18 Oct 2021 15:23:57 +0200 Message-Id: <20211018132342.579875204@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Gurtovoy 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 Signed-off-by: Max Gurtovoy Link: https://lore.kernel.org/r/20210905085717.7427-1-mgurtovoy@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed-by: Stefan Hajnoczi Signed-off-by: Greg Kroah-Hartman --- 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);