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: 137099 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2992376lji; Mon, 28 May 2018 08:57:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhsiN4Ku3P4fAYz4Gu1ayOHe6Bj+GZ5gKgoqfV5THBfDdV/ulZRO9hc09dCbbLcB/DeltB X-Received: by 2002:a63:924f:: with SMTP id s15-v6mr10879744pgn.368.1527523072641; Mon, 28 May 2018 08:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523072; cv=none; d=google.com; s=arc-20160816; b=XgVePYoan+v2xa7t+RHO79JWYkM4AalkPmFC0wYqJSXn4yKrrzxlS8U3Xyt1QmzdQS GA2GaCcbac5DrDatS5YsY2Hfq014HkKqAQlP1Ww0n/MHT3EGt5N9Jh/LhVPCKuwjONP9 iBa1selLCn17P7x8UNaQIsTdpVha+EraQfBNlDxZ5e4yt1frdvwaqcuxsXGVTvXUM22G gS+gPhk9jRwZl97EBghU6PQqIowJJdncsG7dSRNgmA6P27aREgaBGCtfNJQ2QRsKkRkD NaWkcasU4q3PVx+swb7hveLca64gF6ACiOBu5kwLpfn24UuALKH77TrgVb5eRdmt1wS4 W/RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0qGhu+ahzEoPu62jMREVsnSMuB23W786pdEJSvwYbR8=; b=iz9GKs5OBBPq4bgX5LzNlx0L74pOwPXec47gHpraCkYWVoj2C0Mk04aRAxJLoYFll7 RFqXDpKu0mLZSGBKmC0CcaSXT5WREgOZ8/7It+k1ELPh4M3Src6Mr9npTtyx2zhlRk0t faTsgdj+VcfO75ewXDoAu3ED7UJkh5f11qFfWE91B85ZzKjgj0bPStQVjyFtfYURq14+ s49aF2ZLUdWsnyQOLo+ie7XyrEL5q/umfCvPoKzUGPlrtkGmaVDUrLEb36uU/JISFdD8 Sbx2XMOJJcUOCe4X2kdpChG9aLAPH0dAoXM1tg9A56G30YRyZin8W7PsN3Rkrk/bYhK0 TASQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si7955919pgc.571.2018.05.28.08.57.52; Mon, 28 May 2018 08:57:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939730AbeE1Pzq (ORCPT + 30 others); Mon, 28 May 2018 11:55:46 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54309 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425306AbeE1Pyj (ORCPT ); Mon, 28 May 2018 11:54:39 -0400 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 Cc: Arnd Bergmann , Mikulas Patocka , linux-kernel@vger.kernel.org Subject: [PATCH] dm: writecache: fix format string warning Date: Mon, 28 May 2018 17:54:08 +0200 Message-Id: <20180528155432.2864616-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 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= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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;