From c418dbc9805dbd215586454f0c5729333219aa63 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Fri, 4 Sep 2020 09:51:39 -0700 Subject: xfs: Use variable-size array for nameval in xfs_attr_sf_entry nameval is a variable-size array, so, define it as it, and remove all the -1 magic number subtractions Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr_sf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/xfs/libxfs/xfs_attr_sf.h') diff --git a/fs/xfs/libxfs/xfs_attr_sf.h b/fs/xfs/libxfs/xfs_attr_sf.h index c4afb3307918..29934103ce55 100644 --- a/fs/xfs/libxfs/xfs_attr_sf.h +++ b/fs/xfs/libxfs/xfs_attr_sf.h @@ -27,11 +27,11 @@ typedef struct xfs_attr_sf_sort { } xfs_attr_sf_sort_t; #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) /* space name/value uses */ \ - (((int)sizeof(struct xfs_attr_sf_entry)-1 + (nlen)+(vlen))) + ((sizeof(struct xfs_attr_sf_entry) + (nlen) + (vlen))) #define XFS_ATTR_SF_ENTSIZE_MAX /* max space for name&value */ \ ((1 << (NBBY*(int)sizeof(uint8_t))) - 1) #define XFS_ATTR_SF_ENTSIZE(sfep) /* space an entry uses */ \ - ((int)sizeof(struct xfs_attr_sf_entry)-1 + \ + ((int)sizeof(struct xfs_attr_sf_entry) + \ (sfep)->namelen+(sfep)->valuelen) #define XFS_ATTR_SF_NEXTENTRY(sfep) /* next entry in struct */ \ ((struct xfs_attr_sf_entry *)((char *)(sfep) + \ -- cgit v1.2.3