Improve system log messaging in ccp-crypto
Subsystems (2)
cover Improve system log messaging in ccp-crypto
From: Gary R Hook <[email protected]>
Add a prefix to any messages logged by the ccp-crypto module, and add a notice if the module fails to load in the case that no CCPs are defined.
Gary R Hook (2):
crypto: ccp - Include the module name in system log messages
crypto: ccp - Log an error message when ccp-crypto fails to load
drivers/crypto/ccp/ccp-crypto-main.c | 4 +++- drivers/crypto/ccp/ccp-crypto.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
PATCH 1/2 crypto: ccp - Include the module name in system log messages
Redefine pr_fmt so that the module name is prefixed to every log message produced by the ccp-crypto module
--- drivers/crypto/ccp/ccp-crypto.h | 4 ++++ 1 file changed, 4 insertions(+)
drivers/crypto/ccp/ccp-crypto.h +4 -0
@@ -24,6 +24,10 @@#include <crypto/akcipher.h> #include <crypto/internal/rsa.h> +/* We want the module name in front of our messages */ +#undef pr_fmt +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define CCP_LOG_LEVEL KERN_INFO#define CCP_CRA_PRIORITY 300
Signature · 1 line
2.17.1
PATCH 2/2 crypto: ccp - Log an error message when ccp-crypto fails to load
In reply to Hook, GaryIf there are no CCP devices on the system, ccp-crypto will not load. Write a message to the system log clarifying the reason for the failure of the modprobe operation
--- drivers/crypto/ccp/ccp-crypto-main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/crypto/ccp/ccp-crypto-main.c +3 -1
@@ -405,8 +405,10 @@ static int ccp_crypto_init(void)int ret; ret =ccp_present (); -if (ret) +if (ret) { +pr_err ("Cannot load: there are no available CCPs\n" );return ret; + }spin_lock_init (&req_queue_lock);INIT_LIST_HEAD (&req_queue.cmds);
Signature · 1 line
2.17.1
Herbert Xu
maintainerQuoted 6 lines · Gary
From: Gary R Hook <[email protected]>
Add a prefix to any messages logged by the ccp-crypto module, and add a notice if the module fails to load in the case that no CCPs are defined.
Quoted 7 lines
Gary R Hook (2):
crypto: ccp - Include the module name in system log messages
crypto: ccp - Log an error message when ccp-crypto fails to load
drivers/crypto/ccp/ccp-crypto-main.c| 4 +++-drivers/crypto/ccp/ccp-crypto.h| 4 ++++2 files changed, 7 insertions(+), 1 deletion(-)
All applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt