aboutsummaryrefslogtreecommitdiff
path: root/include/npu2.h
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2019-08-09 14:12:20 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-08-16 15:51:55 +1000
commite4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a (patch)
tree3baf40df5b7ccde86c729634583655252a478530 /include/npu2.h
parentf68639c6fcdf9261290a4601eda1ae6a406ba95a (diff)
downloadskiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.zip
skiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.tar.gz
skiboot-e4e2aa9cc2cbaab9c6c0ee3a1f4e36292128762a.tar.bz2
pci: Use a macro for accessing PCI BDF Function Number
Currently when the Function Number bits of a BDF are needed the bit operations to get it are free coded. There are many places where the Function Number is used, so make a macro to use instead of free coding it everytime. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'include/npu2.h')
-rw-r--r--include/npu2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/npu2.h b/include/npu2.h
index 282ee8b..aac7e7a 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -20,7 +20,7 @@
(p)->npu->phb_nvlink.opal_id, \
PCI_BUS_NUM((p)->bdfn), \
PCI_DEV((p)->bdfn), \
- (p)->bdfn & 0x7, ##a)
+ PCI_FUNC((p)->bdfn), ##a)
#define NPU2DEVDBG(p, fmt, a...) NPU2DEVLOG(PR_DEBUG, p, fmt, ##a)
#define NPU2DEVINF(p, fmt, a...) NPU2DEVLOG(PR_INFO, p, fmt, ##a)
#define NPU2DEVERR(p, fmt, a...) NPU2DEVLOG(PR_ERR, p, fmt, ##a)