From e2ec8c2bb1829afab1ee62c76a45e3aab2023bce Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 24 Jul 2014 21:39:17 +0400 Subject: [PATCH] LU-5200 llite: Cmp of unsigned value against 0 is always true Comparison of unsigned value against 0 is always true. desc->bd_iov_count declared as int and atomic_sub_return() have first argument int also. Signed-off-by: Dmitry Eremin Change-Id: I89cedc4991d1a117f824ce6b5d8cf045595fdc0f Reviewed-on: http://review.whamcloud.com/11217 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/llite/lproc_llite.c | 2 +- lustre/osc/osc_page.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 152e4a7..d4dcece 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -843,7 +843,7 @@ static ssize_t ll_unstable_stats_seq_write(struct file *file, if (count == 0) return 0; - if (count < 0 || count >= sizeof(kernbuf)) + if (count >= sizeof(kernbuf)) return -EINVAL; if (copy_from_user(kernbuf, buffer, count)) diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 8a77710..6bae304 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -979,7 +979,7 @@ void osc_dec_unstable_pages(struct ptlrpc_request *req) { struct ptlrpc_bulk_desc *desc = req->rq_bulk; struct client_obd *cli = &req->rq_import->imp_obd->u.cli; - obd_count page_count = desc->bd_iov_count; + int page_count = desc->bd_iov_count; int unstable_count; LASSERT(page_count >= 0); -- 1.8.3.1