]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
jfs: avoid -Wtautological-constant-out-of-range-compare warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 2 Feb 2026 20:43:45 +0000 (21:43 +0100)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Mon, 2 Feb 2026 20:47:12 +0000 (14:47 -0600)
commit7833570dae833028337bb53b7f389825b910c100
treefe3e9183a1155a8e90fee620b4f16d7cc21e4cfc
parenteb0cfcf265714b419cc3549895a00632e76732ae
jfs: avoid -Wtautological-constant-out-of-range-compare warning

A recent change for the range check started triggering a clang warning:

fs/jfs/jfs_dtree.c:2906:31: 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]
 2906 |                         if (stbl[i] < 0 || stbl[i] >= DTPAGEMAXSLOT) {
      |                                            ~~~~~~~ ^  ~~~~~~~~~~~~~
fs/jfs/jfs_dtree.c:3111:30: 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]
 3111 |                 if (stbl[0] < 0 || stbl[0] >= DTPAGEMAXSLOT) {
      |                                    ~~~~~~~ ^  ~~~~~~~~~~~~~

Both the old and the new check were useless, but the previous version
apparently did not lead to the warning.

Remove the extraneous range check for simplicity.

Fixes: cafc6679824a ("jfs: replace hardcoded magic number with DTPAGEMAXSLOT constant")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
fs/jfs/jfs_dtree.c