[PATCH 05/17] crypto: ansi_cprng - Add const annotations to hexdump()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So I can pass the "input" variable to it.

Signed-off-by: George Spelvin <linux@xxxxxxxxxxx>
---
 crypto/ansi_cprng.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

I like to declare things const, and the lack of this in the prototype
causes compiler complaints.

diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c
index 4856c84c7..1a0ba6a3 100644
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -59,7 +59,7 @@ struct prng_context {
 
 static int dbg;
 
-static void hexdump(char *note, unsigned char *buf, unsigned int len)
+static void hexdump(char const *note, void const *buf, unsigned int len)
 {
 	if (dbg) {
 		printk(KERN_CRIT "%s", note);
@@ -111,7 +111,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test)
 			 */
 			input = ctx->DT;
 			output = tmp;
-			hexdump("input stage 0: ", ctx->DT, DEFAULT_BLK_SZ);
+			hexdump("input stage 0: ", input, DEFAULT_BLK_SZ);
 			break;
 		case 1:
 			/*
@@ -122,8 +122,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test)
 			 * anti-repetition compare.
 			 */
 			xor_block(tmp, ctx->V);
-			hexdump("input stage 1: ", ctx->V, DEFAULT_BLK_SZ);
 			input = output = ctx->V;
+			hexdump("input stage 1: ", input, DEFAULT_BLK_SZ);
 			break;
 		case 2:
 			/*
@@ -150,8 +150,8 @@ static int _get_more_prng_bytes(struct prng_context *ctx, int cont_test)
 			 * and encrypt that to obtain a new secret vector V
 			 */
 			xor_block(tmp, ctx->V);
-			hexdump("input stage 2: ", ctx->V, DEFAULT_BLK_SZ);
 			input = output = ctx->V;
+			hexdump("input stage 2: ", input, DEFAULT_BLK_SZ);
 			break;
 		}
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux