From 5df71f87411a948647aa2f60298b7e429544c4dc Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Sun, 25 Oct 2020 14:15:58 +0100 Subject: [PATCH] xt_pknock: use `pr_err` Replace some instances of `printk(KERN_ERR PKNOCK ...)`. We define `pr_fmt`, so `pr_err` is equivalent. Signed-off-by: Jeremy Sowden --- extensions/pknock/xt_pknock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/pknock/xt_pknock.c b/extensions/pknock/xt_pknock.c index 0fcbca7..e3d6a90 100644 --- a/extensions/pknock/xt_pknock.c +++ b/extensions/pknock/xt_pknock.c @@ -1013,7 +1013,7 @@ out: return ret; } -#define RETURN_ERR(err) do { printk(KERN_ERR PKNOCK err); return -EINVAL; } while (false) +#define RETURN_ERR(err) do { pr_err(err); return -EINVAL; } while (false) static int pknock_mt_check(const struct xt_mtchk_param *par) { @@ -1100,14 +1100,14 @@ static int __init xt_pknock_mt_init(void) if (gc_expir_time < DEFAULT_GC_EXPIRATION_TIME) gc_expir_time = DEFAULT_GC_EXPIRATION_TIME; if (request_module(crypto.algo) < 0) { - printk(KERN_ERR PKNOCK "request_module('%s') error.\n", + pr_err("request_module('%s') error.\n", crypto.algo); return -ENXIO; } crypto.tfm = crypto_alloc_shash(crypto.algo, 0, 0); if (IS_ERR(crypto.tfm)) { - printk(KERN_ERR PKNOCK "failed to load transform for %s\n", + pr_err("failed to load transform for %s\n", crypto.algo); return PTR_ERR(crypto.tfm); } @@ -1117,7 +1117,7 @@ static int __init xt_pknock_mt_init(void) pde = proc_mkdir("xt_pknock", init_net.proc_net); if (pde == NULL) { - printk(KERN_ERR PKNOCK "proc_mkdir() error in _init().\n"); + pr_err("proc_mkdir() error in _init().\n"); return -ENXIO; } return xt_register_match(&xt_pknock_mt_reg);