aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4_extents.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-08-14 10:41:30 -0400
committerTheodore Ts'o <tytso@mit.edu>2021-08-30 23:36:50 -0400
commita5fda11338180db13f3e9eec20c9deda1f7bad72 (patch)
treef8124d2048cf6b350e4778757b414658c2487c67 /fs/ext4/ext4_extents.h
parentbd2c38cf1726ea913024393a0d11f2e2a3f4c180 (diff)
downloadlinux-a5fda11338180db13f3e9eec20c9deda1f7bad72.tar.gz
ext4: fix sparse warnings
Add sparse annotations to suppress false positive context imbalance warnings, and use NULL instead of 0 in EXT_MAX_{EXTENT,INDEX}. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_extents.h')
-rw-r--r--fs/ext4/ext4_extents.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h
index 44e59881a1f0b..26435f3a30946 100644
--- a/fs/ext4/ext4_extents.h
+++ b/fs/ext4/ext4_extents.h
@@ -173,10 +173,11 @@ struct partial_cluster {
#define EXT_MAX_EXTENT(__hdr__) \
((le16_to_cpu((__hdr__)->eh_max)) ? \
((EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_max) - 1)) \
- : 0)
+ : NULL)
#define EXT_MAX_INDEX(__hdr__) \
((le16_to_cpu((__hdr__)->eh_max)) ? \
- ((EXT_FIRST_INDEX((__hdr__)) + le16_to_cpu((__hdr__)->eh_max) - 1)) : 0)
+ ((EXT_FIRST_INDEX((__hdr__)) + le16_to_cpu((__hdr__)->eh_max) - 1)) \
+ : NULL)
static inline struct ext4_extent_header *ext_inode_hdr(struct inode *inode)
{