From patchwork Fri Jun 8 14:38:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 138054 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp956224lji; Fri, 8 Jun 2018 07:40:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLHNQXdcYpQW9lBygkJgblGQYeuWAYbd528DzsPPdJv5HE2nvcm8Y+nb6fntCx0vMhjTEVg X-Received: by 2002:a63:6741:: with SMTP id b62-v6mr5594694pgc.5.1528468818948; Fri, 08 Jun 2018 07:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528468818; cv=none; d=google.com; s=arc-20160816; b=ROaBcKshe1W2YCLFvUlB84yMfoekhvbIJLvGxGfm3xELddlckJiKNVwBoBetTjVu+5 0+K2AwDKBROASHQp5UCsiyR957v77d1h/yJTg92gP3XGw4+V1EvKb/HmJBh4vFqhEsST ICttPPBleQmotmSCVpWFs0i7/MZbFY3L+ZzRJJAxnZbhBE5S0V/5b2OajKNN0FeYMPeI AN7UfVmURlWqqfXbxDUVeWf/QopQpqVwn2ttzuf5rmYsywQ6h5Tzb9YishRS7Gu24RjI 3it/SXoh/wZYUI8w/MFQzCFkNGYtrjHv+s8TpC4BXgbz067qX5x/luDFiSUwVXrMf32N aJ8w== 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=ekstpDhsYyJVLZDSzSl94xa3UoQnpdiFLa7m6REBy0Y=; b=g56Hp7tKBAh6yY422+Vri9eLpvPPGd+qfe7AS4/YuTGPsYREot/U/iHxIDo9not8fI SSABsS6i71e81nXn8A6MySKgWUCP/ePSomx8s8MTZtzaMg9Yn/suE/r03D+16wdn7563 +0Bx4/dG9p7SDPp7SaDIQMCFCUoqlvslaQ6oMDccDvZSgy/U541jf54YvIS8dVfpz7RS dniXFGSq+iQTD81eRmJBKQe5lErRdpzKLVg4LJW3Cj7BPNCxBsI1+9ZNB1hx8QYRfuhv JW2Hi+gkEhsMJCCoU6/3KPO2OXLtun9XR8IkpVz9YN61kJRGMVqE+DuV64JwKteWJilS xFIQ== 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 x9-v6si31252385plo.368.2018.06.08.07.40.18; Fri, 08 Jun 2018 07:40:18 -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 S1752754AbeFHOkQ (ORCPT + 30 others); Fri, 8 Jun 2018 10:40:16 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:46917 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbeFHOkP (ORCPT ); Fri, 8 Jun 2018 10:40:15 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MQcnt-1fqyhT1USr-00Tz5O; Fri, 08 Jun 2018 16:39:38 +0200 From: Arnd Bergmann To: OGAWA Hirofumi Cc: Arnd Bergmann , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] fat: fix sector print Date: Fri, 8 Jun 2018 16:38:52 +0200 Message-Id: <20180608143907.2620349-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:B2oRvm8W6ZPIfosZtGxjoVOgksHu8ReMJnJQmkkzYnWiovoSBp3 NVbrDkJ1jalYwx1E4/PJC3iV/62juSkV2CCP5NXecE3H/aZGvRDCnldggZ19tGFVIejMaMK L3l8/d/YEepMugA2jT7Jy2uSTzDRjCR5/rh0D2BudL97OiR1NSKBgRSuyr76fhOoQYIM9EA tsnRNtWpOMgkxSyIz8MVA== X-UI-Out-Filterresults: notjunk:1; V01:K0:EOfzXs3uVt0=:yPfaz7q6gWbkhSWxgqVa2P Y3RK84+MGHdiQDYejbYSEl0J9eXEQTopvfb/9G0CBXJZ0TtCtXWm3Dh1VRBE/eHYrzKudebSt RuUqL2JrmkA/vfsI/Ce3EEQGxLMWIugGOxvmbTOHrEgoBu+kpTC98LOo8sr2bxLceG9UV2CS5 1Z8HYxADM16K0qKu1tKUhHfDM/S8qBvk4Kn45SMfspKjhbAC/xATUmlDGc5BzoJFzdWL+VY57 mFxjJgemO6AgzyfHmFt8qYyY1BJ4v1Ku960bj4+hQZO+U/br9Ami/to2WX7HQ0R3A1pw98GlX hKZoCWe/h/jKAtxpq71tzpvfg2UvmKHYAaz+zmiYzjk0hcRAkd5mUmbyszM3mGXfB9f5N7Dib hrVcspzF/rY4O1LR4W0tgPV3cAtSdCaY614xPHMN/SsjEhknj480KLSL7o2NoW6hgMm5/y8nR DAjTrZHt0Z+rcozojwy/qOaLYxBoO2FRjOtaAkC6lhbc1VxDvIWe15EdQuC0jirMSsRVIsTDa tnl5SsplwFhPiNVcqihKmaXjuHJw8/0CWoVgwkp8cnkV9sgqVW7JivNaUaZvJM1U8OAFROZ1j IBEV5hK0ZQmBOxXyu61tlHItO0RXOepCR6E2DvrcqJKmZVykbEOdWhWDcqNIUVE4CMNaRv9Zq oIqS37uuHFKSl/CA+jX/ZKZxbIy0XbxaqhIBCO4mZNca7CkksaWwA/LlI5RxDaNVHhEo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Printing a sector_t using %ld fails when that is a 64-bit type on 32-bit architectures: fs/fat/inode.c: In function '__fat_get_block': fs/fat/inode.c:163:9: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'sector_t' {aka 'long long unsigned int'} [-Werror=format=] "invalid FAT chain (i_pos %lld, last_block %ld)", The common workaround is to cast the number to a 64-bit type and print that as %lld, that works in all configurations. Fixes: mmotm ("fat: use fat_fs_error() instead of BUG_ON() in __fat_get_block()") Signed-off-by: Arnd Bergmann --- fs/fat/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/fs/fat/inode.c b/fs/fat/inode.c index d380d0f844bb..d168df5a4a73 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -160,8 +160,8 @@ static inline int __fat_get_block(struct inode *inode, sector_t iblock, return err; if (!phys) { fat_fs_error(sb, - "invalid FAT chain (i_pos %lld, last_block %ld)", - MSDOS_I(inode)->i_pos, last_block); + "invalid FAT chain (i_pos %lld, last_block %llu)", + MSDOS_I(inode)->i_pos, (u64)last_block); return -EIO; }