From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A02BE283683; Tue, 6 May 2025 15:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746546978; cv=none; b=Jv6Q3W+G+1Lah3c85HzcIQk4sI7SiwF1I8CRWIVDIf63+LNGyJjosygWu/1vi/y9OAHHa7AM/D7aa7mbFQHmMx6tGRhmSDicM0egprDd9vFJJKHLDJMQaS1Q8XXAyL6e9+cZiLC7e+4z2dk2sRj7h5RVnY+EpDzkq3Hp0dSDu88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746546978; c=relaxed/simple; bh=2SoxB3NHD8Ps6GC9v+38YxKziXQIx1dUTPfuOnXpEro=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aCaCRzTSPFOTqe/rII09kaa9ZvbqA/v+C7Kru6KtYr/OGTtKy3owKHvreiNMoiNvpkZWuDqo1+coasEJfitCfQbLlh+51VSCbSujhxCOq5xFVpB9NYvmidhhLBRFN3Qvi28hbEPz74tlyZw6ltp8uNtgAYdLF+d6oC9JfDQI3Ns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bWwpJ86h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bWwpJ86h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43272C4CEE4; Tue, 6 May 2025 15:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746546978; bh=2SoxB3NHD8Ps6GC9v+38YxKziXQIx1dUTPfuOnXpEro=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bWwpJ86hlQiUW9zdWW7S6eiNlsvlCwncKV2/DbQ1uoAGG2tdlAq0Rbq/rLNdwdw9n 52dvQAhw//fLVprgIfAUlUtB9Dl+PD5262iPHMDc73eQrRHgvTtNyEEtYqNNXebCZK f0MOiYmlKtHbmrSdAsEwTUJvLUOqAeKHD5aEQ/2eem0MGdQwqngcoH34yOKeUYyIvU JVWFm/yZdabAzfF2cOnq0hVdE0VP3rPs1t7AHcDaVXpE1FmGrupKux+iohiJWSdqLN NRw/Yh0WRK681h409b1xZt3qFce/aHyjDM3I3ZGs9b2IufH6whOqV2AuAOZz44uYrN zNoaMKCv8mGHQ== Date: Tue, 6 May 2025 16:56:10 +0100 From: Simon Horman To: Larysa Zaremba Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Przemek Kitszel , Jiri Pirko , Tatyana Nikolova , Andrew Lunn , Alexander Lobakin , Michael Ellerman , Maciej Fijalkowski , Lee Trager , Madhavan Srinivasan , Sridhar Samudrala , Jacob Keller , Michal Swiatkowski , Mateusz Polchlopek , Ahmed Zaki , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Emil Tantilov , Madhu Chittim , Josh Hay , Milena Olech , pavan.kumar.linga@intel.com, "Singhai, Anjali" , Phani R Burra Subject: Re: [PATCH iwl-next v2 03/14] libie: add PCI device initialization helpers to libie Message-ID: <20250506155610.GS3339421@horms.kernel.org> References: <20250424113241.10061-1-larysa.zaremba@intel.com> <20250424113241.10061-4-larysa.zaremba@intel.com> <20250428165657.GE3339421@horms.kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 05, 2025 at 08:56:18AM +0200, Larysa Zaremba wrote: > On Mon, Apr 28, 2025 at 05:56:57PM +0100, Simon Horman wrote: > > On Thu, Apr 24, 2025 at 01:32:26PM +0200, Larysa Zaremba wrote: > > > From: Phani R Burra > > > > > > Add memory related support functions for drivers to access MMIO space and > > > allocate/free dma buffers. > > > > > > Reviewed-by: Maciej Fijalkowski > > > Signed-off-by: Phani R Burra > > > Co-developed-by: Victor Raj > > > Signed-off-by: Victor Raj > > > Co-developed-by: Sridhar Samudrala > > > Signed-off-by: Sridhar Samudrala > > > Co-developed-by: Pavan Kumar Linga > > > Signed-off-by: Pavan Kumar Linga > > > Co-developed-by: Larysa Zaremba > > > Signed-off-by: Larysa Zaremba > > > > ... > > > > > diff --git a/include/linux/intel/libie/pci.h b/include/linux/intel/libie/pci.h > > > > ... > > > > > +#define libie_pci_map_mmio_region(mmio_info, offset, size, ...) \ > > > + __libie_pci_map_mmio_region(mmio_info, offset, size, \ > > > + COUNT_ARGS(__VA_ARGS__), ##__VA_ARGS__) > > > + > > > +#define libie_pci_get_mmio_addr(mmio_info, offset, ...) \ > > > + __libie_pci_get_mmio_addr(mmio_info, offset, \ > > > + COUNT_ARGS(__VA_ARGS__), ##__VA_ARGS__) > > > > Perhaps I'm missing something terribly obvious. But it seems to me that > > both libie_pci_map_mmio_region() and libie_pci_get_mmio_addr() are always > > called with the same number of arguments in this patchset. > > This is true. > > > And if so, > > perhaps the va_args handling would be best dropped. > > > > For now (but this will change), we do not map BAR indexes other than zero, > therefore it is the default less-argument variant, this looks nicer than adding > ', 0);'. Still, it does not feel right to hardcode the library function to use > BAR0 only, hence the variadic macro. Thanks for the clarification. I would slightly lead towards adding va_args support when it is needed. But I understand if you want to stick with the approach that you have taken in this patch. > > > > + > > > +bool __libie_pci_map_mmio_region(struct libie_mmio_info *mmio_info, > > > + resource_size_t offset, resource_size_t size, > > > + int num_args, ...); > > > +void __iomem *__libie_pci_get_mmio_addr(struct libie_mmio_info *mmio_info, > > > + resource_size_t region_offset, > > > + int num_args, ...); > > > +void libie_pci_unmap_all_mmio_regions(struct libie_mmio_info *mmio_info); > > > +int libie_pci_init_dev(struct pci_dev *pdev); > > > +void libie_pci_deinit_dev(struct pci_dev *pdev); > > > + > > > +#endif /* __LIBIE_PCI_H */ > > > -- > > > 2.47.0 > > > > > >