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

Krzysztof Wilczyński kwilczynski at kernel.org
Fri Apr 10 21:48:52 AEST 2026


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


More information about the Linuxppc-dev mailing list