Skip to content

Commit dad98c5

Browse files
arndbkleikamp
authored andcommitted
jfs: avoid -Wtautological-constant-out-of-range-compare warning again
The comparison of an __s8 value against DTPAGEMAXSLOT is still trivially true, causing a harmless (default disabled) warning with clang: fs/jfs/jfs_dtree.c:4419:25: error: result of comparison of constant 128 with expression of type 's8' (aka 'signed char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 4419 | p->header.freelist >= DTPAGEMAXSLOT)) { | ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~ I previously worked around two of these in commit 7833570 ("jfs: avoid -Wtautological-constant-out-of-range-compare warning"), but now a new one has come up, so address the same way by dropping the redundant range check. Fixes: 119e448 ("jfs: add dtpage integrity check to prevent index/pointer overflows") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
1 parent 679330e commit dad98c5

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

fs/jfs/jfs_dtree.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4412,11 +4412,8 @@ bool check_dtpage(dtpage_t *p)
44124412
}
44134413
} else {
44144414
int fsi;
4415-
/* When there are free slots, freelist must be a valid slot index in
4416-
* 1~DTROOTMAXSLOT-1(since slot[0] is occupied by the header).
4417-
*/
4418-
if (unlikely(p->header.freelist < 1 ||
4419-
p->header.freelist >= DTPAGEMAXSLOT)) {
4415+
4416+
if (unlikely(p->header.freelist < 1)) {
44204417
jfs_err("Bad freelist:%d in dtpage\n", p->header.freelist);
44214418
return false;
44224419
}

0 commit comments

Comments
 (0)