From patchwork Mon May 28 15:54:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10433551 X-Patchwork-Delegate: snitzer@redhat.com 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 AE0D760327 for ; Mon, 28 May 2018 15:54:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B99A28AF1 for ; Mon, 28 May 2018 15:54:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FA6828B27; Mon, 28 May 2018 15:54:46 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8E9C28AF1 for ; Mon, 28 May 2018 15:54:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A313D30C1113; Mon, 28 May 2018 15:54:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BD965DD6B; Mon, 28 May 2018 15:54:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 80CEC4CA81; Mon, 28 May 2018 15:54:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4SFsgf0032170 for ; Mon, 28 May 2018 11:54:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D24B90CF4; Mon, 28 May 2018 15:54:42 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51E3890CF1; Mon, 28 May 2018 15:54:37 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7194730BE74B; Mon, 28 May 2018 15:54:35 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0ML81x-1fNbaq2FO5-000Jax; Mon, 28 May 2018 17:54:33 +0200 From: Arnd Bergmann To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Mon, 28 May 2018 17:54:08 +0200 Message-Id: <20180528155432.2864616-1-arnd@arndb.de> X-Provags-ID: V03:K1:OuQAuBy5FnNSWcfQkuBi26IBYBKp7OHdZJbtdqQIvUSZKX8yCEy IFqksAens5aj2BW60aJ4/LQLUv15d/sh3rkuOXfM/uJZ7ifn3IVVJLMt++5o5V4GPKEWHV2 8ts5J0MBX9mS6/w/naFo1VhAwmMWgfWIX2VS6dCl5Fen5o/CZLsnafKItIghtTqYHC1i+kg KzJu5TuncsiT2GOBEuTRQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:H0Ba6efZIrM=:u+MtdebvAAh2uHA+g5Ga3W aQAeWVE51XaYCjrqBB4FHdMFJChwaqu5ohRrUFHwRX7fU4IeuOYCIQb0uFxQrMePgrIAKTuN/ /TJQA3CpIG/bLzhDp2vJaadO+bBjIyxqDCoJxm+51tdH+oGtqFht4wk6iGIjVqAMLey63N6+6 N5fRFd5oue6+1tOzPjq/Q6CVfAO0kNMyxa+UESHhV/W9ZU4Ale8VaucpzqAiU8rVLOPWwJ6fA 4Mku32PfrbPmyDjIg9ZItKva5LXVPFs0+UW2MIY7U2Fd323nBDvwPeRp9fqiQoVMPC88o5GT/ YKLPQ0MRqBHHP+P+zsHAuDJgjwjKHHb48SwbqartJgKbVmYA+WiUbxnMoBch5eTA53PEuKFdO ni3f95a4XY2V40nx5Wm3lyaXLE86a7tuhYQfo4t5+qAfht2evRLVS5NPau+zZXdJ9dXdGp/Cl oIm+lcQXCj3din4UNFuJOricKllcvSFZ2XBJmt3aIy22vDM1Ww21/WsApMJ04qO+vbR7Z+IRl y1dAiS5ojz8c7s78/7zE1+meyy5zss/eGwo9TYBLHSnwrbkYrUOFHDl9jrefuAb9Ftu8M+jPp iAuOe1zj1yORErG/dnaDlYPJEXpcnJI0RYtzRrRZfFcm0HFY0uNGitjXFLB87qeSok4d7dRKm Pg6SjGqhdFcJ4fMk04ZF245UDp0xMXX34p4AwINKvdIVsUZTG1tDL71Tk1MaBiVkZSDA= X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 28 May 2018 15:54:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 28 May 2018 15:54:36 +0000 (UTC) for IP:'217.72.192.74' DOMAIN:'mout.kundenserver.de' HELO:'mout.kundenserver.de' FROM:'arnd@arndb.de' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 217.72.192.74 mout.kundenserver.de 217.72.192.74 mout.kundenserver.de X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: dm-devel@redhat.com Cc: Mikulas Patocka , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [dm-devel] [PATCH] dm: writecache: fix format string warning X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 28 May 2018 15:54:45 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP The return type of ACCESS_ONCE is configuration dependent and may be either 'int' or 'long int' for the writecache_has_error() macro, so we get a warning like this for either format string: In file included from drivers/md/dm-writecache.c:8: drivers/md/dm-writecache.c: In function 'writecache_status': drivers/md/dm-writecache.c:2227:10: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Werror=format=] DMEMIT("%ld %llu %llu %llu", writecache_has_error(wc), ^~~~~~~~~~~~~~~~~~~~ include/linux/device-mapper.h:549:46: note: in definition of macro 'DMEMIT' 0 : scnprintf(result + sz, maxlen - sz, x)) ^ The code is otherwise correct, so we just need to shut up the warning, which can be done using an extra type cast. Fixes: bb15b431d650 ("dm: add writecache target") Signed-off-by: Arnd Bergmann --- drivers/md/dm-writecache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 1ef06e738eb6..772ac3a57287 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2224,7 +2224,7 @@ static void writecache_status(struct dm_target *ti, status_type_t type, switch (type) { case STATUSTYPE_INFO: - DMEMIT("%ld %llu %llu %llu", writecache_has_error(wc), + DMEMIT("%ld %llu %llu %llu", (long)writecache_has_error(wc), (unsigned long long)wc->n_blocks, (unsigned long long)wc->freelist_size, (unsigned long long)wc->writeback_size); break;