Skip to contentSkip to conversation

fix for big-endian bug in arch/mips/pci/ops-au1000.c

PATCH New Herbert Valerio Riedel 1 participant 1 message Nov 14, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix for big-endian bug in arch/mips/pci/ops-au1000.c

well, w/ the following modification, the code becomes endian-independent... :-)

mips/pci/ops-au1000.c 14 Nov 2004 19:59:23 -0000 renamed from mips/pci/ops-au1000.c 6 Jun 2004 02:12:38 -0000 1.11 +12 -4
diff -u -r1.11 ops-au1000.c
@@ -288,10 +288,18 @@
                       int where, int size, u32 * val)
 {
        switch (size) {
-       case 1:
-               return read_config_byte(bus, devfn, where, (u8 *) val);
-       case 2:
-               return read_config_word(bus, devfn, where, (u16 *) val);
+       case 1: {
+                       u8 _val;
+                       int rc = read_config_byte(bus, devfn, where, &_val);
+                       *val = _val;
+                       return rc;
+               }
+       case 2: {
+                       u16 _val;
+                       int rc = read_config_word(bus, devfn, where, &_val);
+                       *val = _val; 
+                       return rc;
+               }
        default:
                return read_config_dword(bus, devfn, where, val);
        }
Signature · 2 lines
Herbert Valerio Riedel <[email protected]>
Research Group for Industrial Software @ Vienna University of Technology