]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: consume the xfs_warn mountpoint argument
authorDarrick J. Wong <djwong@kernel.org>
Wed, 23 Nov 2022 17:09:00 +0000 (09:09 -0800)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Dec 2022 09:18:19 +0000 (10:18 +0100)
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 <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/libxfs_priv.h

index 883b22948bb1d8a466fb0ce7077a96ac3d3a8af3..ad4b9475832d6ff0cea99c638f9d97cf6ce05423 100644 (file)
@@ -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)