Commit 6b5d9177 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: dont cast to char * for XFS_DFORK_*PTR macros

Code in the next patch will assign the return value of XFS_DFORK_*PTR
macros to a struct pointer.  gcc complains about casting char* strings
to struct pointers, so let's fix the macro's cast to void* to shut up
the warnings.

While we're at it, fix one of the scrub tests that uses PTR to use BOFF
instead for a simpler integer comparison, since other linters whine
about char* and void* comparisons.

Can't satisfy all these dman bots.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 576d30ec
...@@ -1008,7 +1008,7 @@ enum xfs_dinode_fmt { ...@@ -1008,7 +1008,7 @@ enum xfs_dinode_fmt {
* Return pointers to the data or attribute forks. * Return pointers to the data or attribute forks.
*/ */
#define XFS_DFORK_DPTR(dip) \ #define XFS_DFORK_DPTR(dip) \
((char *)dip + xfs_dinode_size(dip->di_version)) ((void *)dip + xfs_dinode_size(dip->di_version))
#define XFS_DFORK_APTR(dip) \ #define XFS_DFORK_APTR(dip) \
(XFS_DFORK_DPTR(dip) + XFS_DFORK_BOFF(dip)) (XFS_DFORK_DPTR(dip) + XFS_DFORK_BOFF(dip))
#define XFS_DFORK_PTR(dip,w) \ #define XFS_DFORK_PTR(dip,w) \
......
...@@ -556,7 +556,7 @@ xchk_dinode( ...@@ -556,7 +556,7 @@ xchk_dinode(
} }
/* di_forkoff */ /* di_forkoff */
if (XFS_DFORK_APTR(dip) >= (char *)dip + mp->m_sb.sb_inodesize) if (XFS_DFORK_BOFF(dip) >= mp->m_sb.sb_inodesize)
xchk_ino_set_corrupt(sc, ino); xchk_ino_set_corrupt(sc, ino);
if (naextents != 0 && dip->di_forkoff == 0) if (naextents != 0 && dip->di_forkoff == 0)
xchk_ino_set_corrupt(sc, ino); xchk_ino_set_corrupt(sc, ino);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment