From 2a07d0f40d3085d96d9c9c67d800b8724d9d40cc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Sep 2007 15:41:33 +0000 Subject: [PATCH] 2007-09-06 Joel Sherrill * pci/pci.c: Fix some warnings. --- c/src/lib/libbsp/sparc/leon3/ChangeLog | 4 ++++ c/src/lib/libbsp/sparc/leon3/pci/pci.c | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/c/src/lib/libbsp/sparc/leon3/ChangeLog b/c/src/lib/libbsp/sparc/leon3/ChangeLog index 10a39e2423..b564cfa486 100644 --- a/c/src/lib/libbsp/sparc/leon3/ChangeLog +++ b/c/src/lib/libbsp/sparc/leon3/ChangeLog @@ -1,3 +1,7 @@ +2007-09-06 Joel Sherrill + + * pci/pci.c: Fix some warnings. + 2007-09-06 Joel Sherrill * console/debugputs.c: Add missing include file. diff --git a/c/src/lib/libbsp/sparc/leon3/pci/pci.c b/c/src/lib/libbsp/sparc/leon3/pci/pci.c index b959600fdf..7e22aa50ac 100644 --- a/c/src/lib/libbsp/sparc/leon3/pci/pci.c +++ b/c/src/lib/libbsp/sparc/leon3/pci/pci.c @@ -25,6 +25,7 @@ */ #include +#include #include #define PCI_ADDR 0x80000400 @@ -97,8 +98,14 @@ static inline unsigned int flip_dword (unsigned int l) int -pci_read_config_dword(unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned int *val) { - +pci_read_config_dword( + unsigned char bus, + unsigned char slot, + unsigned char function, + unsigned char offset, + unsigned int *val +) +{ volatile unsigned int *pci_conf; if (offset & 3) return PCIBIOS_BAD_REGISTER_NUMBER; @@ -108,7 +115,8 @@ pci_read_config_dword(unsigned char bus, unsigned char slot, unsigned char funct return PCIBIOS_SUCCESSFUL; } - pci_conf = PCI_CONF + ((slot<<11) | (function<<8) | offset); + pci_conf = (volatile unsigned int *) (PCI_CONF + + ((slot<<11) | (function<<8) | offset)); #ifdef BT_ENABLED *val = flip_dword(*pci_conf); @@ -160,7 +168,8 @@ pci_write_config_dword(unsigned char bus, unsigned char slot, unsigned char func if (offset & 3 || bus != 0) return PCIBIOS_BAD_REGISTER_NUMBER; - pci_conf = PCI_CONF + ((slot<<11) | (function<<8) | (offset & ~3)); + pci_conf = (volatile unsigned int *) (PCI_CONF + + ((slot<<11) | (function<<8) | (offset & ~3))); #ifdef BT_ENABLED value = flip_dword(val);