From patchwork Thu Nov 13 11:44:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 40743 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6764C24493 for ; Thu, 13 Nov 2014 11:46:43 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf7875142lbj.11 for ; Thu, 13 Nov 2014 03:46:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-disposition :content-type:content-transfer-encoding; bh=1tYuc2ggkZrvQ1gisFxsaboM8iBX5VAU3VLOheTSi6o=; b=Le0fmAS0genanJo5x75It/zSeS9wy6NC6zRZlj8MJZOkSMT4GV14SRUzoRNpfJY96J YWfqWjiCuagLSgG4oRF4BvWgmhw0vt7amdWkG7U2c4EkJWKI15+wPnpUvGscJFElSzLa eiyaX/sGaILFbxmcJhiw7z1hQj7jg9k/RRSMEiD5Ce/HHqZZbg5e8gCyV1o+WFt4A88Y MZQk2+d3YLLpSqnvxgQl04g7GShPsFQ3fp5Y+o2G/iFY9acuDWFWQfpWjYx+gmM2vP2j 37cDiwc1HDEEBokpNNkRFlzxtZNXPESh6TEmvRssEuIo7THXmNBC2v3RBD52LUNyVoBq fXLQ== X-Gm-Message-State: ALoCoQl7h44Y8dFyYh7ySs4GLXEzpYfwyL49u2forRnc6arkb/9pum99ZDOI7iBRMVZPSktBD7v7 X-Received: by 10.181.11.193 with SMTP id ek1mr788175wid.0.1415879202366; Thu, 13 Nov 2014 03:46:42 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls637419laj.57.gmail; Thu, 13 Nov 2014 03:46:42 -0800 (PST) X-Received: by 10.152.120.167 with SMTP id ld7mr1850548lab.77.1415879202176; Thu, 13 Nov 2014 03:46:42 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id dv6si38182842lbc.52.2014.11.13.03.46.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 03:46:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so12805362lab.40 for ; Thu, 13 Nov 2014 03:46:42 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr1987945lab.40.1415879202030; Thu, 13 Nov 2014 03:46:42 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp575678lbc; Thu, 13 Nov 2014 03:46:41 -0800 (PST) X-Received: by 10.68.201.226 with SMTP id kd2mr1933517pbc.75.1415879200202; Thu, 13 Nov 2014 03:46:40 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kt7si25357636pab.214.2014.11.13.03.46.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 03:46:40 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xospq-0002fn-Ia; Thu, 13 Nov 2014 11:45:10 +0000 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xospa-0002G8-Rh for linux-arm-kernel@lists.infradead.org; Thu, 13 Nov 2014 11:44:56 +0000 Received: from foss-smtp-na-1.foss.arm.com (unknown [10.80.61.8]) by foss-mx-na.foss.arm.com (Postfix) with ESMTP id EBB4A66; Thu, 13 Nov 2014 05:44:20 -0600 (CST) Received: from collaborate-mta1.arm.com (highbank-bc01-b06.austin.arm.com [10.112.81.134]) by foss-smtp-na-1.foss.arm.com (Postfix) with ESMTP id 7284B5FAD7; Thu, 13 Nov 2014 05:44:18 -0600 (CST) Received: from arm.com (edgewater-inn.cambridge.arm.com [10.1.203.36]) by collaborate-mta1.arm.com (Postfix) with ESMTPS id C436413F78C; Thu, 13 Nov 2014 05:44:17 -0600 (CST) Date: Thu, 13 Nov 2014 11:44:20 +0000 From: Will Deacon To: Geoff Levand Subject: Re: [PATCH] efi: Fix free_end build warning Message-ID: <20141113114420.GF13350@arm.com> References: <1415824050.15847.9.camel@smoke> MIME-Version: 1.0 In-Reply-To: <1415824050.15847.9.camel@smoke> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141113_034454_903908_1ACA1783 X-CRM114-Status: GOOD ( 15.81 ) X-Spam-Score: -0.6 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: Catalin Marinas , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.deacon@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Content-Disposition: inline Hi Geoff, On Wed, Nov 12, 2014 at 08:27:30PM +0000, Geoff Levand wrote: > Initialize the free_end variable to zero. Fixes build warnings > like these: > > arch/arm64/kernel/efi.c: warning: ‘free_end’ may be used uninitialized in this function > > Signed-off-by: Geoff Levand > --- > Got this with the latest arm64/for-next/core branch. Please consider. > > -Geoff > > arch/arm64/kernel/efi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c > index 4f39a18..83fc53c 100644 > --- a/arch/arm64/kernel/efi.c > +++ b/arch/arm64/kernel/efi.c > @@ -239,6 +239,7 @@ static void __init free_boot_services(void) > * want to keep for UEFI. > */ > > + free_end = 0; > keep_end = 0; > free_start = 0; Do you have any idea how GCC arrives at this conclusion? I can't see a path through that function where we use free_end without initialising it. Does something like the patch below help? Will --->8 diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 95c49ebc660d..4c577b538d1c 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -271,17 +271,16 @@ static void __init free_boot_services(void) size = npages << PAGE_SHIFT; if (free_start) { - if (paddr <= free_end) - free_end = paddr + size; - else { + if (paddr > free_end) { total_freed += free_region(free_start, free_end); free_start = paddr; - free_end = paddr + size; } } else { free_start = paddr; - free_end = paddr + size; } + + free_end = paddr + size; + if (free_start < keep_end) { free_start += PAGE_SIZE; if (free_start >= free_end)