Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1060146pxb; Thu, 9 Sep 2021 19:24:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc81/cHCd0JwU8eCaX2zHwkqIWuAWWiF7xdOlGdK3Vaubx3y3H8MIYyU7o31+7hsWp+/Wk X-Received: by 2002:a05:6602:2e13:: with SMTP id o19mr5305374iow.9.1631240696423; Thu, 09 Sep 2021 19:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631240696; cv=none; d=google.com; s=arc-20160816; b=qvMadU9ypbsc/Kmns9rxs+3i8dBJ0SFBm02F3OO+RHd7WRCXnOJLlj6GkFAG87SIm/ gU6oa96hFIcMaInwset1qkT+KtP6X7apBghuDv+oTu71tDcjmzQTukNyYYf7yxPK71Hy /5wuzrBSmFSW4ilIbmE8cAAvObZw91s2mCs8GIYpUpfmPAzGvZsHkLbAvvHsuVUdMPo4 H3cVMmv5otiNKXJd1/Bejt8SKDVUA31U2+Czf9NfzcVi4H0Rrs6cPUBhKvpZfNLSn6QC Z6GyR9fqrj/UfvojL1WjwE6jNW1RLaB9DdP7RypyIT0ZyFkXX3cnjPzotzWmTKO6GdDq ZYVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=OFkZouuk/uQlO4BAHU4c89xRGoK09WP4z7pukJTLVow=; b=pyULfaFD5zPIk8ZwBrfPQn/OGHcMh0rzBOrR6KQUX/apoBcSwAmwGNcSFeDL+4fR9J KTIurkX+GW9vxmmHGv6XDfzfTa2lGXDamx/n2JK/jQCJkbFyKpkxptvSUrJHTcIFTY6u Fal+qpM+qHCjZWNcUVRXbzInpyuVJ7mtY8k1Tv7cfAsC+95HQRlawsm+JqTINYZYfn5V atmLch9agtYF5OCxmrrUkUDKNlWCe6GGNJc+6tRkGQvLOvITEZAwuM5cX30taHN4bu23 4RCFcKtcMlGxYoGERmMjoMicXXGoJnSbZuohoXm5rl/4ICevi6+BRxKQrAg10gcCnLj7 O+sg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si4771184ilu.79.2021.09.09.19.24.44; Thu, 09 Sep 2021 19:24:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbhIJCZO (ORCPT + 99 others); Thu, 9 Sep 2021 22:25:14 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:33028 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229628AbhIJCZO (ORCPT ); Thu, 9 Sep 2021 22:25:14 -0400 Received: from localhost.localdomain (unknown [124.16.141.243]) by APP-03 (Coremail) with SMTP id rQCowADHznqtwTphvvIJAA--.9900S2; Fri, 10 Sep 2021 10:23:41 +0800 (CST) From: Xu Wang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] blk-zoned: Remove needless request_queue NULL pointer checks Date: Fri, 10 Sep 2021 02:23:38 +0000 Message-Id: <20210910022338.22878-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowADHznqtwTphvvIJAA--.9900S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZw4fCry8Gr15Cw45Xw17GFg_yoW3KFc_Xr 10v397Xrs5XFs8ur4qyFyUZ3Zavas7GF4IgFWIqasFgas3W3ZxArW3Wrn8urZrW3yUGr15 Zr45urZxXr1xXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcxYjsxI4VWkCwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwV C2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVAC Y4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVW8Jr 0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY02Avz4vE14v_Gr1l 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8k-BtUUUUU== X-Originating-IP: [124.16.141.243] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCgkAA1z4j8R70gAAsG Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The request_queue pointer returned from bdev_get_queue() shall never be NULL, so the NULL checks are unnecessary, just remove them. Signed-off-by: Xu Wang --- block/blk-zoned.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 1d0c76c18fc5..5160972a009a 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -354,8 +354,6 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, return -EINVAL; q = bdev_get_queue(bdev); - if (!q) - return -ENXIO; if (!blk_queue_is_zoned(q)) return -ENOTTY; @@ -412,8 +410,6 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, return -EINVAL; q = bdev_get_queue(bdev); - if (!q) - return -ENXIO; if (!blk_queue_is_zoned(q)) return -ENOTTY; -- 2.17.1