Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757444AbdIIKDI (ORCPT ); Sat, 9 Sep 2017 06:03:08 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:37309 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756862AbdIIKDH (ORCPT ); Sat, 9 Sep 2017 06:03:07 -0400 X-Google-Smtp-Source: ADKCNb4wOYc945oXiJ6LUbY7uTCmmyx49BbzsawnEJS682mMj3O5+Eo50bUgrdy9XEwIUsLC6/Ylgw== Date: Sat, 9 Sep 2017 11:03:03 +0100 From: Christos Gkekas To: David Howells , linux-cachefs@redhat.com, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] cachefiles: Remove unnecessary comparisons in daemon.c Message-ID: <20170909100303.GA5323@inspiron> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1353 Lines: 40 Remove unnecessary comparisons of unsigned variables with zero. Signed-off-by: Christos Gkekas --- fs/cachefiles/daemon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c index 1ee54ff..ce072ce 100644 --- a/fs/cachefiles/daemon.c +++ b/fs/cachefiles/daemon.c @@ -229,7 +229,7 @@ static ssize_t cachefiles_daemon_write(struct file *file, if (test_bit(CACHEFILES_DEAD, &cache->flags)) return -EIO; - if (datalen < 0 || datalen > PAGE_SIZE - 1) + if (datalen > PAGE_SIZE - 1) return -EOPNOTSUPP; /* drag the command string into the kernel so we can parse it */ @@ -386,7 +386,7 @@ static int cachefiles_daemon_fstop(struct cachefiles_cache *cache, char *args) if (args[0] != '%' || args[1] != '\0') return -EINVAL; - if (fstop < 0 || fstop >= cache->fcull_percent) + if (fstop >= cache->fcull_percent) return cachefiles_daemon_range_error(cache, args); cache->fstop_percent = fstop; @@ -458,7 +458,7 @@ static int cachefiles_daemon_bstop(struct cachefiles_cache *cache, char *args) if (args[0] != '%' || args[1] != '\0') return -EINVAL; - if (bstop < 0 || bstop >= cache->bcull_percent) + if (bstop >= cache->bcull_percent) return cachefiles_daemon_range_error(cache, args); cache->bstop_percent = bstop; -- 2.7.4