From patchwork Mon Apr 13 14:48:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 6209981 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 702FB9F2EC for ; Mon, 13 Apr 2015 14:36:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 904052034B for ; Mon, 13 Apr 2015 14:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E027720340 for ; Mon, 13 Apr 2015 14:36:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932306AbbDMOf7 (ORCPT ); Mon, 13 Apr 2015 10:35:59 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:26887 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbbDMOf6 (ORCPT ); Mon, 13 Apr 2015 10:35:58 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t3DEZtlQ010585 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Apr 2015 14:35:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t3DEZsWr003282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 13 Apr 2015 14:35:54 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t3DEZsbR002775; Mon, 13 Apr 2015 14:35:54 GMT Received: from OL.sg.oracle.com (/10.186.101.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Apr 2015 07:35:54 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 1/1] Btrfs-progs: fix compile warnings Date: Mon, 13 Apr 2015 22:48:54 +0800 Message-Id: <1428936534-2502-1-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.0.0.153.g79dcccc MIME-Version: 1.0 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP simple compile time warning fixes. cmds-check.c: In function ‘del_file_extent_hole’: cmds-check.c:289: warning: ‘prev.len’ may be used uninitialized in this function cmds-check.c:289: warning: ‘prev.start’ may be used uninitialized in this function cmds-check.c:290: warning: ‘next.len’ may be used uninitialized in this function cmds-check.c:290: warning: ‘next.start’ may be used uninitialized in this function btrfs-calc-size.c: In function ‘print_seek_histogram’: btrfs-calc-size.c:221: warning: ‘group_start’ may be used uninitialized in this function btrfs-calc-size.c:223: warning: ‘group_end’ may be used uninitialized in this function Signed-off-by: Anand Jain --- btrfs-calc-size.c | 4 ++-- cmds-check.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/btrfs-calc-size.c b/btrfs-calc-size.c index 1372084..88f92e1 100644 --- a/btrfs-calc-size.c +++ b/btrfs-calc-size.c @@ -218,9 +218,9 @@ static void print_seek_histogram(struct root_stats *stat) struct rb_node *n = rb_first(&stat->seek_root); struct seek *seek; u64 tick_interval; - u64 group_start; + u64 group_start = 0; u64 group_count = 0; - u64 group_end; + u64 group_end = 0; u64 i; u64 max_seek = stat->max_seek_len; int digits = 1; diff --git a/cmds-check.c b/cmds-check.c index ed8c698..de22185 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -293,6 +293,9 @@ static int del_file_extent_hole(struct rb_root *holes, int have_next = 0; int ret = 0; + memset(&prev, 0, sizeof(struct file_extent_hole)); + memset(&next, 0, sizeof(struct file_extent_hole)); + tmp.start = start; tmp.len = len; node = rb_search(holes, &tmp, compare_hole_range, NULL);