public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Seidel <fseidel@suse.de>
To: linux kernel <linux-kernel@vger.kernel.org>
Cc: akpm@linux-foundation.org,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, Frank Seidel <fseidel@suse.de>,
	frank@f-seidel.de, herbert@gondor.apana.org.au, jarod@redhat.com
Subject: [PATCH] crypto: add missing KERN_* constants to printks
Date: Fri, 06 Feb 2009 15:19:10 +0100	[thread overview]
Message-ID: <498C46DE.8040700@suse.de> (raw)

From: Frank Seidel <frank@f-seidel.de>

According to kerneljanitors todo list all printk calls (beginning
a new line) should have an according KERN_* constant.
Those are the missing pieces here for the crypto subsystem.

Signed-off-by: Frank Seidel <frank@f-seidel.de>
---
 crypto/ansi_cprng.c |    2 +-
 crypto/tcrypt.c     |   48 +++++++++++++++++++++++++++---------------------
 2 files changed, 28 insertions(+), 22 deletions(-)

--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -74,7 +74,7 @@ static int test_cipher_jiffies(struct bl
 			return ret;
 	}
 
-	printk("%d operations in %d seconds (%ld bytes)\n",
+	printk(KERN_WARNING "%d operations in %d seconds (%ld bytes)\n",
 	       bcount, sec, (long)bcount * blen);
 	return 0;
 }
@@ -122,7 +122,7 @@ out:
 	local_bh_enable();
 
 	if (ret == 0)
