nilfs2: make superblock data array index computation sparse friendly
authorRyusuke Konishi <konishi.ryusuke@gmail.com>
Tue, 30 Apr 2024 08:00:19 +0000 (17:00 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 8 May 2024 15:41:28 +0000 (08:41 -0700)
commit91d743a9c8299de1fc1b47428d8bb4c85face00f
tree73406145a3923ac7e3bf642de82db45fbfee5d15
parentbbf45b7e68555569489ab2428dd9c23960cdc9bf
nilfs2: make superblock data array index computation sparse friendly

Upon running sparse, "warning: dubious: x & !y" is output at an array
index calculation within nilfs_load_super_block().

The calculation is not wrong, but to eliminate the sparse warning, replace
it with an equivalent calculation.

Also, add a comment to make it easier to understand what the unintuitive
array index calculation is doing and whether it's correct.

Link: https://lkml.kernel.org/r/20240430080019.4242-3-konishi.ryusuke@gmail.com
Fixes: e339ad31f599 ("nilfs2: introduce secondary super block")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: kernel test robot <lkp@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/the_nilfs.c