PCI: Clean up __pci_find_next_cap_ttl() readability
Refactor the __pci_find_next_cap_ttl() to improve code clarity: - Replace magic number 0x40 with PCI_STD_HEADER_SIZEOF. - Use ALIGN_DOWN() for position alignment instead of manual bitmask. - Extract PCI capability fields via FIELD_GET() with standardized masks. - Add necessary headers (linux/align.h). No functional changes intended. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Acked-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20250813144529.303548-2-18255117159@163.com
This commit is contained in:
committed by
Bjorn Helgaas
parent
8f5ae30d69
commit
37d1ade896
@@ -207,6 +207,9 @@
|
||||
|
||||
/* Capability lists */
|
||||
|
||||
#define PCI_CAP_ID_MASK 0x00ff /* Capability ID mask */
|
||||
#define PCI_CAP_LIST_NEXT_MASK 0xff00 /* Next Capability Pointer mask */
|
||||
|
||||
#define PCI_CAP_LIST_ID 0 /* Capability ID */
|
||||
#define PCI_CAP_ID_PM 0x01 /* Power Management */
|
||||
#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
|
||||
|
||||
Reference in New Issue
Block a user