Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3202570rwb; Mon, 16 Jan 2023 05:12:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXs5D6e7fty6mAoEf8CZHsbYyXDfcR6LVn304To1Eb0OLTWFLIrU/wkYNEA+gxVjs+qIpeTD X-Received: by 2002:a05:6402:5387:b0:499:b3b4:3572 with SMTP id ew7-20020a056402538700b00499b3b43572mr29918656edb.20.1673874762077; Mon, 16 Jan 2023 05:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673874762; cv=none; d=google.com; s=arc-20160816; b=DwvgysvERbPJW56TAJRCFpZorLIhTT5XysrhJGOfPZm8zvOAkgpLZpSXonAREcRLHd CgjF6StP63aWu8NCt5gdj2OjKOxrhlNMczVL5/9lNlHCvdSESIy6kfk4ZF2uYZAYeVv/ vS2p70eLRFOrhI/gzcMkrq5drGKpxWH4JLBMFIGzZJAd4RQzGRFaYgTwFqqHboeun8Ev 1rTDyaI4ntQHcZ1kRlXpDGhsjEQO/yQsE9E5bC+QY5NpIqpgq79ExSZYB4kksEqX88KG 1cYY0njlwweLd+oy8rP7OyNYiMp22Yxns3SasxjQFTe3CJ7v93YBMm5BH1xSWFoJBmrp LglQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vu/nkh3n6CUef7i0kK+BljjRoWaSv8wuL6xCYGRdJMc=; b=KbTxMio41LP8uJtkzxcS1cmgmzm2WfCymmhEwsKkKFOVqUMt+EH14eVqyrJdwmXfUL fBqCR3+TmiIK6jayTNlCEJj16YvVWM7m/yHnw7PjV7Zz6pkazhY3AF730Wwaju66zhpc 8p2UK0gpPKoTkRecOmDJF93J6B6Rp1lPCVvjShbB3P+4N/2d55viY1fTB8c+OtVezZAH G1rc/6P4F1lqQxf/7XkJxTfwzTt91puy6Z8//sIqNqx3IYNShLXf7lFh2CbXvdTw+nJY zKOixBYHUCjBVMHkNIkewkeFuy8qKSINvlf/b4DmKTvFA8Cf+WI6oaCqrooNS2OfUm7i 5PTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aEBoKJSx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a05640205cd00b0048024f3aec4si8935489edx.617.2023.01.16.05.12.29; Mon, 16 Jan 2023 05:12:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aEBoKJSx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbjAPNHa (ORCPT + 51 others); Mon, 16 Jan 2023 08:07:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbjAPNGu (ORCPT ); Mon, 16 Jan 2023 08:06:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3164A5E5; Mon, 16 Jan 2023 05:06:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9DA52B80D31; Mon, 16 Jan 2023 13:06:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84A50C433EF; Mon, 16 Jan 2023 13:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673874407; bh=JlISh7ZpJM1JouHMtly+4IcB63O1MxsyN1Eywkp8Wsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEBoKJSxCjguG2DHqyA7O8qM4GE3x282g/b/CwTfZAS4zWD4B6wASQ+jEB5v/9zR/ ghrEPqNMvev2QZmBhfekV3oRIuWjuTMKqu+Tzfqn8kldJwTA8QYAxUbuyHvhGL80BM QdA4d1/nx3Ly5CVTs3zgz2eyIgWBsTZ5eAcizz+q/laOZkFfW1DiI9wgCVeZrkKahJ +g3SoDr4gJw/IVa0yBpVcsJEhstqA9mYnolCld9y2SO7DzLDOhhyLv3ueEl/plNU8I RLCCMIed/IZ9bzeQdgF5gf/J2ek6Vtx4EP26J7GKfgPLdqlLQWH17T/t1+hT8LCDHf vrmptUx/xttaw== From: Leon Romanovsky To: Jason Gunthorpe Cc: Israel Rukshin , Bryan Tan , Christoph Hellwig , Eric Dumazet , Jakub Kicinski , Jens Axboe , Keith Busch , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Max Gurtovoy , netdev@vger.kernel.org, Paolo Abeni , Saeed Mahameed , Sagi Grimberg , Selvin Xavier , Steven Rostedt , Vishnu Dasa , Yishai Hadas Subject: [PATCH rdma-next 11/13] nvme: Introduce a local variable Date: Mon, 16 Jan 2023 15:05:58 +0200 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Israel Rukshin The patch doesn't change any logic. Signed-off-by: Israel Rukshin Signed-off-by: Leon Romanovsky --- drivers/nvme/host/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 7be562a4e1aa..51a9880db6ce 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1870,6 +1870,7 @@ static void nvme_update_disk_info(struct gendisk *disk, sector_t capacity = nvme_lba_to_sect(ns, le64_to_cpu(id->nsze)); unsigned short bs = 1 << ns->lba_shift; u32 atomic_bs, phys_bs, io_opt = 0; + struct nvme_ctrl *ctrl = ns->ctrl; /* * The block layer can't support LBA sizes larger than the page size @@ -1892,7 +1893,7 @@ static void nvme_update_disk_info(struct gendisk *disk, if (id->nsfeat & NVME_NS_FEAT_ATOMICS && id->nawupf) atomic_bs = (1 + le16_to_cpu(id->nawupf)) * bs; else - atomic_bs = (1 + ns->ctrl->subsys->awupf) * bs; + atomic_bs = (1 + ctrl->subsys->awupf) * bs; } if (id->nsfeat & NVME_NS_FEAT_IO_OPT) { @@ -1922,7 +1923,7 @@ static void nvme_update_disk_info(struct gendisk *disk, if (IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY) && (ns->features & NVME_NS_METADATA_SUPPORTED)) nvme_init_integrity(disk, ns, - ns->ctrl->max_integrity_segments); + ctrl->max_integrity_segments); else if (!nvme_ns_has_pi(ns)) capacity = 0; } @@ -1931,7 +1932,7 @@ static void nvme_update_disk_info(struct gendisk *disk, nvme_config_discard(disk, ns); blk_queue_max_write_zeroes_sectors(disk->queue, - ns->ctrl->max_zeroes_sectors); + ctrl->max_zeroes_sectors); } static bool nvme_ns_is_readonly(struct nvme_ns *ns, struct nvme_ns_info *info) -- 2.39.0