mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: use module_name() macro for debug printf
@ 2018-03-13 13:03 Arnd Bergmann
  2018-03-13 21:56 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-03-13 13:03 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: Arnd Bergmann, NeilBrown, Aliaksei Karaliou, lustre-devel, devel,
	linux-kernel

We now allow lustre to be built when CONFIG_MODULES is disabled,
but that causes a build failure:

In file included from drivers/staging/lustre/include/linux/libcfs/libcfs.h:42,
                 from drivers/staging/lustre/lustre/obdclass/lu_object.c:44:
drivers/staging/lustre/lustre/obdclass/lu_object.c: In function 'lu_context_key_degister':
drivers/staging/lustre/lustre/obdclass/lu_object.c:1410:51: error: dereferencing pointer to incomplete type 'struct module'

This particular case can be avoided by using the module_name()
macro that was designed exactly to handle printing the name of
a module in all configurations.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 8ddf23b82a2c..3ae16e8501c2 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -1407,7 +1407,7 @@ void lu_context_key_degister(struct lu_context_key *key)
 	while (atomic_read(&key->lct_used) > 1) {
 		spin_unlock(&lu_keys_guard);
 		CDEBUG(D_INFO, "%s: \"%s\" %p, %d\n",
-		       __func__, key->lct_owner ? key->lct_owner->name : "",
+		       __func__, module_name(key->lct_owner),
 		       key, atomic_read(&key->lct_used));
 		schedule();
 		spin_lock(&lu_keys_guard);
@@ -1547,7 +1547,7 @@ void lu_context_key_quiesce(struct lu_context_key *key)
 			spin_unlock(&lu_keys_guard);
 			CDEBUG(D_INFO, "%s: \"%s\" %p, %d (%d)\n",
 			       __func__,
-			       key->lct_owner ? key->lct_owner->name : "",
+			       module_name(key->lct_owner),
 			       key, atomic_read(&key->lct_used),
 			atomic_read(&lu_key_initing_cnt));
 			schedule();
-- 
2.9.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-13 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 13:03 [PATCH] staging: lustre: use module_name() macro for debug printf Arnd Bergmann
2018-03-13 21:56 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®