Re: [PATCH] checkpatch: Ignore attribute macros ending with nGnRnE or nGnRE
From: Liu Dalin
Date: Sun Mar 08 2026 - 22:19:48 EST
Thanks for the review!
在 2026/3/8 3:53, Joe Perches 写道:
On Sat, 2026-03-07 at 15:27 +0800, Liu Dalin wrote:
On arm and arm64 platforms, there are several attribute macros that+ $var !~ /^[A-Z0-9_]+_(nGnRnE|nGnRE)$/) {
end with nGnRnE or nGnRE, such as PROT_DEVICE_nGnRnE, PROT_DEVICE_nGnRE,
MT_DEVICE_nGnRnE, and MT_DEVICE_nGnRE.
Maybe better if you add nGRE too and no capture group using (?:...)$
OK! This is a good suggestion.
I will add it in patch v2.
FYI: These appear unused to date:
On other ARM platforms, these memory attribute macros are used in arch, drivers, or KVM.
likes:
$ git grep PROT_DEVICE_nGnRnE
arch/arm64/include/asm/io.h:#define pci_remap_cfgspace(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
arch/arm64/include/asm/pgtable-prot.h:#define PROT_DEVICE_nGnRnE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRnE))
arch/arm64/kernel/acpi.c: return __pgprot(PROT_DEVICE_nGnRnE);
drivers/net/ethernet/huawei/hinic/hinic_lld.c: __pgprot(PROT_DEVICE_nGnRnE));
drivers/net/ethernet/phytium/phytmac.h:#define phytmac_ioremap_np(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
drivers/scsi/huawei/hifc/hifc_lld.c: __pgprot(PROT_DEVICE_nGnRnE));
$ git grep FFA_DEV
include/linux/arm_ffa.h:#define FFA_DEV_nGnRnE (0 << 2)
include/linux/arm_ffa.h:#define FFA_DEV_nGnRE (1 << 2)
include/linux/arm_ffa.h:#define FFA_DEV_nGRE (2 << 2)
include/linux/arm_ffa.h:#define FFA_DEV_GRE (3 << 2)