diff mbox series

[23/33] xfs: replace ATTR_ENTBASESIZE with offsetoff

Message ID 20191212105433.1692-24-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [01/33] xfs: clear kernel only flags in XFS_IOC_ATTRMULTI_BY_HANDLE | expand

Commit Message

Christoph Hellwig Dec. 12, 2019, 10:54 a.m. UTC
Replace an opencoded offsetof with the actual helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_attr_list.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 9c4acb6dc856..7f08e417d131 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -545,10 +545,9 @@  xfs_attr_list_int(
 	return error;
 }
 
-#define	ATTR_ENTBASESIZE		/* minimum bytes used by an attr */ \
-	(((struct attrlist_ent *) 0)->a_name - (char *) 0)
 #define	ATTR_ENTSIZE(namelen)		/* actual bytes used by an attr */ \
-	((ATTR_ENTBASESIZE + (namelen) + 1 + sizeof(uint32_t)-1) \
+	((offsetof(struct attrlist_ent, a_name) + \
+	 (namelen) + 1 + sizeof(uint32_t) - 1) \
 	 & ~(sizeof(uint32_t)-1))
 
 /*