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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

diff -u -r1.11 ops-au1000.c
--- arch/mips/pci/ops-au1000.c  6 Jun 2004 02:12:38 -0000       1.11
+++ arch/mips/pci/ops-au1000.c  14 Nov 2004 19:59:23 -0000
@@ -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);
        }




-- 
Herbert Valerio Riedel <hvr@xxxxxxxxxxxxxxxxx>
Research Group for Industrial Software @ Vienna University of Technology



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux