From c4e5ad75d85e0740c4ee53b720f9162c11d15a12 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 15 Jul 2022 14:44:53 -0700 Subject: [PATCH] libxfs: consume the xfs_warn mountpoint argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix these warnings because xfs_warn doesn't do anything in userspace: xfs_alloc.c: In function ‘xfs_alloc_get_rec’: xfs_alloc.c:246:34: warning: unused variable ‘mp’ [-Wunused-variable] 246 | struct xfs_mount *mp = cur->bc_mp; | ^~ Signed-off-by: Darrick J. Wong --- libxfs/libxfs_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index ad920cd9b..b2c3f694b 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -125,7 +125,7 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC }; #define xfs_info(mp,fmt,args...) cmn_err(CE_CONT, _(fmt), ## args) #define xfs_notice(mp,fmt,args...) cmn_err(CE_NOTE, _(fmt), ## args) -#define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN, _(fmt), ## args) +#define xfs_warn(mp,fmt,args...) cmn_err((mp) ? CE_WARN : CE_WARN, _(fmt), ## args) #define xfs_err(mp,fmt,args...) cmn_err(CE_ALERT, _(fmt), ## args) #define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT, _(fmt), ## args) -- 2.47.3