-		printk("1 operation in %lu cycles (%d bytes)\n",
+		printk(KERN_WARNING "1 operation in %lu cycles (%d bytes)\n",
 		       (cycles + 4) / 8, blen);
 
 	return ret;
@@ -146,13 +146,13 @@ static void test_cipher_speed(const char
 	else
 		e = "decryption";
 
-	printk("\ntesting speed of %s %s\n", algo, e);
+	printk(KERN_WARNING "\ntesting speed of %s %s\n", algo, e);
 
 	tfm = crypto_alloc_blkcipher(algo, 0, CRYPTO_ALG_ASYNC);
 
 	if (IS_ERR(tfm)) {
-		printk("failed to load transform for %s: %ld\n", algo,
-		       PTR_ERR(tfm));
+		printk(KERN_WARNING "failed to load transform for %s: %ld\n",
+		       algo, PTR_ERR(tfm));
 		return;
 	}
 	desc.tfm = tfm;
@@ -166,14 +166,16 @@ static void test_cipher_speed(const char
 			struct scatterlist sg[TVMEMSIZE];
 
 			if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) {
-				printk("template (%u) too big for "
+				printk(KERN_WARNING
+				       "template (%u) too big for "
 				       "tvmem (%lu)\n", *keysize + *b_size,
 				       TVMEMSIZE * PAGE_SIZE);
 				goto out;
 			}
 
-			printk("test %u (%d bit key, %d byte blocks): ", i,
-					*keysize * 8, *b_size);
+			printk(KERN_WARNING
+					"test %u (%d bit key, %d byte blocks): ",
+					i, *keysize * 8, *b_size);
 
 			memset(tvmem[0], 0xff, PAGE_SIZE);
 
@@ -188,7 +190,8 @@ static void test_cipher_speed(const char
 
 			ret = crypto_blkcipher_setkey(tfm, key, *keysize);
 			if (ret) {
-				printk("setkey() failed flags=%x\n",
+				printk(KERN_WARNING
+						"setkey() failed flags=%x\n",
 						crypto_blkcipher_get_flags(tfm));
 				goto out;
 			}
@@ -215,7 +218,8 @@ static void test_cipher_speed(const char
 							 *b_size);
 
 			if (ret) {
-				printk("%s() failed flags=%x\n", e, desc.flags);
+				printk(KERN_WARNING "%s() failed flags=%x\n",
+				       e, desc.flags);
 				break;
 			}
 			b_size++;
@@ -243,7 +247,7 @@ static int test_hash_jiffies_digest(stru
 			return ret;
 	}
 
-	printk("%6u opers/sec, %9lu bytes/sec\n",
+	printk(KERN_WARNING "%6u opers/sec, %9lu bytes/sec\n",
 	       bcount / sec, ((long)bcount * blen) / sec);
 
 	return 0;
@@ -275,7 +279,7 @@ static int test_hash_jiffies(struct hash
 			return ret;
 	}
 
-	printk("%6u opers/sec, %9lu bytes/sec\n",
+	printk(KERN_WARNING "%6u opers/sec, %9lu bytes/sec\n",
 	       bcount / sec, ((long)bcount * blen) / sec);
 
 	return 0;
@@ -320,7 +324,7 @@ out:
 	if (ret)
 		return ret;
 
-	printk("%6lu cycles/operation, %4lu cycles/byte\n",
+	printk(KERN_WARNING "%6lu cycles/operation, %4lu cycles/byte\n",
 	       cycles / 8, cycles / (8 * blen));
 
 	return 0;
@@ -384,7 +388,7 @@ out:
 	if (ret)
 		return ret;
 
-	printk("%6lu cycles/operation, %4lu cycles/byte\n",
+	printk(KERN_WARNING "%6lu cycles/operation, %4lu cycles/byte\n",
 	       cycles / 8, cycles / (8 * blen));
 
 	return 0;
@@ -400,13 +404,13 @@ static void test_hash_speed(const char *
 	int i;
 	int ret;
 
-	printk("\ntesting speed of %s\n", algo);
+	printk(KERN_WARNING "\ntesting speed of %s\n", algo);
 
 	tfm = crypto_alloc_hash(algo, 0, CRYPTO_ALG_ASYNC);
 
 	if (IS_ERR(tfm)) {
-		printk("failed to load transform for %s: %ld\n", algo,
-		       PTR_ERR(tfm));
+		printk(KERN_WARNING "failed to load transform for %s: %ld\n",
+		       algo, PTR_ERR(tfm));
 		return;
 	}
 
@@ -414,7 +418,7 @@ static void test_hash_speed(const char *
 	desc.flags = 0;
 
 	if (crypto_hash_digestsize(tfm) > sizeof(output)) {
-		printk("digestsize(%u) > outputbuffer(%zu)\n",
+		printk(KERN_WARNING "digestsize(%u) > outputbuffer(%zu)\n",
 		       crypto_hash_digestsize(tfm), sizeof(output));
 		goto out;
 	}
@@ -427,12 +431,14 @@ static void test_hash_speed(const char *
 
 	for (i = 0; speed[i].blen != 0; i++) {
 		if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) {
-			printk("template (%u) too big for tvmem (%lu)\n",
+			printk(KERN_WARNING
+			       "template (%u) too big for tvmem (%lu)\n",
 			       speed[i].blen, TVMEMSIZE * PAGE_SIZE);
 			goto out;
 		}
 
-		printk("test%3u (%5u byte blocks,%5u bytes per update,%4u updates): ",
+		printk(KERN_WARNING
+		       "test%3u (%5u byte blocks,%5u bytes per update,%4u updates): ",
 		       i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
 
 		if (sec)
@@ -443,7 +449,7 @@ static void test_hash_speed(const char *
 					       speed[i].plen, output);
 
 		if (ret) {
-			printk("hashing failed ret=%d\n", ret);
+			printk(KERN_WARNING "hashing failed ret=%d\n", ret);
 			break;
 		}
 	}
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -167,7 +167,7 @@ static int _get_more_prng_bytes(struct p
 			break;
 	}
 
-	dbgprint("Returning new block for context %p\n", ctx);
+	dbgprint(KERN_WARNING "Returning new block for context %p\n", ctx);
 	ctx->rand_data_valid = 0;
 
 	hexdump("Output DT: ", ctx->DT, DEFAULT_BLK_SZ);

             reply	other threads:[~2009-02-06 14:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 14:19 Frank Seidel [this message]
2009-02-06 14:58 ` [PATCH] crypto: add missing KERN_* constants to printks Alexey Dobriyan
2009-02-06 14:54   ` Frank Seidel
2009-02-06 15:03     ` Alexey Dobriyan
2009-02-06 14:59       ` Frank Seidel
2009-02-07 12:52         ` Herbert Xu
2009-02-07 14:13           ` Frank Seidel
2009-02-07 15:19 ` [PATCHv2] " Frank Seidel
2009-02-10  6:23   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=498C46DE.8040700@suse.de \
    --to=fseidel@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=frank@f-seidel.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarod@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox