lkml.org 
[lkml]   [2004]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] fix warning about duplicate 'const'
    Date
    Hi,

    attached is a patch which fixes following wanings:

    drivers/ide/ide-tape.c: In function `idetape_setup':
    drivers/ide/ide-tape.c:4701: Warnung: duplicate `const'
    drivers/video/matrox/matroxfb_g450.c: In function `g450_compute_bwlevel':
    drivers/video/matrox/matroxfb_g450.c:129: Warnung: duplicate `const'
    drivers/video/matrox/matroxfb_g450.c:130: Warnung: duplicate `const'
    drivers/video/matrox/matroxfb_maven.c: In function `maven_compute_bwlevel':
    drivers/video/matrox/matroxfb_maven.c:347: Warnung: duplicate `const'
    drivers/video/matrox/matroxfb_maven.c:348: Warnung: duplicate `const'

    This is done by removing the 'const' from the temporary variables of the min()
    and max() macros. For me it seems to have no negative impact, so please
    consider applying...

    Best regards
    Thomas Schlichter
    --- linux-2.6.4-rc2/include/linux/kernel.h.orig 2004-03-04 07:16:34.000000000 +0100
    +++ linux-2.6.4-rc2/include/linux/kernel.h 2004-03-09 00:34:21.980935992 +0100
    @@ -168,15 +168,15 @@ extern void dump_stack(void);
    * "unnecessary" pointer comparison.
    */
    #define min(x,y) ({ \
    - const typeof(x) _x = (x); \
    - const typeof(y) _y = (y); \
    - (void) (&_x == &_y); \
    + typeof(x) _x = (x); \
    + typeof(y) _y = (y); \
    + (void) (&_x == &_y); \
    _x < _y ? _x : _y; })

    #define max(x,y) ({ \
    - const typeof(x) _x = (x); \
    - const typeof(y) _y = (y); \
    - (void) (&_x == &_y); \
    + typeof(x) _x = (x); \
    + typeof(y) _y = (y); \
    + (void) (&_x == &_y); \
    _x > _y ? _x : _y; })

    /*
    \
     
     \ /
      Last update: 2005-03-22 14:01    [W:0.020 / U:59.728 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site