From patchwork Sat Nov 2 21:24:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 3131711 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55E98BEEB2 for ; Sat, 2 Nov 2013 21:28:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65E5B20347 for ; Sat, 2 Nov 2013 21:28:29 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id 84E3820343 for ; Sat, 2 Nov 2013 21:28:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA2LOquZ020471; Sat, 2 Nov 2013 17:24:54 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA2LOooK027476 for ; Sat, 2 Nov 2013 17:24:50 -0400 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rA2LOoT5014328 for ; Sat, 2 Nov 2013 17:24:50 -0400 Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA2LOnSH028199 for ; Sat, 2 Nov 2013 17:24:49 -0400 Received: by mail-ee0-f52.google.com with SMTP id e49so399462eek.11 for ; Sat, 02 Nov 2013 14:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u4fF3nfD9Yu/1jVju2cbjioYr6CDz7H7sNOBsQDyx0M=; b=eZ1iYTjiUAiwipnV9Iv7NtmHObC1HLf0Gr/2aEp1zAfQRKZBfY1Yt9FEVK4Q+0pbzr TBaVWrHJe7ok/qYLJ5Lwg35Yzt+xe8LPEw9oUEXSJjLCL0MUvzfuR+PcLZRz1cndzN5g am928vbtukTu+TrD92vEhg7srxKWk3Q5vbUD15V6oE56AcCN+fwLf+Sk1Ds5dZ4n3Cx7 SVGgt2ttgO7kldrBYv4Pa0VIb4NT52C27mYOZhQfyh3FmPkGs3PUrNA8vpU5leFSq7HE rBchQk03bcxCSyGQeWKaEPV5hwXujQQalGnDpSmA4qnPkVxyf/1a/opdcWzQ1zBym58S ckOw== X-Received: by 10.15.64.1 with SMTP id n1mr9177875eex.15.1383427488733; Sat, 02 Nov 2013 14:24:48 -0700 (PDT) Received: from tawny.mazyland.net (56.157.broadband5.iol.cz. [88.100.157.56]) by mx.google.com with ESMTPSA id x47sm25123852eea.16.2013.11.02.14.24.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2013 14:24:48 -0700 (PDT) From: Milan Broz To: dm-devel@redhat.com Date: Sat, 2 Nov 2013 22:24:04 +0100 Message-Id: <1383427444-19174-2-git-send-email-gmazyland@gmail.com> In-Reply-To: <1383427444-19174-1-git-send-email-gmazyland@gmail.com> References: <20131030181241.GA24325@agk-dp.fab.redhat.com> <1383427444-19174-1-git-send-email-gmazyland@gmail.com> X-RedHat-Spam-Score: -3.1 (BAYES_00, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-loop: dm-devel@redhat.com Cc: Milan Broz Subject: [dm-devel] [PATCH 4/4] dm-crypt: Fix sparse (different base types) warnings X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/md/dm-crypt.c:575:16: warning: incorrect type in assignment (different base types) drivers/md/dm-crypt.c:575:16: expected unsigned int [unsigned] drivers/md/dm-crypt.c:575:16: got restricted __le32 [usertype] ... Explicitly define endianess to silence these annoying warnings. N.B. there is still warning about variable length array, but this code is common use of hash structure on stack on many parts of the kernel. Signed-off-by: Milan Broz --- drivers/md/dm-crypt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 2d6ee75f..b71583e 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -550,7 +550,7 @@ static int crypt_iv_lmk_one(struct crypt_config *cc, u8 *iv, char ctx[crypto_shash_descsize(lmk->hash_tfm)]; } sdesc; struct md5_state md5state; - u32 buf[4]; + __le32 buf[4]; int i, r; sdesc.desc.tfm = lmk->hash_tfm; @@ -696,7 +696,7 @@ static int crypt_iv_tcw_whitening(struct crypt_config *cc, u8 *data) { struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; - u64 sector = cpu_to_le64((u64)dmreq->iv_sector); + __le64 sector = cpu_to_le64((u64)dmreq->iv_sector); u8 buf[TCW_WHITENING_SIZE]; struct { struct shash_desc desc; @@ -738,7 +738,7 @@ static int crypt_iv_tcw_gen(struct crypt_config *cc, u8 *iv, struct dm_crypt_request *dmreq) { struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; - u64 sector = cpu_to_le64((u64)dmreq->iv_sector); + __le64 sector = cpu_to_le64((u64)dmreq->iv_sector); u8 *src; int r = 0;