mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 22:13:55 -04:00
alpha/PCI: Make the suffix the first __pci_dev_resource_attr() parameter
Currently, the __pci_dev_resource_attr() helper macro takes the attribute name suffix as its third parameter, even though the suffix is what distinguishes the three attribute variants built on top of it. Additionally, the pci_dev_resource_attr() wrapper passes an empty suffix, and with the suffix placed in the middle of the parameter list its invocation contains two consecutive commas, which checkpatch.pl highlights, as follows: ERROR: space required after that ',' (ctx:VxO) Move the suffix to the front so that the variant selector comes first and the empty argument follows the opening parenthesis, which checkpatch.pl does not complain about. This also matches the parameter order used by the PCI legacy I/O and memory attribute macros introduced in a subsequent change. No functional changes intended. Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260721020427.1541197-3-kwilczynski@kernel.org
This commit is contained in:
committed by
Bjorn Helgaas
parent
7823291ac4
commit
ee2ca84457
@@ -102,25 +102,25 @@ static int pci_mmap_resource_dense(struct file *filp, struct kobject *kobj,
|
||||
return pci_mmap_resource(kobj, attr, vma, 0);
|
||||
}
|
||||
|
||||
#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(_suffix, _bar, _name, _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_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)
|
||||
__pci_dev_resource_attr(_sparse, _bar, resource##_bar##_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_dev_resource_attr(_dense, _bar, resource##_bar##_dense, \
|
||||
pci_mmap_resource_dense)
|
||||
|
||||
static int sparse_mem_mmap_fits(struct pci_dev *pdev, int num)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user