lkml.org 
[lkml]   [2004]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] Remove pointless <0 comparison for unsigned variable in fs/fcntl.c

    Hi,

    This patch removes a pointless comparison. "arg" is an unsigned long, thus
    it can never be <0, so testing that is pointless.

    Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

    diff -up linux-2.6.10-rc2-bk6-orig/fs/fcntl.c linux-2.6.10-rc2-bk6/fs/fcntl.c
    --- linux-2.6.10-rc2-bk6-orig/fs/fcntl.c 2004-11-17 01:20:14.000000000 +0100
    +++ linux-2.6.10-rc2-bk6/fs/fcntl.c 2004-11-21 23:49:20.000000000 +0100
    @@ -340,7 +340,7 @@ static long do_fcntl(int fd, unsigned in
    break;
    case F_SETSIG:
    /* arg == 0 restores default behaviour. */
    - if (arg < 0 || arg > _NSIG) {
    + if (arg > _NSIG) {
    break;
    }
    err = 0;

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