lkml.org 
[lkml]   [2004]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Being more careful about iospace accesses..
    On Wed, Sep 15, 2004 at 04:26:12PM -0700, Linus Torvalds wrote:

    > other bitwise type. You'd get a warnign about incompatible types. Makes
    > sense, no?
    > - you can only do operations that are safe within that byte order. For
    > example, it is safe to do a bitwise "&" on two __le16 values. Clearly
    > the result is meaningful.

    BTW, so far the most frequent class of endianness bugs had been along the
    lines of
    foo->le16_field = cpu_to_le32(12);
    and vice versa. On big-endian it's a guaranteed FUBAR - think carefully about
    the value that will end up there.

    > Oh, btw, right now you only get the warnings from sparse if you use
    > "-Wbitwise" on the command line. Without that, sparse will ignore the
    > bitwise attribute.

    We probably want __attribute__((opaque)) in addition to bitwise - e.g. for
    the handles of all sorts passed in network filesystem protocols. I'll look
    into that when we get the endianness warnings somewhat under control.

    For now I'm going to #define __opaque __bitwise and use it for stuff like
    typedef __u32 __opaque cifs_fid;
    etc.
    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 14:06    [W:3.489 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site