git: 0e8953b94b74 - main - LinuxKPI: pci.h: always initialize return value

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 23 Apr 2023 13:30:14 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=0e8953b94b7481a53945cbd1e16517773996e16e

commit 0e8953b94b7481a53945cbd1e16517773996e16e
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-04-20 15:59:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-04-23 13:29:30 +0000

    LinuxKPI: pci.h: always initialize return value
    
    In pcie_capability_read_*() always initialize the return value to
    avoid warnings of uninitialized values in callers.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39721
---
 sys/compat/linuxkpi/common/include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 8077a75c4dd9..9b2e9269d4d4 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -1178,6 +1178,7 @@ static bool pcie_capability_reg_implemented(struct pci_dev *dev, int pos)
 static inline int
 pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst)
 {
+	*dst = 0;
 	if (pos & 3)
 		return -EINVAL;
 
@@ -1190,6 +1191,7 @@ pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst)
 static inline int
 pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *dst)
 {
+	*dst = 0;
 	if (pos & 3)
 		return -EINVAL;