• Linus Torvalds's avatar
    Revert "fanotify: remove unneeded sub-zero check for unsigned value" · d0e71e23
    Linus Torvalds authored
    This reverts commit e6595224.
    
    These kinds of patches are only making the code worse.
    
    Compilers don't care about the unnecessary check, but removing it makes
    the code less obvious to a human.  The declaration of 'len' is more than
    80 lines earlier, so a human won't easily see that 'len' is of an
    unsigned type, so to a human the range check that checks against zero is
    much more explicit and obvious.
    
    Any tool that complains about a range check like this just because the
    variable is unsigned is actively detrimental, and should be ignored.
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d0e71e23
fanotify_user.c 51.9 KB