diff mbox series

[02/10] xfs: make checksum verifiers consistently return bools

Message ID fb3cd029-89d0-4e4a-0795-6c109254546b@redhat.com (mailing list archive)
State Deferred, archived
Headers show
Series xfs: add verifier context structure | expand

Commit Message

Eric Sandeen Dec. 5, 2018, 9:03 p.m. UTC
xfs_verify_cksum returns the result of a comparison, so make it
a bool. xfs_buf_verify_cksum calls it, so make it a bool as well.
Other callers up the callchain from here are already bools.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/libxfs/xfs_cksum.h | 2 +-
 fs/xfs/xfs_buf.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Brian Foster Dec. 7, 2018, 1:36 p.m. UTC | #1
On Wed, Dec 05, 2018 at 03:03:05PM -0600, Eric Sandeen wrote:
> xfs_verify_cksum returns the result of a comparison, so make it
> a bool. xfs_buf_verify_cksum calls it, so make it a bool as well.
> Other callers up the callchain from here are already bools.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_cksum.h | 2 +-
>  fs/xfs/xfs_buf.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h
> index 999a290cfd72..1e3802a99867 100644
> --- a/fs/xfs/libxfs/xfs_cksum.h
> +++ b/fs/xfs/libxfs/xfs_cksum.h
> @@ -71,7 +71,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  /*
>   * Helper to verify the checksum for a buffer.
>   */
> -static inline int
> +static inline bool
>  xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  {
>  	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
> diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
> index b9f5511ea998..5015255b5ede 100644
> --- a/fs/xfs/xfs_buf.h
> +++ b/fs/xfs/xfs_buf.h
> @@ -359,7 +359,7 @@ static inline void xfs_buf_relse(xfs_buf_t *bp)
>  	xfs_buf_rele(bp);
>  }
>  
> -static inline int
> +static inline bool
>  xfs_buf_verify_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
>  {
>  	return xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length),
> -- 
> 2.17.0
> 
>
Darrick J. Wong Dec. 17, 2018, 6:24 p.m. UTC | #2
On Wed, Dec 05, 2018 at 03:03:05PM -0600, Eric Sandeen wrote:
> xfs_verify_cksum returns the result of a comparison, so make it
> a bool. xfs_buf_verify_cksum calls it, so make it a bool as well.
> Other callers up the callchain from here are already bools.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/libxfs/xfs_cksum.h | 2 +-
>  fs/xfs/xfs_buf.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h
> index 999a290cfd72..1e3802a99867 100644
> --- a/fs/xfs/libxfs/xfs_cksum.h
> +++ b/fs/xfs/libxfs/xfs_cksum.h
> @@ -71,7 +71,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  /*
>   * Helper to verify the checksum for a buffer.
>   */
> -static inline int
> +static inline bool
>  xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  {
>  	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
> diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
> index b9f5511ea998..5015255b5ede 100644
> --- a/fs/xfs/xfs_buf.h
> +++ b/fs/xfs/xfs_buf.h
> @@ -359,7 +359,7 @@ static inline void xfs_buf_relse(xfs_buf_t *bp)
>  	xfs_buf_rele(bp);
>  }
>  
> -static inline int
> +static inline bool
>  xfs_buf_verify_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
>  {
>  	return xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length),
> -- 
> 2.17.0
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h
index 999a290cfd72..1e3802a99867 100644
--- a/fs/xfs/libxfs/xfs_cksum.h
+++ b/fs/xfs/libxfs/xfs_cksum.h
@@ -71,7 +71,7 @@  xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 /*
  * Helper to verify the checksum for a buffer.
  */
-static inline int
+static inline bool
 xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 {
 	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index b9f5511ea998..5015255b5ede 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -359,7 +359,7 @@  static inline void xfs_buf_relse(xfs_buf_t *bp)
 	xfs_buf_rele(bp);
 }
 
-static inline int
+static inline bool
 xfs_buf_verify_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
 {
 	return xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length),