From patchwork Sat Jul 2 05:10:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 940112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p625AnE7006738 for ; Sat, 2 Jul 2011 05:10:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109Ab1GBFKu (ORCPT ); Sat, 2 Jul 2011 01:10:50 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:35815 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936Ab1GBFKu (ORCPT ); Sat, 2 Jul 2011 01:10:50 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so3288158iwn.19 for ; Fri, 01 Jul 2011 22:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=q6KYSM4d5bmWZoqze8xqLbX9Q1fy0Xx7cYSoZfujDeY=; b=m/W4M5qw5QmAEVCu+B6AiL4Mzp1sxKzkoxw16iM1PWO5YNt7WhHa7aThUpVUEXM6li kOA8vJ2bMjniDLc3NmfB8AqKuXyySlA5A7s1nq2Pt+2959qXHijhBFMFr6YQlDd7c9/M HnLtCROjBwXeJKWOxuFpX8NaC61FaZOEeA4n4= Received: by 10.42.122.9 with SMTP id l9mr3968779icr.68.1309583450227; Fri, 01 Jul 2011 22:10:50 -0700 (PDT) Received: from localhost.localdomain (69-165-144-226.dsl.teksavvy.com [69.165.144.226]) by mx.google.com with ESMTPS id a9sm1507011icy.6.2011.07.01.22.10.49 (version=SSLv3 cipher=OTHER); Fri, 01 Jul 2011 22:10:49 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org, Michal Marek Cc: Arnaud Lacombe Subject: [PATCH 2/5] kconfig/conf: reduce the scope of `defconfig_file' Date: Sat, 2 Jul 2011 01:10:37 -0400 Message-Id: <1309583440-4795-3-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.3.4.574.g608b.dirty In-Reply-To: <1309583440-4795-1-git-send-email-lacombar@gmail.com> References: <1307386711-8866-1-git-send-email-lacombar@gmail.com> <1309583440-4795-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 02 Jul 2011 05:10:51 +0000 (UTC) This variable is not used outside of main() so there is not much reason keeping it global. Ensure it is initialized as gcc has no way to know that normal execution path expect only one option switch to be given on the command line (except when we request help). As a result, we always initialize `defconfig_file' before using it. Signed-off-by: Arnaud Lacombe --- scripts/kconfig/conf.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 08c05bc..6431f5c 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -34,8 +34,6 @@ enum input_mode { oldnoconfig, } input_mode = oldaskconfig; -char *defconfig_file; - static int indent = 1; static int valid_stdin = 1; static int sync_kconfig; @@ -462,7 +460,7 @@ static struct option long_opts[] = { int main(int ac, char **av) { int opt; - const char *name; + const char *name, *defconfig_file = NULL /* gcc uninit */; struct stat tmpstat; setlocale(LC_ALL, "");