diff mbox series

[1/4] libxfs: turn the xfs_buf_incore stub into an inline function

Message ID 20200312141715.550387-2-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series [1/4] libxfs: turn the xfs_buf_incore stub into an inline function | expand

Commit Message

Christoph Hellwig March 12, 2020, 2:17 p.m. UTC
Replace the macro with an inline function to avoid compiler warnings with new
backports of kernel code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/libxfs_priv.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Darrick J. Wong March 12, 2020, 2:56 p.m. UTC | #1
On Thu, Mar 12, 2020 at 03:17:12PM +0100, Christoph Hellwig wrote:
> Replace the macro with an inline function to avoid compiler warnings with new
> backports of kernel code.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

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

--D

> ---
>  libxfs/libxfs_priv.h | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
> index 5d6dd063..17a0104b 100644
> --- a/libxfs/libxfs_priv.h
> +++ b/libxfs/libxfs_priv.h
> @@ -369,14 +369,12 @@ roundup_64(uint64_t x, uint32_t y)
>  #define XFS_BUF_UNDELAYWRITE(bp)	((bp)->b_flags &= ~LIBXFS_B_DIRTY)
>  #define XFS_BUF_SET_BDSTRAT_FUNC(a,b)	((void) 0)
>  
> -/* avoid gcc warning */
> -#define xfs_buf_incore(bt,blkno,len,lockit) ({		\
> -	typeof(blkno) __foo = (blkno);			\
> -	typeof(len) __bar = (len);			\
> -	(blkno) = __foo;				\
> -	(len) = __bar; /* no set-but-unused warning */	\
> -	NULL;						\
> -})
> +static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target,
> +		xfs_daddr_t blkno, size_t numblks, xfs_buf_flags_t flags)
> +{
> +	return NULL;
> +}
> +
>  #define xfs_buf_oneshot(bp)		((void) 0)
>  
>  #define XBRW_READ			LIBXFS_BREAD
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 5d6dd063..17a0104b 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -369,14 +369,12 @@  roundup_64(uint64_t x, uint32_t y)
 #define XFS_BUF_UNDELAYWRITE(bp)	((bp)->b_flags &= ~LIBXFS_B_DIRTY)
 #define XFS_BUF_SET_BDSTRAT_FUNC(a,b)	((void) 0)
 
-/* avoid gcc warning */
-#define xfs_buf_incore(bt,blkno,len,lockit) ({		\
-	typeof(blkno) __foo = (blkno);			\
-	typeof(len) __bar = (len);			\
-	(blkno) = __foo;				\
-	(len) = __bar; /* no set-but-unused warning */	\
-	NULL;						\
-})
+static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target,
+		xfs_daddr_t blkno, size_t numblks, xfs_buf_flags_t flags)
+{
+	return NULL;
+}
+
 #define xfs_buf_oneshot(bp)		((void) 0)
 
 #define XBRW_READ			LIBXFS_BREAD