Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1353470iob; Fri, 29 Apr 2022 03:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBD2lvp0JYLhKjJxWbMEor39bdCOwiXLOee3FCITxjktZjfSCeTcANXuqmpus+A2hMPlFk X-Received: by 2002:a05:6512:1510:b0:445:cbc3:a51f with SMTP id bq16-20020a056512151000b00445cbc3a51fmr27822407lfb.116.1651229005682; Fri, 29 Apr 2022 03:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651229005; cv=none; d=google.com; s=arc-20160816; b=KKlZoI1TsYvJVOML2EsXhTFQTCdYNN6QLre2f5EHqNwg1GO/XuJQv7s2dZbqgAET2B Q1+jOoY1X86r9YNfg2/I705fnP5wDFTz/kVKLSTBwTL4i4/uYehVpacmz9PUmLiRQYWE FBeEdPkb90vnvz99JFeXR7oTJmldaQk0J9EUuDrdq58CeTtctLBkYZlGd0Jc+k4ItjvW YrWItt2A/RI38XuyL90+9Fb0GWeevupNrtqJ0bQPhjIWLjJBmb/7J7vZtmyij8fvXAw1 TbB2WVMwxsl3WV2DBaDdOtm6ch9e3JR6LGB4aivoMhQ0Btm9DY8nxDs8KTodi16Q90XE s+uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=qIVZ/5njtCJ4cvDF1PdJLxdRJvf7JhCQtVuD5bV6nVw=; b=oh+GqnfCHjEc9/jQZ5J3gq9mfp7H2bIZ4VH3udhUYw64qWBSUNguOqh3qWkZf8xDwb Ij3Ld+yY4oL61sYNiD3SlP5bRbI89hoXn6DGI9+PJxqhAeTFJYzL/iXpyLC3G2kQjgy0 PxedtuTzUO/Jgg67u8mk622M0jwWjru4UhxEKBCSSVCqr8NmQMZIlD1iF0fEeB7qxgXK fUekVZgyaC2JdBJJUpjniFyWtOHO3mJ6vYLp+0CPuT9v2kHFa1YokKGlrKc/M8zczKZd q7QsOG7825HnyT9Hsef49cAnB/jx87FQJjJZxBZHMRaBW0G7ghLicerVyX7xj/KMLISY NTQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="BcN9X/wP"; 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=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a2e83c9000000b0024dc18df88csi7326777ljh.521.2022.04.29.03.42.57; Fri, 29 Apr 2022 03:43:25 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b="BcN9X/wP"; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345909AbiD1PoQ (ORCPT + 99 others); Thu, 28 Apr 2022 11:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231452AbiD1PoO (ORCPT ); Thu, 28 Apr 2022 11:44:14 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F82871A3F for ; Thu, 28 Apr 2022 08:40:59 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220428154057euoutp01b85ad61d8a66078a736f97d1a1a62db8~qGbAfGLEZ0525905259euoutp01I for ; Thu, 28 Apr 2022 15:40:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220428154057euoutp01b85ad61d8a66078a736f97d1a1a62db8~qGbAfGLEZ0525905259euoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1651160457; bh=qIVZ/5njtCJ4cvDF1PdJLxdRJvf7JhCQtVuD5bV6nVw=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=BcN9X/wPcuysc3dPQd+NHeeh+Sj2MY26EZte4EcjNi+h2fAU3U2nIZW6NyXY6YxIG kYCMPW/oK0IlXiJ7XyvbWz0VpHW7RvDytkwXZNudlB+Rn9q42Ii628nI/gtquoKt3h UzyB+1qN7S9dEMZCxBVkirKFuzcj4PUR7l37wfq8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220428154057eucas1p1859b8d27035473774fc5196cf65d872b~qGbAEihw82372423724eucas1p1D; Thu, 28 Apr 2022 15:40:57 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FC.C2.10260.985BA626; Thu, 28 Apr 2022 16:40:57 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220428154056eucas1p19857af33432f0b85c5288f6da6c94689~qGa-taHyJ2297022970eucas1p1p; Thu, 28 Apr 2022 15:40:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220428154056eusmtrp2c132a078b183a559f95cc0004977defe~qGa-sRNyG1849218492eusmtrp2I; Thu, 28 Apr 2022 15:40:56 +0000 (GMT) X-AuditID: cbfec7f5-bddff70000002814-39-626ab589cc99 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A2.95.09404.885BA626; Thu, 28 Apr 2022 16:40:56 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220428154056eusmtip2ca9440e07c68c7a304db9fdf2ba6a044~qGa-avJns0625606256eusmtip2X; Thu, 28 Apr 2022 15:40:56 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.162) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 28 Apr 2022 16:40:54 +0100 Message-ID: <858a5977-e54a-dfa2-c627-56db113128f0@samsung.com> Date: Thu, 28 Apr 2022 17:40:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 03/16] block: add bdev_zone_no helper Content-Language: en-US To: Damien Le Moal , , , , , , , , , CC: , , , , , , , , , , , , , From: Pankaj Raghav In-Reply-To: <652c33b5-1d85-e356-05b9-7bd84b768143@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.210.248.162] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJsWRmVeSWpSXmKPExsWy7djP87qdW7OSDO6tY7NYf+oYs8Xqu/1s FtM+/GS2OD31LJPFpP4Z7Ba/z55ntrjwo5HJYuXqo0wWT9bPYrboOfCBxeJv1z2gWMtDZos/ Dw0tJh26xmjx9OosJou9t7QtLu+aw2Yxf9lTdosJbV+ZLW5MeMpoMfH4ZlaLda/fs1icuCXt IO5x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2Tf/VO8425Oo57lD/IM8 x9SADwtS7vctO+LZuTC3xvmoaHrK+ZbmDe9zPHg2bvXcOTvIKyHqlOZtYS6rPZv+Pv7DZivS Vlrg5TM9eRW/puqtvxsLUj6WfjErXpcq0v3Ci039S+4WfccZ16v79s/o2fnyzcvrf115DQ21 n03cZPbkh/E74Tw7Wz8lluKMREMt5qLiRADl6meT6wMAAA== X-CMS-MailID: 20220428154056eucas1p19857af33432f0b85c5288f6da6c94689 X-Msg-Generator: CA X-RootMTR: 20220427160259eucas1p25aab0637fec229cd1140e6aa08678f38 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220427160259eucas1p25aab0637fec229cd1140e6aa08678f38 References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-4-p.raghav@samsung.com> <652c33b5-1d85-e356-05b9-7bd84b768143@opensource.wdc.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, 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 On 2022-04-28 01:31, Damien Le Moal wrote: >> +static inline unsigned int bdev_zone_no(struct block_device *bdev, sector_t sec) >> +{ >> + struct request_queue *q = bdev_get_queue(bdev); >> + >> + if (q) > > q is never NULL. So this can be simplified to: > That is a good point. I just noticed it in the bdev_get_queue() function that q can never be NULL. I will fix it up. All the functions `bdev*` have this pattern, so probably they could be simplified as well in the future. > return blk_queue_zone_no(bdev_get_queue(bdev), sector); > >> + return blk_queue_zone_no(q, sec); >> + return 0; >> +} >> + >> static inline unsigned int bdev_max_open_zones(struct block_device *bdev) >> { >> struct request_queue *q = bdev_get_queue(bdev); > >