From patchwork Wed Jan 11 13:55:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9510125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 477826075C for ; Wed, 11 Jan 2017 13:56:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 348602863A for ; Wed, 11 Jan 2017 13:56:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28E2E2863C; Wed, 11 Jan 2017 13:56:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E16F82863A for ; Wed, 11 Jan 2017 13:56:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRJOb-0001K1-K5; Wed, 11 Jan 2017 13:56:57 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRJOP-00011h-HV; Wed, 11 Jan 2017 13:56:47 +0000 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LzJvV-1cW8k52y4P-014Vyo; Wed, 11 Jan 2017 14:56:08 +0100 From: Arnd Bergmann To: Herbert Xu Subject: [PATCH 2/2] crypto: mediatek - fix format string for 64-bit builds Date: Wed, 11 Jan 2017 14:55:20 +0100 Message-Id: <20170111135601.4047225-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170111135104.3961730-1-arnd@arndb.de> References: <20170111135104.3961730-1-arnd@arndb.de> X-Provags-ID: V03:K0:otuRTkhRlR4+TQMUYWZsudCABgy9If8cgYAbNVoUvoAz7CLaDS/ WnZFUfQ+LzUf1WHeN+7zTQvm6/CdYGbblDS+TAljMUi59Fin/Wv+vcQmkSkjNpEByJ7yT7f /iNbyWG9UGRu/LSEa2sCdiA5Z4GdwgJIJxlq6KvTsjRZbdX/nsOuuv40+qOtV1my/5dO/qd WeVFCtBS7TbUXxzh/qtXQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:B50+Pis2FHw=:Nqh7rwclxuHtmTs4Boi3/O 2KqoWE06Q+UrPpq+WWZ5U8tQw4G8hCwDoqjbiU/UwR89mpy1cqV4FlmNcpr/NXUoxvnAj3GKv QoDbjEAqo2R5tAuT4z6lK+CyDuKxy0GEZ8iugj2IxaH6YoMqexIHnRNGcq5rkiQOD2srcriok ZthDzt2s5s4h6PXMoryrWB+jGugLm8hM5y16piYcmOHpUfCrt37eW5PivZBEYVMcvjT45jyBJ 3Jq4lMMW3FRAzm9gdbisXscB4bomGt4AQ29ZjmqFqD2rjaTqKNoBydR1bz5Wp55Rn9we7vPf+ svvkay8yFOyZJ0gTrSdBvOEFcSbJ1u+hgGttyIHp9n45uhQUOSi1i5Lw0F3jnzc5AYzdmw1S/ 0ezHyVS+qHFl2LReJG8xLgEh/nJB97uOQzrZ/BzSrr/gsoh+PuY/KvVOaEpchxH3fZpPZD98w 8PxDW5HkcbiCVYYRb+mcxeW70tIIiPwi/zsr8XhDr+X8jS8ycO+HO8oNrJgsHBEaEje0RUoiB m2LEoLa67eQX9pa0inUn1ZgVmOcd/lp0mwvQl60YXT7BVCAYfaufXLmQaR0lC0T6876kuYA2E vKkegP3gvkwLE5HMcmvkk1eYCXNeVQUYLDasmGg9uxyJYCHhVpCd2Rd2FG0NlLyQjTJp9iWkn f2l2wa0D1GS19XU6E211P2ayqXNEww5x07GqB+6pognN/t33cJzaHpB7xZ6RT/ciwkHo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_055645_905893_AC6F0A23 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ryder Lee , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-crypto@vger.kernel.org, Matthias Brugger , "David S. Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After I enabled COMPILE_TEST for non-ARM targets, I ran into these warnings: crypto/mediatek/mtk-aes.c: In function 'mtk_aes_info_map': crypto/mediatek/mtk-aes.c:224:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=] dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info)); crypto/mediatek/mtk-sha.c:344:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=] crypto/mediatek/mtk-sha.c:550:21: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=] The correct format for size_t is %zu, so use that in all three cases. Fixes: 785e5c616c84 ("crypto: mediatek - Add crypto driver support for some MediaTek chips") Signed-off-by: Arnd Bergmann --- drivers/crypto/mediatek/mtk-aes.c | 2 +- drivers/crypto/mediatek/mtk-sha.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c index 3271471060d9..1370cabeeb5b 100644 --- a/drivers/crypto/mediatek/mtk-aes.c +++ b/drivers/crypto/mediatek/mtk-aes.c @@ -221,7 +221,7 @@ static int mtk_aes_info_map(struct mtk_cryp *cryp, aes->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info), DMA_TO_DEVICE); if (unlikely(dma_mapping_error(cryp->dev, aes->ct_dma))) { - dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info)); + dev_err(cryp->dev, "dma %zu bytes error\n", sizeof(*info)); return -EINVAL; } aes->tfm_dma = aes->ct_dma + sizeof(*ct); diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c index 89513632c8ed..98b3d74ae23d 100644 --- a/drivers/crypto/mediatek/mtk-sha.c +++ b/drivers/crypto/mediatek/mtk-sha.c @@ -341,7 +341,7 @@ static int mtk_sha_info_map(struct mtk_cryp *cryp, sha->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info), DMA_BIDIRECTIONAL); if (unlikely(dma_mapping_error(cryp->dev, sha->ct_dma))) { - dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info)); + dev_err(cryp->dev, "dma %zu bytes error\n", sizeof(*info)); return -EINVAL; } sha->tfm_dma = sha->ct_dma + sizeof(*ct); @@ -547,7 +547,7 @@ static int mtk_sha_update_slow(struct mtk_cryp *cryp, final = (ctx->flags & SHA_FLAGS_FINUP) && !ctx->total; - dev_dbg(cryp->dev, "slow: bufcnt: %u\n", ctx->bufcnt); + dev_dbg(cryp->dev, "slow: bufcnt: %zu\n", ctx->bufcnt); if (final) { sha->flags |= SHA_FLAGS_FINAL;