From: David Sterba Subject: [PATCH] crypto: do not attempt to write to readonly variable Date: Mon, 21 Feb 2011 15:27:22 +0100 Message-ID: <1298298442-24697-1-git-send-email-dsterba@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, David Sterba , Herbert Xu To: linux-crypto@vger.kernel.org Return-path: Received: from cantor.suse.de ([195.135.220.2]:33443 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754212Ab1BUO1h (ORCPT ); Mon, 21 Feb 2011 09:27:37 -0500 Sender: linux-crypto-owner@vger.kernel.org List-ID: Commit da7f033ddc9fdeb (=E2=80=9Dcrypto: cryptomgr - Add test infrastru= cture=E2=80=9D) added a const to variable which is later used as target buffer of memcpy. crypto/tcrypt.c:217:12: warning: passing 'const char (*)[128]' to param= eter of type 'void *' discards qualifiers memset(&iv, 0xff, iv_len); crypto/tcrypt.c:test_cipher_speed() - unsigned char *key, iv[128]; + const char *key, iv[128]; =2E.. memset(&iv, 0xff, iv_len); CC: Herbert Xu Signed-off-by: David Sterba --- crypto/tcrypt.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 9aac5e5..e912ea5 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -146,7 +146,8 @@ static void test_cipher_speed(const char *algo, int= enc, unsigned int sec, unsigned int tcount, u8 *keysize) { unsigned int ret, i, j, iv_len; - const char *key, iv[128]; + const char *key; + char iv[128]; struct crypto_blkcipher *tfm; struct blkcipher_desc desc; const char *e; --=20 1.7.4