From patchwork Mon Mar 20 12:39:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9633989 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 E41E76020B for ; Mon, 20 Mar 2017 12:41:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCDB627F95 for ; Mon, 20 Mar 2017 12:41:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1F3A2808F; Mon, 20 Mar 2017 12:41:38 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 823A027F95 for ; Mon, 20 Mar 2017 12:41:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753765AbdCTMlV (ORCPT ); Mon, 20 Mar 2017 08:41:21 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:56512 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754726AbdCTMlH (ORCPT ); Mon, 20 Mar 2017 08:41:07 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LlFaA-1cExMT1d3u-00azH7; Mon, 20 Mar 2017 13:40:11 +0100 From: Arnd Bergmann To: Herbert Xu Cc: Arnd Bergmann , "David S. Miller" , Mahipal Challa , Jan Glauber , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: zip - add a cast for printing atomic64_t values Date: Mon, 20 Mar 2017 13:39:16 +0100 Message-Id: <20170320123955.4061033-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:h4mSkvYilIX9tRio9noFLgBuHwV7TmUrWsG4FbVEzQlBynbH+rq Lbck0yI7dxrk/1xMB46PV62zrSkvesmKQvS6u0zUKgT0oWEErVxmkKZ7/dwtXlBGUEg7+17 pymbhcnmo+gEgRYPMAtlC26JMrbKwprZJMDw10+ALSX3DHYuhzWRRwNE1PEbJu9tC2WuFEy rE9OE4zgLlaDK/8np0msA== X-UI-Out-Filterresults: notjunk:1; V01:K0:X+Bl3czlhyc=:xJo/QNplzWXPpNqyh2rjYj BoK059E4fyovmKriiEOfRuOo2XW7y+45/cjY2E6vrU33GQDV2H7XLFGD/NlOCu3eQj5R7wtxn o6bgE+SH/JXMQf5P3vmXpCVE6XdlABQPJfF+M3Yj6r1UTUNzmpss5B8b74dYzeM/tXPEOZRqq fr0dhE9TGEiYGYJlrXsCespnQ37VGuomNojLeSmR7vTC6kRkDBGuLwbujr5opHdcRwpUXoAWM 9l/wktZRULLpDQLduuiy5+UZPX4FtAT8eI8/xpGWN8+HJnDFW3i/siDEQSXu/7eueyIZctFkA Sx/hiJk1ISy9S/UVVOjz50NzBEKLAwL0NRPKeD6xqIK7mVdORabtWxEWj7zaB+Z2JLjfqmTBq /XjPrsc2AjLopw+UBni5qr5H6B0Kv/MKXtXQvBPw+lXw6wn5KG4o8w9RJ5R44TwdrYka4txRL T/81Sdzw3sa//J7ZiENnWtmW1m/pBlwN53eGJBZ2cwYbrwWSw1O7KHBcxbbeJz4PmEa/iVHQf O3lWCw57T7pAH/78UmEKh9oq2jFw6a/f9Tn08HGCR62t05mpNu4u+rlfHbrpBwQhwqh8uFziG 41UusdXNES0CzeRTkAKQ85hMvR/4VTY1Mb5iG83d6wduJiVxACjhWDL3N9wzFAVYcE4lU4187 X/2TqSTFZhPGQwYQCE23qEGu9lTFYtSsXGjeWkQqswDgw4P3buxG0Lg6ZD2OIn5tlycY= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kernelci.org reports a build-time regression on linux-next, with a harmless warning in x86 allmodconfig: drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'long long int' [-Wformat=] drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'long long int' [-Wformat=] drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'long long int' [-Wformat=] The return type for atomic64_read() unfortunately differs between architectures, with some defining it as atomic_long_read() and others returning a 64-bit type explicitly. Fixing this in general would be nice, but also require changing other users of these functions, so the simpler workaround is to add a cast here that avoids the warnings on the default build. Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") Signed-off-by: Arnd Bergmann --- drivers/crypto/cavium/zip/zip_main.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c index 0951e20b395b..49f50c0e0308 100644 --- a/drivers/crypto/cavium/zip/zip_main.c +++ b/drivers/crypto/cavium/zip/zip_main.c @@ -488,32 +488,32 @@ static int zip_show_stats(struct seq_file *s, void *unused) atomic64_read(&st->comp_out_bytes)); seq_printf(s, " ZIP Device %d Stats\n" "-----------------------------------\n" - "Comp Req Submitted : \t%ld\n" - "Comp Req Completed : \t%ld\n" - "Compress In Bytes : \t%ld\n" - "Compressed Out Bytes : \t%ld\n" + "Comp Req Submitted : \t%lld\n" + "Comp Req Completed : \t%lld\n" + "Compress In Bytes : \t%lld\n" + "Compressed Out Bytes : \t%lld\n" "Average Chunk size : \t%llu\n" "Average Compression ratio : \t%llu\n" - "Decomp Req Submitted : \t%ld\n" - "Decomp Req Completed : \t%ld\n" - "Decompress In Bytes : \t%ld\n" - "Decompressed Out Bytes : \t%ld\n" - "Decompress Bad requests : \t%ld\n" - "Pending Req : \t%ld\n" + "Decomp Req Submitted : \t%lld\n" + "Decomp Req Completed : \t%lld\n" + "Decompress In Bytes : \t%lld\n" + "Decompressed Out Bytes : \t%lld\n" + "Decompress Bad requests : \t%lld\n" + "Pending Req : \t%lld\n" "---------------------------------\n", index, - atomic64_read(&st->comp_req_submit), - atomic64_read(&st->comp_req_complete), - atomic64_read(&st->comp_in_bytes), - atomic64_read(&st->comp_out_bytes), + (u64)atomic64_read(&st->comp_req_submit), + (u64)atomic64_read(&st->comp_req_complete), + (u64)atomic64_read(&st->comp_in_bytes), + (u64)atomic64_read(&st->comp_out_bytes), avg_chunk, avg_cr, - atomic64_read(&st->decomp_req_submit), - atomic64_read(&st->decomp_req_complete), - atomic64_read(&st->decomp_in_bytes), - atomic64_read(&st->decomp_out_bytes), - atomic64_read(&st->decomp_bad_reqs), - atomic64_read(&st->pending_req)); + (u64)atomic64_read(&st->decomp_req_submit), + (u64)atomic64_read(&st->decomp_req_complete), + (u64)atomic64_read(&st->decomp_in_bytes), + (u64)atomic64_read(&st->decomp_out_bytes), + (u64)atomic64_read(&st->decomp_bad_reqs), + (u64)atomic64_read(&st->pending_req)); /* Reset pending requests count */ atomic64_set(&st->pending_req, 0);