Skip to content

Commit

Permalink
libxfs: Fix a couple of sparse complaintis
Browse files Browse the repository at this point in the history
No significant changes, just silence a couple of sparse errors.

Using cpu_to_be32(NULLAGINO), the NULLAGINO constant will be encoded in
BE as a constant, avoiding a BE -> CPU conversion every iteraction of
the loop, if be32_to_cpu(agi->agi_unlinked[i]) was used instead.

Signed-off-by: Carlos Maiolino <[email protected]>
Reviewed-by: Bill O'Donnell <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
  • Loading branch information
cmaiolino authored and djwong committed Jul 17, 2018
1 parent e4e542a commit 5089eaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_ag_resv.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ xfs_ag_resv_rmapbt_alloc(
struct xfs_mount *mp,
xfs_agnumber_t agno)
{
struct xfs_alloc_arg args = {0};
struct xfs_alloc_arg args = { NULL };
struct xfs_perag *pag;

args.len = 1;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,7 @@ xfs_agi_verify(
return __this_address;

for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
if (agi->agi_unlinked[i] == NULLAGINO)
if (agi->agi_unlinked[i] == cpu_to_be32(NULLAGINO))
continue;
if (!xfs_verify_ino(mp, be32_to_cpu(agi->agi_unlinked[i])))
return __this_address;
Expand Down

0 comments on commit 5089eaf

Please sign in to comment.