From patchwork Mon Jul 10 21:29:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Buchbinder X-Patchwork-Id: 9833813 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 01171602A0 for ; Mon, 10 Jul 2017 21:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E428C28487 for ; Mon, 10 Jul 2017 21:29:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9034284C8; Mon, 10 Jul 2017 21:29:37 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 6DD1028487 for ; Mon, 10 Jul 2017 21:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbdGJV3f (ORCPT ); Mon, 10 Jul 2017 17:29:35 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:36652 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754764AbdGJV3e (ORCPT ); Mon, 10 Jul 2017 17:29:34 -0400 Received: by mail-pf0-f171.google.com with SMTP id q86so56010645pfl.3 for ; Mon, 10 Jul 2017 14:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FE+Pth4A/4GXuidnJ05URrJ+TXebyYc8nXfLcuvvh+U=; b=rORyoTJgMPNaL5j8LmHxnAwsKMTwIORapTDzlW554vGgPor7WRAyRNYrqLN6wjGRRR Kwbzjm0p5x2QuSCuOChj9cyuh4EbQoAP7QadPU2cJvJdFoJiAkXHywldodhpeQvhTK6C EHc2awFCKLzUXi1UH8BlCUrVtZ2k8CXyqT/Vp2QtcN67TpHBtsFFHjiA52xzWmhIJcwu AIZaGjsxxSGLdf2vO+RVpqhpUyXekXK91WlWPAERN0djbj4FywI/+grHkAwcogBxq4Bm /FP22rVQ64e0e9pKMCKqBFu/+FDmEOnu54dxt18djUQ7oU5BBokqm7itgVAgrred/RSP /Nlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FE+Pth4A/4GXuidnJ05URrJ+TXebyYc8nXfLcuvvh+U=; b=ghvsY6HjvNs1xJPvlzJbZs30GUe/XezGDv73fl3R0f81FWPoESJA1+fWdKTSjDjdjP 3jgcCSktvwq/KvkblSr5opOSiY+tOAYv0V2OPS9qSs6NKR6yLhEUq2ar25uFuyBxFihO VygLWln8ezz3/O7vmeeAYpHi4KVtDD5UYjDyZFoqoXxFPpbs4NTbVpZC/MwfXFL7X+Rv uqLnXyGIsjYLY9G4cE9D97YscG1xv8u4dMzNiKwDdPyEJAXA5YwD/cVZ3VzVPq89uXRI iBueMRr35MedcHyeAGyELngAGp8f6M9m0fai8Ew4YHpONtA0EkYO/srpvygmi8wJu6A2 c0Ag== X-Gm-Message-State: AIVw110DOxK61DtGlxOqNpJRUyadeSM7qeJxjAJgbL80rODukgA66C8C oPE5grpaireplRqBn/2PUA== X-Received: by 10.99.123.18 with SMTP id w18mr16664843pgc.122.1499722167829; Mon, 10 Jul 2017 14:29:27 -0700 (PDT) Received: from abuchbinder-glaptop.corp.google.com ([100.123.105.175]) by smtp.gmail.com with ESMTPSA id j27sm23712148pgn.63.2017.07.10.14.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jul 2017 14:29:27 -0700 (PDT) From: Adam Buchbinder To: linux-btrfs@vger.kernel.org Cc: abuchbinder@google.com Subject: [PATCH] btrfs-progs: Tighten integer types in print-tree. Date: Mon, 10 Jul 2017 14:29:09 -0700 Message-Id: <20170710212909.31559-2-abuchbinder@google.com> X-Mailer: git-send-email 2.13.2.725.g09c95d1e9-goog In-Reply-To: <20170710212909.31559-1-abuchbinder@google.com> References: <20170710212909.31559-1-abuchbinder@google.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are likely more places where the wrong size types are used, but these tripped Clang's warnings because they eventually get passed to printf. Signed-off-by: Adam Buchbinder --- print-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/print-tree.c b/print-tree.c index a0d3395..82d6572 100644 --- a/print-tree.c +++ b/print-tree.c @@ -197,7 +197,7 @@ static void qgroup_flags_to_str(u64 flags, char *ret) void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk) { - int num_stripes = btrfs_chunk_num_stripes(eb, chunk); + u16 num_stripes = btrfs_chunk_num_stripes(eb, chunk); int i; u32 chunk_item_size = btrfs_chunk_item_size(num_stripes); char chunk_flags_str[32] = {0}; @@ -336,7 +336,7 @@ static void print_file_extent_item(struct extent_buffer *eb, int slot, struct btrfs_file_extent_item *fi) { - int extent_type = btrfs_file_extent_type(eb, fi); + unsigned char extent_type = btrfs_file_extent_type(eb, fi); char compress_str[16]; compress_type_to_str(btrfs_file_extent_compression(eb, fi),