Commit 380b33b8 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lustre: fix all less than 0 comparison for unsigned values

Remove all test of less than zero for unsigned values
found with -Wtype-limits.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8843
Reviewed-on: https://review.whamcloud.com/23811Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarJian Yu <jian.yu@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec57d6e6
...@@ -1358,7 +1358,7 @@ struct cl_2queue { ...@@ -1358,7 +1358,7 @@ struct cl_2queue {
/** IO types */ /** IO types */
enum cl_io_type { enum cl_io_type {
/** read system call */ /** read system call */
CIT_READ, CIT_READ = 1,
/** write system call */ /** write system call */
CIT_WRITE, CIT_WRITE,
/** truncate, utime system calls */ /** truncate, utime system calls */
......
...@@ -115,7 +115,7 @@ void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len) ...@@ -115,7 +115,7 @@ void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len)
static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which) static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which)
{ {
LASSERTF(which >= 0 && which < _NR_RA_STAT, "which: %u\n", which); LASSERTF(which < _NR_RA_STAT, "which: %u\n", which);
lprocfs_counter_incr(sbi->ll_ra_stats, which); lprocfs_counter_incr(sbi->ll_ra_stats, which);
} }
......
...@@ -638,7 +638,7 @@ static const struct lov_layout_operations lov_dispatch[] = { ...@@ -638,7 +638,7 @@ static const struct lov_layout_operations lov_dispatch[] = {
enum lov_layout_type __llt; \ enum lov_layout_type __llt; \
\ \
__llt = __obj->lo_type; \ __llt = __obj->lo_type; \
LASSERT(0 <= __llt && __llt < ARRAY_SIZE(lov_dispatch)); \ LASSERT(__llt < ARRAY_SIZE(lov_dispatch)); \
lov_dispatch[__llt].op(__VA_ARGS__); \ lov_dispatch[__llt].op(__VA_ARGS__); \
}) })
...@@ -697,7 +697,7 @@ do { \ ...@@ -697,7 +697,7 @@ do { \
\ \
lov_conf_freeze(__obj); \ lov_conf_freeze(__obj); \
__llt = __obj->lo_type; \ __llt = __obj->lo_type; \
LASSERT(0 <= __llt && __llt < ARRAY_SIZE(lov_dispatch)); \ LASSERT(__llt < ARRAY_SIZE(lov_dispatch)); \
lov_dispatch[__llt].op(__VA_ARGS__); \ lov_dispatch[__llt].op(__VA_ARGS__); \
lov_conf_thaw(__obj); \ lov_conf_thaw(__obj); \
} while (0) } while (0)
...@@ -748,13 +748,13 @@ static int lov_layout_change(const struct lu_env *unused, ...@@ -748,13 +748,13 @@ static int lov_layout_change(const struct lu_env *unused,
u16 refcheck; u16 refcheck;
int rc; int rc;
LASSERT(0 <= lov->lo_type && lov->lo_type < ARRAY_SIZE(lov_dispatch)); LASSERT(lov->lo_type < ARRAY_SIZE(lov_dispatch));
env = cl_env_get(&refcheck); env = cl_env_get(&refcheck);
if (IS_ERR(env)) if (IS_ERR(env))
return PTR_ERR(env); return PTR_ERR(env);
LASSERT(0 <= llt && llt < ARRAY_SIZE(lov_dispatch)); LASSERT(llt < ARRAY_SIZE(lov_dispatch));
CDEBUG(D_INODE, DFID " from %s to %s\n", CDEBUG(D_INODE, DFID " from %s to %s\n",
PFID(lu_object_fid(lov2lu(lov))), PFID(lu_object_fid(lov2lu(lov))),
......
...@@ -57,7 +57,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr, ...@@ -57,7 +57,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
if (rc) if (rc)
return rc; return rc;
if (val < 0 || val > 1) if (val > 1)
return -ERANGE; return -ERANGE;
/* opposite senses */ /* opposite senses */
......
...@@ -783,6 +783,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, ...@@ -783,6 +783,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
/* pull ext's start back to cover cur */ /* pull ext's start back to cover cur */
ext->oe_start = cur->oe_start; ext->oe_start = cur->oe_start;
ext->oe_grants += chunksize; ext->oe_grants += chunksize;
LASSERT(*grants >= chunksize);
*grants -= chunksize; *grants -= chunksize;
found = osc_extent_hold(ext); found = osc_extent_hold(ext);
...@@ -790,6 +791,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, ...@@ -790,6 +791,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
/* rear merge */ /* rear merge */
ext->oe_end = cur->oe_end; ext->oe_end = cur->oe_end;
ext->oe_grants += chunksize; ext->oe_grants += chunksize;
LASSERT(*grants >= chunksize);
*grants -= chunksize; *grants -= chunksize;
/* try to merge with the next one because we just fill /* try to merge with the next one because we just fill
...@@ -819,8 +821,8 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, ...@@ -819,8 +821,8 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
/* create a new extent */ /* create a new extent */
EASSERT(osc_extent_is_overlapped(obj, cur) == 0, cur); EASSERT(osc_extent_is_overlapped(obj, cur) == 0, cur);
cur->oe_grants = chunksize + cli->cl_extent_tax; cur->oe_grants = chunksize + cli->cl_extent_tax;
LASSERT(*grants >= cur->oe_grants);
*grants -= cur->oe_grants; *grants -= cur->oe_grants;
LASSERT(*grants >= 0);
cur->oe_state = OES_CACHE; cur->oe_state = OES_CACHE;
found = osc_extent_hold(cur); found = osc_extent_hold(cur);
...@@ -849,7 +851,6 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, ...@@ -849,7 +851,6 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
out: out:
osc_extent_put(env, cur); osc_extent_put(env, cur);
LASSERT(*grants >= 0);
return found; return found;
} }
...@@ -1219,8 +1220,8 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index, ...@@ -1219,8 +1220,8 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index,
ext->oe_end = end_index; ext->oe_end = end_index;
ext->oe_grants += chunksize; ext->oe_grants += chunksize;
LASSERT(*grants >= chunksize);
*grants -= chunksize; *grants -= chunksize;
LASSERT(*grants >= 0);
EASSERTF(osc_extent_is_overlapped(obj, ext) == 0, ext, EASSERTF(osc_extent_is_overlapped(obj, ext) == 0, ext,
"overlapped after expanding for %lu.\n", index); "overlapped after expanding for %lu.\n", index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment