lkml.org 
[lkml]   [2008]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] xfs: expose no-op xfs_put_perag()
Date
Hi David,

Inline function xfs_put_perag() in fs/xfs/xfs_mount.h is a no-op.

This patch converts it to no-op macro.

As a result, gcc will emit warning about unused variables,
parameters and so on not in this function, but in its callers,
which is more useful.

This patch, together with previous ones, has already resulted
in more unused params discovered and warned about by gcc.

There is no object code size difference from this change.

Compile tested only.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--
vda
diff -urpN linux-2.6-xfs5/fs/xfs/xfs_mount.h linux-2.6-xfs6/fs/xfs/xfs_mount.h
--- linux-2.6-xfs5/fs/xfs/xfs_mount.h 2008-04-22 04:06:44.000000000 +0200
+++ linux-2.6-xfs6/fs/xfs/xfs_mount.h 2008-04-22 12:13:17.000000000 +0200
@@ -471,11 +471,17 @@ xfs_get_perag(struct xfs_mount *mp, xfs_
return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)];
}

+/* Macro (instead of inline) makes gcc understand that params are not used
+ * and emit "unused" warnings *in callers* if they otherwise are not using
+ * variables passed to xfs_put_perag. We want to know that. */
+#define xfs_put_perag(mp, pag) ((void)0)
+#if 0
static inline void
xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag)
{
/* nothing to see here, move along */
}
+#endif

/*
* Per-cpu superblock locking functions
\
 
 \ /
  Last update: 2008-04-22 15:51    [W:0.445 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site