2.6.0-test7 byteorder.h ( as you go AGAIN! )

From: Steven Michalske (michalsc_at_email.uc.edu)
Date: 10/10/03

  • Next message: Maciej Zenczykowski: "Re: Query: PNP BIOS for 2.4.22"
    To: linux-kernel@vger.kernel.org
    Date:	Thu, 9 Oct 2003 22:13:59 -0400
    
    
    
    

    I am running 2.6.0-test7 and this issue is still in the kernel, I guess i'll
    have to argue for the fix yet again.

    First some background.

    This problem was first introduced with the XFS patches back in the 2.4.21
    series or so. and it has continued on since then. reading the list i have
    seen many patches to attempt to fix this issue.

    In my digging I have uncovered that this is because the type __u64 is guarded
    as follows

    #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
    typedef __signed__ long long __s64;
    typedef unsigned long long __u64;
    #endif

    now with these types being inside of a #ifdef i would expect any subsquent
    type dependent to be #ifdefed out as well.

    but in byteorder.h

    This function is defined:
    static inline __u64 ___arch__swab64(__u64 val) with out any protection

    Attached is my proposed patch to correct this error.

    This patch is required because this file is included from the file
    include/linux/cdrom.h

    Which states
    snip lines 17-18
     * As of Linux 2.1.x, all Linux CD-ROM application programs will use this
     * (and only this) include file.
    end snip

    This issuse will always occur unless we patch the file to protect the
    ___arch__swab64 function in the same fashion as its return type.

    Steven Michalske
    aka Hardkrash

    --- linux-2.6.0-test7/include/asm-i386/byteorder.h.scm 2003-10-09
    21:52:16.727080480 -0400
    +++ linux-2.6.0-test7/include/asm-i386/byteorder.h 2003-10-08
    17:20:10.000000000 -0400
    @@ -34,7 +34,7 @@
                    return x;
     }

    -
    +#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
     static inline __u64 ___arch__swab64(__u64 val)
     {
            union {
    @@ -55,10 +55,11 @@
     }

     #define __arch__swab64(x) ___arch__swab64(x)
    +#define __BYTEORDER_HAS_U64__
    +#endif
     #define __arch__swab32(x) ___arch__swab32(x)
     #define __arch__swab16(x) ___arch__swab16(x)

    -#define __BYTEORDER_HAS_U64__

     #endif /* __GNUC__ */

    
    

    
    

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/




  • Next message: Maciej Zenczykowski: "Re: Query: PNP BIOS for 2.4.22"

    Relevant Pages

    • Re: BIOS overwritten during resume (was: Re: Asus L5D resume on battery power)
      ... >> and you probably need to fix those, ... I think I'll just port the Nigel's patch to x86-64. ... People were complaining that M$ turns users into beta-testers... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fix readahead breakage for sequential after random reads
      ... > yes I will run all my standard testsuites before we take this patch. ... I have also enclosed a patch that partially backs off Miklos's fix. ... ra->average value to max/2 when we move from readahead-off mode to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: IA32 - 27 New warnings
      ... > | needed to confirm the patch and preferably some brave soul with Promise ... > Bart has already posted patches for this. ... I'm off looking for more resonably simple stuff to fix. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: ALPS psmouse_reset on reconnect confusing Tecra M2
      ... > It's hard to believe your patch ... > can fix it, because the ALPS_DUALPOINT constant doesn't affect the ... > initalization behavior at all, only the way how TouchPoint data are ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Linux 2.6.19
      ... knowing that it's all your own d*mn fault, and you should just fix your ... [SCSI] ... [PATCH] ... USB: ipaq: Add HTC Modem Support ...
      (Linux-Kernel)