Re: [PATCH 14/20] alpha/PCI: Add static PCI resource attribute macros

Krzysztof Wilczyński <[email protected]>
Newsgroups org.kernel.vger.linux-alpha,org.kernel.vger.linux-pci,org.ozlabs.lists.linuxppc-dev
Message-ID <20260410114852.GA1761359@rocinante>
Hello,

> > +#define __pci_dev_resource_attr(_bar, _name, _suffix, _mmap)		\
> > +static const struct bin_attribute					\
> > +pci_dev_resource##_bar##_suffix##_attr = {				\
> > +	.attr = { .name = __stringify(_name), .mode = 0600 },		\
> > +	.private = (void *)(unsigned long)(_bar),			\
> > +	.mmap = (_mmap),						\
> > +}
> > +
> > +#define pci_dev_resource_attr(_bar)					\
> > +	__pci_dev_resource_attr(_bar, resource##_bar,,			\
> > +			    pci_mmap_resource_dense)
> > +
> > +#define pci_dev_resource_sparse_attr(_bar)				\
> > +	__pci_dev_resource_attr(_bar, resource##_bar##_sparse, _sparse,	\
> > +			    pci_mmap_resource_sparse)
> > +
> > +#define pci_dev_resource_dense_attr(_bar)				\
> > +	__pci_dev_resource_attr(_bar, resource##_bar##_dense, _dense,	\
> > +			    pci_mmap_resource_dense)
> > +
> >  /**
> >   * pci_remove_resource_files - cleanup resource files
> >   * @pdev: pci_dev to cleanup
> > 
> 
> Wouldn't this belong together with the next patch, or is there some good 
> reason why you added them separately?

No specific reason other than to make it easier to review.  The pattern
here is: macros first and then users later (when converting things over).

Thank you!

	Krzysztof
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.