]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Make log function uppercase
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 25 Nov 2011 03:05:30 +0000 (01:05 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 25 Nov 2011 03:05:30 +0000 (01:05 -0200)
The worst case is the err() macro. Usually err is used as a variable,
which clashes with this macro.

libkmod/libkmod-loaded.c
libkmod/libkmod-private.h
libkmod/libkmod.c

index f209a790ef06914ed60d16c8cd6a684c662e68de..f881fb6c0e9cdd61a7c00744f2b6a6264537fe25 100644 (file)
@@ -103,7 +103,7 @@ KMOD_EXPORT struct kmod_loaded *kmod_loaded_unref(struct kmod_loaded *mod)
        if (--mod->refcount > 0)
                return mod;
 
-       dbg(mod->ctx, "kmod_loaded %p released\n", mod);
+       DBG(mod->ctx, "kmod_loaded %p released\n", mod);
 
        kmod_unref(mod->ctx);
        loaded_modules_free(mod);
@@ -254,7 +254,7 @@ KMOD_EXPORT int kmod_loaded_remove_module(struct kmod_loaded *mod,
 
        err = delete_module(m->name, flags);
        if (err != 0) {
-               err(mod->ctx, "Removing '%s': %s\n", m->name,
+               ERR(mod->ctx, "Removing '%s': %s\n", m->name,
                                                        strerror(-err));
                return err;
        }
index 56ada3a4acdd44cba608cfe7a5003af46110059a..20da56106488ab6ea9c69d7922931ed96581d73f 100644 (file)
@@ -18,16 +18,16 @@ static __always_inline __printf_format(2, 3) void
 
 #ifdef ENABLE_LOGGING
 #  ifdef ENABLE_DEBUG
-#    define dbg(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
+#    define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
 #  else
-#    define dbg(ctx, arg...) kmod_log_null(ctx, ## arg)
+#    define DBG(ctx, arg...) kmod_log_null(ctx, ## arg)
 #  endif
-#  define info(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
-#  define err(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)
+#  define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
+#  define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)
 #else
-#  define dbg(ctx, arg...) kmod_log_null(ctx, ## arg)
-#  define info(ctx, arg...) kmod_log_null(ctx, ## arg)
-#  define err(ctx, arg...) kmod_log_null(ctx, ## arg)
+#  define DBG(ctx, arg...) kmod_log_null(ctx, ## arg)
+#  define INFO(ctx, arg...) kmod_log_null(ctx, ## arg)
+#  define ERR(ctx, arg...) kmod_log_null(ctx, ## arg)
 #endif
 
 #define KMOD_EXPORT __attribute__ ((visibility("default")))
index 6417cab9923cb030722e7e147d70ae2e453e5cad..49acea2a66874acbf5c7673aad2f725fb7588129 100644 (file)
@@ -169,8 +169,8 @@ KMOD_EXPORT struct kmod_ctx *kmod_new(const char *dirname)
        if (env != NULL)
                kmod_set_log_priority(ctx, log_priority(env));
 
-       info(ctx, "ctx %p created\n", ctx);
-       dbg(ctx, "log_priority=%d\n", ctx->log_priority);
+       INFO(ctx, "ctx %p created\n", ctx);
+       DBG(ctx, "log_priority=%d\n", ctx->log_priority);
 
        return ctx;
 }
@@ -206,7 +206,7 @@ KMOD_EXPORT struct kmod_ctx *kmod_unref(struct kmod_ctx *ctx)
 
        if (--ctx->refcount > 0)
                return ctx;
-       info(ctx, "context %p released\n", ctx);
+       INFO(ctx, "context %p released\n", ctx);
        free((char *)ctx->dirname);
        free(ctx);
        return NULL;
@@ -229,7 +229,7 @@ KMOD_EXPORT void kmod_set_log_fn(struct kmod_ctx *ctx,
                                                const char *format, va_list args))
 {
        ctx->log_fn = log_fn;
-       info(ctx, "custom logging function %p registered\n", log_fn);
+       INFO(ctx, "custom logging function %p registered\n", log_fn);
 }
 
 /**