{
va_list args;
+ if (ctx->log_fn == NULL)
+ return;
+
va_start(args, format);
ctx->log_fn(ctx->log_data, priority, file, line, fn, format, args);
va_end(args);
const char *format, va_list args),
const void *data)
{
+ if (ctx == NULL)
+ return;
ctx->log_fn = log_fn;
ctx->log_data = (void *)data;
INFO(ctx, "custom logging function %p registered\n", log_fn);
**/
KMOD_EXPORT int kmod_get_log_priority(const struct kmod_ctx *ctx)
{
+ if (ctx == NULL)
+ return -1;
return ctx->log_priority;
}
**/
KMOD_EXPORT void kmod_set_log_priority(struct kmod_ctx *ctx, int priority)
{
+ if (ctx == NULL)
+ return;
ctx->log_priority = priority;
}