From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A91742FC4; Thu, 3 Aug 2023 11:46:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02A1A4282D; Thu, 3 Aug 2023 11:46:59 +0200 (CEST) Received: from mgamail.intel.com (unknown [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 1330F4161A for ; Thu, 3 Aug 2023 11:46:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691056018; x=1722592018; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=4PCLzMTagU3J4tQrUm/WugB/iKeVKefttCsZjTVr3eI=; b=ToqYFVmN5Xsjd+LwxenJKoSQqxDkGPF8vJkAnxU20A+e8jFwtKge3TJh s2VYBtbbAiuHACwmeRpIoh6IvtVWChi2NKpB0LPUOlJ58PN8+47OS76AM p+gc+XmG5XqRyJ8SoCLLLt7j0nDF55bTUiZQNmLlsygsauVnq46uWLHU/ sSkMIh1ZH1C86Xx2LHfPAthXpYwW2DuC2TqC9403dY6rv6wXw7pUfLPvm UO0kgib1FBVMsrs4+3fm6m84e1D30luxXD9gd9goZ/LusYaxaRGhk2D7s IZmGERC2xFTLpHqdx1Ay7FHUsrrnT2fSt4TewXJw8nQCnDD0vCCT2qO3M Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="456206657" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="456206657" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 02:46:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="819580752" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="819580752" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 03 Aug 2023 02:46:56 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 02:46:56 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 3 Aug 2023 02:46:56 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.46) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 3 Aug 2023 02:46:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U0rw6kA2/9sWUNAHTm+lgJMRrhyR3vW46q3QEHhXqcc5K4n+6HszQH8ZWq4hOwo0upHNWYvE4tcqWzkIXZq2AzVg1g0yOW8xA/8Czzdte0rcSMkDsUm0B75Csd6dJdjZwTJn7q6gmCQoIUpS0VYDEkX8MZWaSS4BGRWwB2cx2nOFnaJH+Gd63+H4MwbF5x8lMUj9bRCxYGEeTp/IRj3ky41yxECdk0kjaY5h8DTlQ01xRfH+ZxpJe4GSBR6ke953OfYfvs5b2aY3wtOy+VNzZb7zJh2ADr6NESNpvChJlt6OzH7K5/X9hRuHXqjjZETIOXPSPusdczrYEfrTH9jfJg== 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=DoclNnlZiXEYUPU3R6r1ubwU6N+ANPzmxoPaU9OhqxE=; b=Cq3SjXR6NRJeXdNObE/lQQj2ELBTGpGkQlZHtkFJFP69FCwccpjvufs5itNn2Y9JAIxjvyrj33wzAAxRvjQiemidfKNkGHQJBWW6T/pHU0blrkdrPb9VHkNZecyk2MvCkIC2ksQsbxDs88y4IA6+svhp8xAdAggRfjDoYYKhe8lCTyPEFIPliKMJISI0oGDxWN7mX/ZGMxAcVeeMHALtykiZG1BeiNC8Mq31oeW86vrBbcd0MiwrBRqE2SxjO7xXd6lzzyqJhlDpSt04hxEyVymiGcTrHLtL7QjgMZ4tI7IpstjtJOeKJ5J0b8Si6UlV65j6uYdEpO+Vy+EtBaqVAg== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by BL1PR11MB5351.namprd11.prod.outlook.com (2603:10b6:208:318::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.20; Thu, 3 Aug 2023 09:46:54 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f%7]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 09:46:53 +0000 Date: Thu, 3 Aug 2023 10:46:47 +0100 From: Bruce Richardson To: David Marchand CC: , , , , Subject: Re: [PATCH 02/14] bus/pci: add const to some experimental API Message-ID: References: <20230803075038.307012-1-david.marchand@redhat.com> <20230803075038.307012-3-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230803075038.307012-3-david.marchand@redhat.com> X-ClientProxiedBy: DUZPR01CA0078.eurprd01.prod.exchangelabs.com (2603:10a6:10:46a::20) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|BL1PR11MB5351:EE_ X-MS-Office365-Filtering-Correlation-Id: 83260892-6f6a-4eaa-1b09-08db94069192 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T3lzUchr5jK45+IyTi5tuSA4vrLAUQ5unATCxm4vdfUdDnU13894D2F9yjFVBa0qTq030+v5tkgun02dYCABKrMT/C99/dQ3wXpxkqReTAXXd4isHDU6Wn0Hn3IdYM4ZHoesEHEtwhDFWsddoj22oDeIyS/aNrQzuPrMvqJEAitoPTxnyUSz4+zYNuQoAHfrbFiSUl4JQhpgTjwOdXY74nn6hsYkHOzd3SgTClpmLRbwtxshzJKeX26SsrfyMdG4T43esBhIJpLuW6RiRlr7IyhYy19jd2soxAlW6f3LmFyfvWuevafxaY+XYfmQQaA6q5+omLoAkR0SWlqvflHchhStd7LiPor/+6CYxI10VVPDq6ayPmawBb+BYKc/gqSEO450Gf2joOQ9HhW4oYqLRZmEFUmJIprOlhctaq5riyQ6bYZA/s3MCO79Z8B2qlBdZixIXlKIhfrdLH7XN8karqWMZGp5GnFu25E7iwYyhpRhXlhGhv7Sb+GQXlZ0uGca+v01G/ejZdYkqyFela2sC07fqaKqMD8mb08s6nqDDv7K5D2WSUn3fwKNSbj9Zn9i X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(396003)(346002)(39860400002)(366004)(376002)(451199021)(6506007)(83380400001)(26005)(186003)(316002)(2906002)(66946007)(4326008)(66476007)(66556008)(5660300002)(6916009)(44832011)(41300700001)(8676002)(8936002)(6486002)(6666004)(6512007)(478600001)(38100700002)(82960400001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pS/ApPHwBiQXwtJjDy2/AaHp4M4jn7o9Cg9N6fOrZTKDjfLvy6tRAFR1L7Aq?= =?us-ascii?Q?lPGeXYQxCci4O3y6PWcNi81f8ZKifHYuFv3GFZsbWzlqayyi2KmKYtnFSWKO?= =?us-ascii?Q?WCQxAe/gDC2mekj8umqZ/J6+ZDkTYQqybIjQnRq2Jy8C9NOAU8jTMPenvyuN?= =?us-ascii?Q?kHsHWONdagdZAuRtDNh2Q1kTYwsEmWIknFVHV0YKMt9pxXk7NmBuagEBPPIE?= =?us-ascii?Q?EFoQUgPmArTDb79eXj+MS4rfqVgnt9YER5a4Mo3nIQvHSHk9wo/PW+iAkQ1y?= =?us-ascii?Q?H1+jsjge5hSia9Be+G1l+j5PbLO4X041WigXAs1Vr6Anap3LUEOnx5Bqpjxa?= =?us-ascii?Q?YcTuls4eXK6pv9WxKrPz6LwhASObHxjaQM6m8MrbICv/s5Gw90NvAibiVA6n?= =?us-ascii?Q?OrUZ9TgVslmr/v1fgYH3FJk5/wdKyWvIfC/clV4CMf8Q+W3z7TS0zYHiwUeI?= =?us-ascii?Q?23kZ0+i7KCP1+ZjnrFccFVrF7bzv4CoFwj12d+SgU+nKB/c0I7sT8vM+RuTz?= =?us-ascii?Q?rNptzTnp5FnEha0eLFcR/gsc+QPOkCH0IYetYJnyahZypQlnWZMmy5aGO/xS?= =?us-ascii?Q?fu56O7FaL8AABbFOXcSw201PKiEa289UeROiNP6TwPajuaGTGZAA3FN2wpFf?= =?us-ascii?Q?NoXV3Be+6u2EUQg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?= =?us-ascii?Q?LUZP9lUbh56Ul1sOc+wdgninAZvCQ9umlg86aeYVDVEu/q6GPhkry2uTQ8Da?= =?us-ascii?Q?fQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 83260892-6f6a-4eaa-1b09-08db94069192 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 09:46:53.8078 (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: 22znwBP0WSUiEiExDpne/kPlza0urIAn5y4oMJHpmja9Tc3ziNEbPt/PvXJpuOXioje3V82VLuSc10jVR9TTH9iUrc2bHrrXUkamf5/Rzl8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5351 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Aug 03, 2023 at 09:50:25AM +0200, David Marchand wrote: > Those functions are fine with a const on the device pointer. > > Signed-off-by: David Marchand > --- > drivers/bus/pci/pci_common.c | 4 ++-- > drivers/bus/pci/rte_bus_pci.h | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c > index 52404ab0fe..382b0b8946 100644 > --- a/drivers/bus/pci/pci_common.c > +++ b/drivers/bus/pci/pci_common.c > @@ -814,7 +814,7 @@ rte_pci_get_iommu_class(void) > } > > off_t > -rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap) > +rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap) > { > off_t offset = RTE_PCI_CFG_SPACE_SIZE; > uint32_t header; > @@ -857,7 +857,7 @@ rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap) > } > > int > -rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable) > +rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable) > { > uint16_t old_cmd, cmd; > While generally I'm a big fan of using const everywhere we can, I wonder if this is confusing here, since you are changing a setting, i.e. it's not a read-only function. That said, since const works, I have no strong objection to going with it. Acked-by: Bruce Richardson