Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1752471pxb; Sun, 10 Jan 2021 09:24:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6zrymuFjDzaLtaxYau21dmhI6ESJakl8qDdoQsKxzf8x+zeDIPoay6fOAuLiEvbYfzWtW X-Received: by 2002:a17:906:e247:: with SMTP id gq7mr8842908ejb.27.1610299487746; Sun, 10 Jan 2021 09:24:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610299487; cv=pass; d=google.com; s=arc-20160816; b=f58Lyzk6vKKphKCL3H2tdtJfkaUVKDe9H3pMA1cEYhEDTkR9F+zodUdfesaTJZlFkx r+KTfPJCtWWyruswzqTvVWOmEdICcQZ8RvGqo3F3iHNuHyn28MlQo982IlNS3S/QlbNj VqLBBXhJYhTZcK2CgnhpJrgjAQbKZOadfBbIOsC8eSCJn72P4UC7Rp1O0ZgESI/Gu1Hn XDwkpdU4YiuLLQ+fg8rC0E4ty1lYiYwsGToGiJAVCOkFcMTsw7u/aJIPirqItl53RDPl W699AquUkoSYuAlDYefFFFP/Fdo1VsOCiqHqN7teLRf7qrTP7Tk3qcQE5e3l4+uAo8G2 Vgww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :dlp-product:dlp-reaction:dlp-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:ironport-sdr :ironport-sdr; bh=eZekni9kiCrE76gR8RIC3PZLXALNSNi2F2LqA8ZdLZ8=; b=WQIcaeDj6aF03FUSXjLoPbmYuuVEP3wz3w2C41ZIQOSZKaRGC60/aB0oiGFF/KAzzw jAChQELOfcjWDELeJEI7LOKgSL2zaJGZS5gdkSD4uWpBFS5YW3ch9z12EbgY/PRCyl1R 9G0WT9IR8O+Yxkt2UgYK+RA3EiPR3/f0TWtbScXN++4Lvh95TraT1BsEh8fbi2Z1Im1F tAp1QqRU7qF8zsRAS/f3pfp/FXGihev/gMLgCqsIEG2tD+PqkAJVPz+hWRGctWfNGyeH 3ONssIV+B764RDDbAQmfN1XhRkx1mVvr7BuaCsxoxuLhIMsMcdQqe8AXJrx5rODAY+kF 3ZSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=W2eQeyN6; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si6077220edr.313.2021.01.10.09.24.24; Sun, 10 Jan 2021 09:24:47 -0800 (PST) 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=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=W2eQeyN6; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726919AbhAJRXQ (ORCPT + 99 others); Sun, 10 Jan 2021 12:23:16 -0500 Received: from mga14.intel.com ([192.55.52.115]:2895 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726228AbhAJRXP (ORCPT ); Sun, 10 Jan 2021 12:23:15 -0500 IronPort-SDR: 0qt1cDYIdK3sbvmQza598FykmCVbJxM0w6Qbv3kt+YALDD5xWA3/9kcwVgMNa2jRNIfOBN71hp Kocjr7YMtwiw== X-IronPort-AV: E=McAfee;i="6000,8403,9860"; a="176992875" X-IronPort-AV: E=Sophos;i="5.79,336,1602572400"; d="scan'208";a="176992875" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2021 09:22:34 -0800 IronPort-SDR: Zp///lTGph+mZNIzoTZA8d78SxbDa5siDNh+0CYoXQB8DXs0S/fho4dDtUnniMigeQt49Fig/n wxivcfJDVStw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,336,1602572400"; d="scan'208";a="399562013" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 10 Jan 2021 09:22:34 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 10 Jan 2021 09:22:33 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 10 Jan 2021 09:22:33 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 10 Jan 2021 09:22:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kt2aUeELlC4V5w+jyvvrjOzlauXgtie6IvJd/6zxn5RmYKM3yJXkElTJswxQ3yvwJEj1Bi6OtZBj7upwC+lfksabn87hbspnSVFZnjrIGDzqfycR1inW0HINtFitijWMW+BbUGqSCxPIQinW1p425X2wlyDSNbOdEUfqF8bg/RtbLVNjOe+mr4Lj2cllN/Yig9JuJ3NB0oAHTK48B9p8E0DMfoBKn8ySVP6Xqr3Hfai/PYkivikGhv+ye0Tcim8lmCIbb78YcZnARNonSkdSD/buwJmTTsxsqCYBHgSUplyTu7R5C50GQ6XbXwhxj6kMSjTKBCLiuqz3a3kjcQpm2Q== 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-SenderADCheck; bh=eZekni9kiCrE76gR8RIC3PZLXALNSNi2F2LqA8ZdLZ8=; b=Ua5VHa7NGj1NwZQXafVZWhZ/XoJguiyvSjHlIIGbqbRm6VLvbVT81EP3UymX9jGm0PDTcVhG672P09fkFm9ag9qdyGBWLq65UE1S7q6enYvz4VczU78LhpYiHlo6QpY7d8ptmCL+dvKRbRYWLLIA+5SmZvqth+6cjvKCIH9H5gJR3S+2YmQzKdqH8avZNB5gNn9iYGIxzeFncEfU88Jo305PoqgqCk1clHHyZwC/R8xvjCVKG3/ctUvmvIFi7XY/jz+bqsn4yt7/vGRr5wM3XXn66F/LUdHKFynV3QKkjuv7wNBCXgPsOl8E3E2nnXgi4rjBy5I4+uyMupj6r41H7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eZekni9kiCrE76gR8RIC3PZLXALNSNi2F2LqA8ZdLZ8=; b=W2eQeyN6IRlJN+fLVKQ+vgJt3jdgUHFR9mrUtCyPLwuSd1U+6+HNg9pcLG3ueDgbRCa5WYjVEkbj0/JSec14utOjS2aP8v5oo96HoKYv/ixenheHPTP3ORrxNlP+H3eZqpGYDH9MfD3HTzs20tSMiUMhSxN2hs0lVicRqCEvquc= Received: from SA2PR11MB5018.namprd11.prod.outlook.com (2603:10b6:806:11a::20) by SN6PR11MB3230.namprd11.prod.outlook.com (2603:10b6:805:b8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Sun, 10 Jan 2021 17:22:32 +0000 Received: from SA2PR11MB5018.namprd11.prod.outlook.com ([fe80::95d4:6cec:fd81:5712]) by SA2PR11MB5018.namprd11.prod.outlook.com ([fe80::95d4:6cec:fd81:5712%6]) with mapi id 15.20.3742.012; Sun, 10 Jan 2021 17:22:32 +0000 From: "Chen, Mike Ximing" To: Greg KH CC: "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "Williams, Dan J" , "pierre-louis.bossart@linux.intel.com" Subject: RE: [PATCH v8 03/20] dlb: add resource and device initialization Thread-Topic: [PATCH v8 03/20] dlb: add resource and device initialization Thread-Index: AQHW4w7I7403thdBpUePoKfbt2GH26ock8QAgASJHIA= Date: Sun, 10 Jan 2021 17:22:32 +0000 Message-ID: References: <20210105025839.23169-1-mike.ximing.chen@intel.com> <20210105025839.23169-4-mike.ximing.chen@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [69.141.163.46] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c5a471a6-d34b-48e4-f797-08d8b58c5077 x-ms-traffictypediagnostic: SN6PR11MB3230: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O32SlTvSq5IHtug9TciLLoXk64es697o2S2rhaJI4J08vNqU82rM5B97ayKlWPLR14fxjOiPjfK9jZJjAi41OC1kHcbJuCv/NAFPTIsKVkV+Icr3dsULZNEEwoXkmEI64D8a5pp2y4DDPylq48dVAnCEiMs3zz+Sbcy/Pq7hkyfsAq6RTvUe6zK/bZnNOU25uv/hHC621WIvoU9u0r8MOOOMFmRtsWioG+oxaQGNmbGaX1EEIt5JEHj2dnwsw4Tp/SDsgR8Bf5fqBT0c8m0XR2R6hWfy4iUrGbhuYgenSi2TWA3jWZNl6SrsyvjJTSv+GyervnT3ZbemB+H4gkQk/dsbzHCpQoXvW88JUrInTZ5QljRBCA0FtaMIUhpg4k936zmOsFQhUfCy/Puix4In6g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR11MB5018.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(71200400001)(4326008)(83380400001)(7696005)(76116006)(8676002)(6506007)(53546011)(55016002)(64756008)(2906002)(9686003)(316002)(66476007)(478600001)(54906003)(52536014)(6916009)(66556008)(8936002)(66446008)(26005)(66946007)(86362001)(5660300002)(186003)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?STVUh9AxVIzMfimPubBq40iytHvSjH7lAAM7mWw0Tl+Vo0QcWnUw0sIZ4Hz/?= =?us-ascii?Q?e4gEYOh8p6FeBG3Y2oZFyIO+ozz7dCQyAgN1J5lrEFmIpMe8tfvaNznJGVfs?= =?us-ascii?Q?0iF5ronsa5SXY7bFX50JYM5+HxIQQqEiddIPPAllbl8K0oUPMxbeN2nsfy61?= =?us-ascii?Q?bQjoGAsGCG52JnY0/mdVGuSRBfQL4mXYmFDtIkA/hnwjzMMoi9kL8EJ9FNd8?= =?us-ascii?Q?1Uj2nGzQi15HjZMUzcfe4oy45XcC09HINR3wUT7w5YVS4sPsxL85cESjwdHY?= =?us-ascii?Q?1idEZA5p5R9xURY6/lsqfBrouAYF+QEzPKSCdfHd1BNaRAAl/ocls6Uz9Djs?= =?us-ascii?Q?VC52fNE5/OfFSgI9L9MaXz7aCyoMz5N2kC2TFnRqduINhOtKB82uCdJqmoUv?= =?us-ascii?Q?tZ6s8aO1NjXocioWPIrJelZf27JO37cLk5o31H7Hgt8VOVTaM/ZJ8FLmoo9V?= =?us-ascii?Q?mjFZvaMBNFHX17RB4wq/3U4pVX6XjQakA8SBpv/yoJzF/WGjWgDjvYATCeS/?= =?us-ascii?Q?Ph53G4TAAxySINFwA3k9aUDbHN2ytUOyRa2UG+b370lWlrzGhjK57BG0OzAk?= =?us-ascii?Q?xG/Z6byKDgme9cVPXWjBZ6puNQ+k2u+DzN3fQG+RxGETlfbAmohnt/1dA2Rz?= =?us-ascii?Q?gnGiRLBT6a0esBLStxdcyZb2fUVXQKwRNuUrwEuBbXbqMr0eK8sxbPd/EXKZ?= =?us-ascii?Q?VZf0YhQ4/dcAEYk9hkQaHeKeY+byxoouC/CcIW3IBg3Mef57xcixwrgd3R8r?= =?us-ascii?Q?i0zn2MIf29JCHFu9ZOoWODqaEypXj37YqfCOnaoiXNBECicx96dbjg0Si7DW?= =?us-ascii?Q?WFxyWRmhUyyUtBDlDLVixxQUGehJqlFOn97AwxgJR2uo1DJyCLrej02JwRC+?= =?us-ascii?Q?JEpThTe47xggjknS5ygZSZf830Q8WJ3DKKklQ1LyHU8l40r8JqBFlf0TnpLP?= =?us-ascii?Q?Lm4PB4Xapdu5eEGJWtJgT9q2PECkwNHEs5WBQap8xog=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB5018.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5a471a6-d34b-48e4-f797-08d8b58c5077 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2021 17:22:32.1729 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +7IbBQcNVcMrqkPGRjPH3V3+WE9CnLa4a//ydZCmXkQq92U7Nea9oQl2V2h3+5ENaZiSFfoMMgJu6WQTASZrDLO5sZxj0BR8b0z/4ZP2K/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3230 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Greg KH > Sent: Thursday, January 7, 2021 2:40 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; arnd@arndb.de; Williams, Dan J > ; pierre-louis.bossart@linux.intel.com; Gage Ea= ds > > Subject: Re: [PATCH v8 03/20] dlb: add resource and device initialization >=20 > On Mon, Jan 04, 2021 at 08:58:22PM -0600, Mike Ximing Chen wrote: > > Introduce dlb_bitmap_* functions, a thin convenience layer wrapping the > > Linux bitmap interfaces, used by the bitmaps in the dlb hardware types. >=20 > No, you created custom #defines: >=20 > > --- a/drivers/misc/dlb/dlb_hw_types.h > > +++ b/drivers/misc/dlb/dlb_hw_types.h > > @@ -5,6 +5,15 @@ > > #define __DLB_HW_TYPES_H > > > > #include > > +#include > > + > > +#include "dlb_bitmap.h" > > + > > +#define BITS_SET(x, val, mask) (x =3D ((x) & ~(mask)) \ > > + | (((val) << (mask##_LOC)) & (mask))) > > +#define BITS_CLR(x, mask) ((x) &=3D ~(mask)) > > +#define BIT_SET(x, mask) ((x) |=3D (mask)) > > +#define BITS_GET(x, mask) (((x) & (mask)) >> (mask##_LOC)) >=20 > We have functions for this, use them, don't create custom macros for > them. Use the Linux functions please. >=20 > thanks, >=20 > greg k-h FIELD_GET(_mask, _val) and FIELD_PREP(_mask, _val) in include/linux/bitfiel= d.h are similar to our BITS_GET() and BITS_SET(). However in our case, mas= k##_LOC is a known constant defined in dlb_regs.h. So we don't need to use= _buildin_ffs(mask) to calculate the location of mask as FIELD_GET() and FI= ELD_PREP() do. We can still use FIELD_GET and FIELD_PREP, but our macros a= re a little more efficient. Would it be OK to use them?=20 Thanks Mike