From patchwork Mon Feb 14 10:08:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12745376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5884C433F5 for ; Mon, 14 Feb 2022 10:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348919AbiBNKq4 (ORCPT ); Mon, 14 Feb 2022 05:46:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350657AbiBNKqi (ORCPT ); Mon, 14 Feb 2022 05:46:38 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2047.outbound.protection.outlook.com [40.107.237.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 966466C95F for ; Mon, 14 Feb 2022 02:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bFBr69ykm7HOiXoVaMvdSs/vkOT6ivmgYbkxA7ha4HODwrMfNfbIe+yKbDlFJhgH1Zw3mKRyygwe7uW6f4VgE2y9ATsWiOGWWUVmEbHI/u7B6gvMpxzHTOyNN/BN4H+ipaJuufx5ggzU5CO8d982ZUSyz2pq0WxNvo/2rlLb3NDZWho8IfHbaJbCAaNFjhTmXn/pR/whMYPI421nUqsPI0iCQ369JKFTtR0581ZgooNhrbJljqoEGlX6Jym0gzX5tsDIm/UL/h4e2wFk7DVXdAbjdowo+/xkddIPbFursrmyx37HVfRNGfR4b4qBSYoX81MNAMccI5822c1X7e2ZTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ACXMigh5fr8YxK3B3wPOVKoNPwLQ+izbXVJ4mLhVj58=; b=gj7nV44okxyTJn94bbEmfOaSf+FmzS4MUEBiM5Cgmy9d4iky3975kIEMxihPJHVBKfbE4hDWrkx6VdOMJFLnJKubWMl8qpKh9Pq4aj0L2BnWA4xFu/tfOzpgj+yGCe9jYfB+AN4NMDgCEhDfVXRkp4fjyFxmDh38Pb29oiGDO0oDfZ5i4afq2ATM6C7Sjpb4MS5KDNJaOiPcCOt8k2hs5RLN6WIu9Rv3qjOTYvG5umKN3mGU4VRml6SpKusgY5IQOEQwnOGbdA3+auzsWHDamG8RglkeQrTdoFFDpRLZtJKHAzHX1x+mYLEv1f7CZqSczRHR41OIZIEuezx3FydDxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=wdc.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ACXMigh5fr8YxK3B3wPOVKoNPwLQ+izbXVJ4mLhVj58=; b=Z2kxfID6RmYQvziXPLvOTfNLXYYa67NnPp5JD4ZXtDwY5H/Odr5Zfk4zSzarBHERAyCC1GzD+8BCcuFonRrS3h6vK76S0GS9/qAH9cQVmGYa+qCjGQfLKZW5ZVmUC3WXfVLsSleIfctwrfyUfPjBA5qinjMuo/6fH/ghSWKcDea6QIPMKG02QglpYOmiyNkZauNpEMoiZuH2oEwnHRExLrMowb6ayuG3wGT8k7aSjWVK6Q8HaL9n37Zm4WwWfHaamxwJWlhKROatYUxpD+eGvhK0ToRd1oDpIqm0d1xdTGXKgD4vpwotSeGYi3Et4MX56fFzQYWok88eTPGRnsjYTA== Received: from DM6PR02CA0130.namprd02.prod.outlook.com (2603:10b6:5:1b4::32) by MN2PR12MB2942.namprd12.prod.outlook.com (2603:10b6:208:108::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12; Mon, 14 Feb 2022 10:09:28 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::be) by DM6PR02CA0130.outlook.office365.com (2603:10b6:5:1b4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:09:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:09:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 14 Feb 2022 10:09:27 +0000 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 14 Feb 2022 02:09:27 -0800 From: Chaitanya Kulkarni To: CC: , , , , , Chaitanya Kulkarni Subject: [PATCH 1/4] blk-lib: don't check bdev_get_queue() NULL check Date: Mon, 14 Feb 2022 02:08:56 -0800 Message-ID: <20220214100859.9400-2-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220214100859.9400-1-kch@nvidia.com> References: <20220214100859.9400-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b4cd299-7391-4150-4ee8-08d9efa2163e X-MS-TrafficTypeDiagnostic: MN2PR12MB2942:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p75v9FqzW2mRoR8K2a1OujCJFKLlIZU+21ZIghT1eb1Xry2UpCAxXgrdmLshOXI6fEHzdflyfH+oB0BG1Hd79NSFPyxmZx6vBFBQg/baSWnkXn2BbjPWQqZAO9s/+wv7uApKzefH0r5vXDA8GSRGx+tltL8FT5k797lBfLzuyBilnaWKYNOBapZ4AVeFre39pa9Kpf29QbtdSunsgVpDvxFBkHqvAPil5g7yexuWRkGhbuC5IcQZAPqK8g5s3Pewx0QrvmB/Y8csweAVap3FccUaUbGYElVsYjrc2ZeS8rKAubal+4+tdBKvW4FEwS8bx47thXNGuobcIoklCCYoDbcgG7AnAWeTV/3sUR7wf7FxaZTlx4E9JO2PGuiTuCit3GZYG/0g5x7Lo3eRiqxixIaWN2XMTnlJ3QwyfvfI3LdBMoqV7uHc/KWJw+JTH/6twVQdN7UggwLEy6YQDIVW79qNXbLCHuVMnwSIx/PNHhKJ6y9nyXZUk1ECZXQ/ymfD/QAf+KMhfCR4B7s39jS16rrPUMAXO1FkAZhnj+1q0YG/EJsx1+YJqgOEr9aHYpSZgxZlUBGLdktcOwqlE9dL9f5WXl2VQOFsBiV+3xZQbP7HZxKz0m03dDjIk+1i0pewXgr58fGM0o/8LLB/8f3r9QViP8XXXABIkdCpLjqufcv1x86hK72isHVfkuATCEsYtcumbKA1xbbH/nqRFrHEfA== X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(508600001)(4326008)(6666004)(107886003)(7696005)(5660300002)(70586007)(70206006)(82310400004)(8936002)(8676002)(4744005)(316002)(6916009)(54906003)(40460700003)(36860700001)(83380400001)(81166007)(336012)(16526019)(426003)(356005)(2616005)(1076003)(2906002)(26005)(36756003)(186003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 10:09:28.4996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b4cd299-7391-4150-4ee8-08d9efa2163e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB2942 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Based on the comment present in the bdev_get_queue() bdev->bd_disk->queue can never be NULL. Remove the NULL check for the local variable q that is set from bdev_get_queue() in the function __blkdev_issue_discard(). Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 9f09beadcbe3..08ac56eb3a70 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -32,9 +32,6 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, unsigned int op; sector_t bs_mask, part_offset = 0; - if (!q) - return -ENXIO; - if (bdev_read_only(bdev)) return -EPERM; From patchwork Mon Feb 14 10:08:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12745377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5D7DC433F5 for ; Mon, 14 Feb 2022 10:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349218AbiBNKrU (ORCPT ); Mon, 14 Feb 2022 05:47:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348451AbiBNKqw (ORCPT ); Mon, 14 Feb 2022 05:46:52 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B8F85650 for ; Mon, 14 Feb 2022 02:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bLBhVNsLHU7rrTiDtF0D0MOoB8Mx9KMOsmz5/xelaE7mx5t6JqwwRNHaU8wf3OZuISSk9nI95qbkbdgQSI9VThvfGfx/6TxdD/xYsoX7W7Khfl6l5b4+UWnvo06g/JCL7/jRI4KzLCHFye38DUmXi422wYqlIuyagSGXADL2FvXDiHYT0XweedhDG30O4veIQSVNuUo3gIcXPyxGc5YN6ds4NKbWtzJxTes7vI+bYwtuD/fjr1rxpTCwbPLYWnsjdLq9vDB4nxOe+HeIBnAuOZG+82MAOpFf41vigWw8FQZ9QfJMUS51/EQoPndpKqRa/iWNB7I5/i2DrkcmUIZNuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QlzxcwN142BvZSNTCvDujXgH4I+VpWO2ni5+a6NkBqM=; b=BlzgT/T3E+TS1DiKckezrxwTxuzxbVpo/VEiEL+2poYED/1kLYFwZz6+mP3bQpwbbhu0CX63V5X5fukMoK23EEOeOmxp2MMvEvnEb9wCXeGzhpFGLNI66VeyAw6gb1qrJXkFmFSXsp3oXcFkjuMXQdHqG75baEtEZ9WVpd3Z2LRUkB0r1lVgwogGaCOIZ5fulOJqPQVtfB9jlL4LDnDu3Nl/mARCVr6OSXq8z43BUWDygtPVAuJSx/R1EM5d0sDIXr9LjPq47R41aLzU40ZSf3yM4G9fD4ezVs6QH9BNHwgcN17ZeLsLfrFZNRBOEZoOdlblA0voZntL30l6DobmTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=wdc.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlzxcwN142BvZSNTCvDujXgH4I+VpWO2ni5+a6NkBqM=; b=i3L3mIjRB8ZeqYLhIQHvGukvbS125asAFY+Hn6fgpEXgxhM4vZTLakKBtMPCXTwcKKGVBsH+e5Lfe6kNAhoVyQf86DO2B/j98z+XVnr3DJ/eqGGmkVhIKuN6g3T5ZcbjozeyKND2nbUvuVgTCyeMsNxCkzWy6uYDSbbG6oNxd5r0b0ARcwLXHbKKPUayD0GAMJ1/q5THEESQee7Ctg5ji2pVCVGznyrKyRwtNhu4+RAL0PB4WlAypXsWHKlwTnnNRfqhi23Sbtd1KQbxp9FInugFHM+fzzfkKyAU76uBKk7N1LXeyWfklQwtqsUl4u2A9E0IXfk6152p9QAAcrhxJg== Received: from DM5PR08CA0034.namprd08.prod.outlook.com (2603:10b6:4:60::23) by DM4PR12MB5245.namprd12.prod.outlook.com (2603:10b6:5:398::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Mon, 14 Feb 2022 10:09:39 +0000 Received: from DM6NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::eb) by DM5PR08CA0034.outlook.office365.com (2603:10b6:4:60::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:09:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT052.mail.protection.outlook.com (10.13.172.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:09:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 14 Feb 2022 10:09:39 +0000 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 14 Feb 2022 02:09:38 -0800 From: Chaitanya Kulkarni To: CC: , , , , , Chaitanya Kulkarni Subject: [PATCH 2/4] blk-lib: don't check bdev_get_queue() NULL check Date: Mon, 14 Feb 2022 02:08:57 -0800 Message-ID: <20220214100859.9400-3-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220214100859.9400-1-kch@nvidia.com> References: <20220214100859.9400-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f10eb2e9-0a90-49d1-936c-08d9efa21ce4 X-MS-TrafficTypeDiagnostic: DM4PR12MB5245:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RCTGJf32FZwysiYKsHk3XIckBZ7A74JDtB/ynYwex/TULMlNy5iBiLtJD8DjGaUiAsA24uqp8UMQC4OhO5LgwyG0+8hjxYAF+KUM8+TZgVQyPpWwoN0FZKV08FsEZsqyivbRe6E73rULpX28QFzB/UnR6na2aNGwZ90ruUmUFJO9OlWsDIVP4sEzSqtJD+uZSUDMXzqIpbrQvKxlEhJbUqoGJNiu30BMl5HdyMRX3s8P2GUSf8Qc6kPDck4wKUN0Pt+p9S0VBVpFGjaFXW1OLQgYyxdfv+pCudtnBvGKb5uv8TgnAqD+dPo1uAqPj+iM/73jxNLyuY4qbMY+rgTEQYBX/YVMXdm3b9dhZukJUCaApBLvA08uoZCGCzAllAhIqCdfzOfjri2q/28ByznlWBi4D5b1DiKePcL1BpN8ErU7PhCYGGrmD9nHRxjJbc4ZxyXPVwhEW8TFmr3NtI4zYdjrku0RUSCQXRQjWtF7qhaoKJKcKSPuM4ZVAt1AVcD48+gB/euIwuRL6eyR1MeD5BbtCxU0/KAIwd1JzY4GTkkLa9+bAZUFtES7KaXXAvcBw+T65Bm2XXaO07kytnMSj8e8Tim74Z4zhT0Fw5D5AluhCD7Aqecf6MKgfxLmurTEfufh4SObhSuiaUBKQS7+XR6W+PYGK3ksKhORDX8Rm2qzDYmr67HYY59vpKrnpLupl87GfwhPDlSibxTP7rcagg== X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(36860700001)(2906002)(7696005)(4744005)(83380400001)(2616005)(107886003)(1076003)(26005)(186003)(426003)(336012)(16526019)(47076005)(82310400004)(508600001)(316002)(8936002)(36756003)(54906003)(40460700003)(4326008)(70586007)(70206006)(8676002)(6916009)(6666004)(5660300002)(81166007)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 10:09:39.6868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f10eb2e9-0a90-49d1-936c-08d9efa21ce4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5245 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Based on the comment present in the bdev_get_queue() bdev->bd_disk->queue can never be NULL. Remove the NULL check for the local variabel q that is set from bdev_get_queue() in the function __blkdev_issue_write_same(). Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 08ac56eb3a70..473888d667a1 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -169,9 +169,6 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, struct bio *bio = *biop; sector_t bs_mask; - if (!q) - return -ENXIO; - if (bdev_read_only(bdev)) return -EPERM; From patchwork Mon Feb 14 10:08:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12745379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB03DC433FE for ; Mon, 14 Feb 2022 10:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349199AbiBNKsN (ORCPT ); Mon, 14 Feb 2022 05:48:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348850AbiBNKru (ORCPT ); Mon, 14 Feb 2022 05:47:50 -0500 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2063.outbound.protection.outlook.com [40.107.96.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661D0BA777 for ; Mon, 14 Feb 2022 02:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jiBvggMrhRlP0hfi2kAa3fcldu9xBTdcaKdEtyjHEimcLEMukAVgbWDm+QKJRuvgor17Z1JNTXgfDhfBqnsfG/VJXZYMySb/i9vd4IHJRLdKtV6+o6MEW0fAykt4KKq+yBwenBkXuB4mnMvkNxo4WoGKmR0Waxrc6HKFI/hGUYsRKkeHUfaSIp3htTkUVWmyGYpMTAHXDhzRRp9utAbscKXTfI8AnQBk/TI2qmVOHMHaQdX/gISF8eJdeBXwo0BU0rUuzns3WqWjggjR4gxzFkGVnWMe242r0sVGEwEClntg2Js91wBS97RSb28lV243u93WBOLIDLrw3f1Gus9QkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RWLP4rNw/sOjkmLxPQlHtMQx3nNNOSaIOPDSq4VPtIU=; b=BNzs0YjXJ2Rut8V+beopMmDrnh2KMOorsp+TQNDX+Jk/2HOMdgi2KSJFuENWpb03hMd1YPF3ghPb+LHH4n5dNFDCBYtSuaTtqkC7w2nfkBJZp9qeqXrAClMU7Qb5pe1IddK3nYFig/1Uc3vii/2RpsNFmUAWP4TXESc7nUbGvTmnsA6MyGmhgjocC6FUj8yZNSBfGErnuexkS9lfmN1vu0hIHMFSJBT4uSLcHss7UU/8zg17dnsQ99gzDr3eNoD0cd/5VTrLVn00JnsHzVp/RqepKJ6YG/wWjb5YfN2kVAkJuIxzgpDY+m94ikUyocuOUa6UPPcJIM4zuzQ5er+BmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=wdc.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RWLP4rNw/sOjkmLxPQlHtMQx3nNNOSaIOPDSq4VPtIU=; b=RoxIrEgWEAvAouahP/AwM5/1ZZjNwK5z1htYCjxB4Tm+kcKbZiqbdt/AApFuH7kU7f9FeeMyBkG7+6z6dCLp/405rLABdzL1zOZLQGFnO2WQnlWCU5K2IUHmqeV8hfgLdCsqu1+Xp7XXCp09Au3wwC4mXErTNcjuLnsHPxCgplzummClGvjG/WruC9ksBhIg242sYzKhgWgX7Cc93F67ykUz2E6TWPJ8KMnt2zNbIFMJCavCsy3E5sFtlo9nNYtfdELacUeasXMQ+hOQKb9gQk1hhb/sekTE67da1eXvLehEpiG8CHPCoK9Bvlja2KWqQpNFTZEvxqjeFWxsP2334A== Received: from CO2PR04CA0204.namprd04.prod.outlook.com (2603:10b6:104:5::34) by BYAPR12MB2741.namprd12.prod.outlook.com (2603:10b6:a03:62::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Mon, 14 Feb 2022 10:10:15 +0000 Received: from CO1NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:104:5:cafe::f7) by CO2PR04CA0204.outlook.office365.com (2603:10b6:104:5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:10:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT006.mail.protection.outlook.com (10.13.174.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:10:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 14 Feb 2022 10:09:50 +0000 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 14 Feb 2022 02:09:49 -0800 From: Chaitanya Kulkarni To: CC: , , , , , Chaitanya Kulkarni Subject: [PATCH 3/4] blk-lib: don't check bdev_get_queue() NULL check Date: Mon, 14 Feb 2022 02:08:58 -0800 Message-ID: <20220214100859.9400-4-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220214100859.9400-1-kch@nvidia.com> References: <20220214100859.9400-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 713afcf6-840f-4ce1-37b3-08d9efa2320b X-MS-TrafficTypeDiagnostic: BYAPR12MB2741:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vAqpCU9cx6U90wLZOUZ4kzYWPzoLW8o30jIJoQOg0tjtDooC+qF04UT8q2M46JWy6U8yDQAmztJoxB239id/XcjqNNttPkAEsmzIABpg5Zp6uTRC8P/Alqtw91ggp9/j3Ukc1oppyMGOZWTrdDKa9lqmpSjcfwxHSS8//yTE2Mtw3sPDHHSTKI+UhX28oLg/xoRJBN5y+tpw4BfEL3tA/CNl5H+0YRK1DDPh3pTL4AWtRCeWk+vIXq1g6a/UfXzyNOCVUa8mpZ3+s3PUj38v6VNrQtQBNQgtGO3XTrEMW6rIgyUmcGepI9raEQ1LKGFg9O5dPTiyUF9oN8JTCN4Jg/IATwVLCTnDISCxUIxnnyHIrBs8N9xZbbb4BjE6fPlkKirY/83N0q/mLLdgsfoz1UGdFanK2TVl+VyPWE67a9yZ5q4u1VEWCAvS6kBmlfFpNla+K5jFhW3EGGLf6yIs0GqcT6gxCzHl2qztfoxbeFDyAVoe3LYPa2Wry/j10M+pu33viTwt/oIzB8ffl1dG6kUtXhuGqZ3Vyg0Oiwu+tPCL53pjCXtRAW4ArrlXpT9sT/NmaXZK5EjVQTOPj8D3E6fMNrMpxfPKLcO+rT9oHrCgeKeOYaFbrqym1fpNMlJDPiGlw9aAZQvkJ6UyhXMu+iLVZO/5Nj0z6JceOaSCc7f1r+m1Xn0EkoVmjzNQbm/U8zFqCqclmV7sIkndZrNQ1g== X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(8936002)(70206006)(316002)(4326008)(7696005)(70586007)(8676002)(47076005)(36860700001)(54906003)(5660300002)(6666004)(508600001)(6916009)(81166007)(26005)(2616005)(1076003)(426003)(356005)(82310400004)(16526019)(2906002)(83380400001)(36756003)(186003)(4744005)(40460700003)(107886003)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 10:10:15.1722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 713afcf6-840f-4ce1-37b3-08d9efa2320b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2741 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Based on the comment present in the bdev_get_queue() bdev->bd_disk->queue can never be NULL. Remove the NULL check for the local variabel q that is set from bdev_get_queue() in the function __blkdev_issue_write_zeroes() and the respective NULL check. Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 473888d667a1..e7a9ed8cc5df 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -244,10 +244,6 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev, { struct bio *bio = *biop; unsigned int max_write_zeroes_sectors; - struct request_queue *q = bdev_get_queue(bdev); - - if (!q) - return -ENXIO; if (bdev_read_only(bdev)) return -EPERM; From patchwork Mon Feb 14 10:08:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12745378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6628BC433EF for ; Mon, 14 Feb 2022 10:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233498AbiBNKrv (ORCPT ); Mon, 14 Feb 2022 05:47:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349025AbiBNKro (ORCPT ); Mon, 14 Feb 2022 05:47:44 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17A8F6C923 for ; Mon, 14 Feb 2022 02:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jahVHxQTKzfHMXAkU4imCgTDpuFyUTabr7TXf0Mj9+IU3AorJtGDDnpAKNfJptKfpLD/c2303lIlsuhCHSlEfsNdH8sVzsUAC11HzJVN0E+OMyULLz6mb/iPymfX1xUolDRhFJYus0wUvl2OGxZz0SArYo1qmpEvKIMMNAXL8BkgtXPavgmEEPtICSs8JcgSDm9MMhWG87SyRrPeitIPymQM/lfIDdFWKCkQWkdnxuUBOuSEf+A0mTGtnEfytPeqyloX3bynYOJcqHoDG3cMUE0Uoa9n6JXgbfwfBcNLbHMWDTime0xG8rVfzsNrez+WEgmE1oFTqRxOPNqFkJ7ZbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gPlwqDd7TvC/4+kCUQSSNsPLDEhAKPVwk/1QK1jcZyA=; b=MXoLTL6JGeFx+VL3ZSsiPo22SD9lsI678RjjhLHhTE0rhoXepJH6s0tssr65oV3xhJf6ZEhah8mNfyzjryMf8Y/b8E3wp/EccaTgP5rfHgupUHeIfWruNyAmkrBueoUeSx1Ka1AqUK7/WpK5J5tK+eJolZweYzBgW50/oDglwuTyosZygsRk+5i2uuBJeaiG+Cm/IaXr43u57n4CHMCn0/DYpiYPsdJgsg3tBzJQfNPg9GHap/kftxfBEWvt6FH4DjWbp3XCmD6DIDgF/AQ/RcSfsrR0+q5TJoROgkjv6WxIFhuNATsaB6Xzyz2OZ4NFx5QlGCRh9S8OrfHd/dnsXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=wdc.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gPlwqDd7TvC/4+kCUQSSNsPLDEhAKPVwk/1QK1jcZyA=; b=e9CQyGvZ1qGNyNMqhu5PpIdyOqlDNqsDlPogDuIKlpxE2C5eKJY5DhveaboOdqwSP5iWu4yZB/H5RmZuQoDHH5j3NZDVPkFszNT0SEC/iaV43zSusD/wcjK7LTQw2oJfYuV3D4kQ3rMdn060Wy0JRPcg1+6NW64TEtkEch8xs0+n6WoENcDLAj8qGShihdfAKjU/TnEdBofjgK01H8cVKwivTlZ3h+UZcdUI4EZn1N8I1vUq7T056muPjsbMOgKPY087cZWim8tNzRGBfdbWqGP9lfsn/rPvEbbeG0zxLCE8KORTu0YCoQQkoVXbgxOjKaqHpUMFnmg0IvAz4A63YQ== Received: from DM6PR01CA0005.prod.exchangelabs.com (2603:10b6:5:296::10) by LV2PR12MB6014.namprd12.prod.outlook.com (2603:10b6:408:170::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Mon, 14 Feb 2022 10:10:02 +0000 Received: from DM6NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::c0) by DM6PR01CA0005.outlook.office365.com (2603:10b6:5:296::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:10:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT026.mail.protection.outlook.com (10.13.172.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 10:10:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 14 Feb 2022 10:10:01 +0000 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 14 Feb 2022 02:10:00 -0800 From: Chaitanya Kulkarni To: CC: , , , , , Chaitanya Kulkarni Subject: [PATCH 4/4] blk-lib: don't check bdev_get_queue() NULL check Date: Mon, 14 Feb 2022 02:08:59 -0800 Message-ID: <20220214100859.9400-5-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220214100859.9400-1-kch@nvidia.com> References: <20220214100859.9400-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e34cbf3-9047-47aa-a024-08d9efa22a20 X-MS-TrafficTypeDiagnostic: LV2PR12MB6014:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBMYV+hSmXeDeaifGgWC3QRgPEenZhc5HLVI+bZnXgmDl97es3nIzRSVMfmQS51mNpc6OoJprz0BOsZDgJvmXeHpyBFtR18oCRQjUIkvZTpHoxDMLGbUY9qxFckMPO/4T9WEYnHIRodki5MmHbWEBUEk6vfQqcZPWxNVdg0sjTHFbLfhSGQlROdXo6vbBrJ67cCaRSI5abDZN7gH6X0yGFfuUn68D6Z13HRUhZzoWPLpjKpA5zqU0Dyr4BI2yGAKbNdpC5etq7WFPLT9/yIhAtpPd61erN6ku3kb+FlgAgjJumuWYvEq6HMh9bp+A9AmRwxYxbhfHCLzdu50uCC7iKBHIXOeHAUeUxv78XUfJEvrnxPdFk1Ja5rcUivJrjyBuVdYxz6B5Xx7U1jnXJFdK52qKlfr/d0xFbfbDsiDflGFrZr/Cg09PXr9sM6OkCocLsFwgCtetQI8aLCA2IZ1QTiQh6fempY1PnMIGUHJ/SOg6EupqPJxrVZAES90V2rcis6f8tcLysaGTzwD25OIj+N3cxpGbHBgJWxs9R25CvlI+C38mWIWONYdbAi1l47IjBX7FT3Ozoba71wYYND0dXkPNyHt4vX+jCwHwB9Hvb4ENAtoGFLsaLLmziRBkKvxZb0SuIcuiEsa8jpGpez6TYZqSJCpz8svchFxDYKY6VoDHFcbtv7q9dGOain3yZa0BZZmUtOwGFbb/WY2qPLK0Q== X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(54906003)(36756003)(316002)(6916009)(7696005)(40460700003)(508600001)(82310400004)(107886003)(16526019)(70206006)(4326008)(36860700001)(186003)(26005)(81166007)(83380400001)(356005)(2906002)(2616005)(5660300002)(70586007)(47076005)(8676002)(336012)(1076003)(8936002)(426003)(4744005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 10:10:01.9220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e34cbf3-9047-47aa-a024-08d9efa22a20 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB6014 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The queue variable is only used to check if it is NULL or not in __blkdev_issue_zero_pages(). The return value of the bdev_get_queue() will not be NULL based on the comment in the bdev_get_queue(). Remove the variable and respective NULL check. Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index e7a9ed8cc5df..e6e854936ef6 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -294,14 +294,10 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct bio **biop) { - struct request_queue *q = bdev_get_queue(bdev); struct bio *bio = *biop; int bi_size = 0; unsigned int sz; - if (!q) - return -ENXIO; - if (bdev_read_only(bdev)) return -EPERM;