From: Yuri Zaporozhets <yuriz@vodafonemail.de>
To: u-boot@lists.denx.de
Subject: [PATCH] bios_emulator: fix first argument of pci_{read,write}_config_* function calls
Date: Wed, 30 Oct 2024 20:38:20 +0100 [thread overview]
Message-ID: <ZyKLLBASJfMDk0QX@qrv-systems.net> (raw)
When compiling for riscv64, a bunch of warning is produced for the file
drivers/bios_emulator/besys.c. This patch fixes a portion of those warnings,
caused by incorrect first argument to pci_{read,write}_config_* functions.
Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
---
drivers/bios_emulator/besys.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c
index 2fd794f76c..c6c5b7ed44 100644
--- a/drivers/bios_emulator/besys.c
+++ b/drivers/bios_emulator/besys.c
@@ -49,6 +49,7 @@
#define __io
#include <asm/io.h>
+#include <pci.h>
#include "biosemui.h"
/*------------------------- Global Variables ------------------------------*/
@@ -434,32 +435,27 @@ static u32 BE_accessReg(int regOffset, u32 value, int func)
if ((function == _BE_env.vgaInfo.function) &&
(device == _BE_env.vgaInfo.device) &&
(bus == _BE_env.vgaInfo.bus)) {
+ pci_dev_t bdf = PCI_BDF(bus, device, function);
switch (func) {
case REG_READ_BYTE:
- pci_read_config_byte(_BE_env.vgaInfo.pcidev, regOffset,
- &val8);
+ pci_read_config_byte(bdf, regOffset, &val8);
return val8;
case REG_READ_WORD:
- pci_read_config_word(_BE_env.vgaInfo.pcidev, regOffset,
- &val16);
+ pci_read_config_word(bdf, regOffset, &val16);
return val16;
case REG_READ_DWORD:
- pci_read_config_dword(_BE_env.vgaInfo.pcidev, regOffset,
- &val32);
+ pci_read_config_dword(bdf, regOffset, &val32);
return val32;
case REG_WRITE_BYTE:
- pci_write_config_byte(_BE_env.vgaInfo.pcidev, regOffset,
- value);
+ pci_write_config_byte(bdf, regOffset, value);
return 0;
case REG_WRITE_WORD:
- pci_write_config_word(_BE_env.vgaInfo.pcidev, regOffset,
- value);
+ pci_write_config_word(bdf, regOffset, value);
return 0;
case REG_WRITE_DWORD:
- pci_write_config_dword(_BE_env.vgaInfo.pcidev,
- regOffset, value);
+ pci_write_config_dword(bdf, regOffset, value);
return 0;
}
--
2.39.5
next reply other threads:[~2024-10-30 21:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 19:38 Yuri Zaporozhets [this message]
2024-11-05 1:07 ` [PATCH] bios_emulator: fix first argument of pci_{read,write}_config_* function calls Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZyKLLBASJfMDk0QX@qrv-systems.net \
--to=yuriz@vodafonemail.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox