lkml.org 
[lkml]   [2003]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] M68k IDE updates

    On Mon, 14 Apr 2003, Paul Mackerras wrote:
    >
    > Since __ide_mm_insw doesn't get told whether it is transferring normal
    > sector data or drive ID data, it can't necessarily do the right thing
    > in both situations.

    Can we please then just separate the two functions out into "fetch sector
    data" and "fetch drive ID"? And NOT playing with another frigging broken
    passed-down flag that people get wrong and isn't obvious what it does
    anyway? It's a lot easier to do

    /* On sane architectures, data and ID are accessed the same */
    #define ide_fetch_sector_data(...) __ide_fetch_data(..)
    #define ide_fetch_id_data(...) __ide_fetch_data(..)

    than it is to carry a flag around and having to remember to get it right
    in every place this is used.

    It's more efficient too, but the _clarity_ and lack of dynamic flags is a
    hell of a lot more important.

    And stupid architectures that may have to re-implement (and possible
    duplicate) the ID fetch code only have themselves to blame. Although it
    might easily be as simple as

    /*
    * The PCI bus is wired up the wrong way, we need to byteswap
    * the ID results after they come back
    */
    static inline xxx ide_fetch_id_data(...)
    {
    __ide_fetch_data(..)
    bswap_id_data(..)
    }

    and please keep this in some m68k-specific file instead of forcing
    _everybody_ to know about the braindamage.

    Linus

    -
    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 13:34    [W:0.022 / U:61.376 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site