From patchwork Thu Jul 5 02:39:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 141091 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1409345ljj; Wed, 4 Jul 2018 19:41:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpccHiRXSVJUSN827eQE/V/Q81MKQa/Ug3sQAfpuAbAA2SXcVuz0XRhi19B4vj5KDoG8f7Y+ X-Received: by 2002:a62:fd06:: with SMTP id p6-v6mr4346843pfh.167.1530758503678; Wed, 04 Jul 2018 19:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530758503; cv=none; d=google.com; s=arc-20160816; b=szpsHg3LeVveJcBXErIu0Xdhehi7evTLmNDINVpn1SovuNGHG9UgrleCl5iYtPg78Z 59RCxM6rHtU/Iq6ba/YFfMFNHKMWKbErgqn/9lTBcwKRQx4yaCK4sJSoczj8B5UmkokJ z3YD2Aqho+8FAhyTOJ78rY7PurKqHh76eiDasF4VCIQ0J8L5Qbrzk5BBpYRxzrJD4nAN I6qY2ER8FAbz71FLc28gQHjG9/tsM3iyAbcS4qzWsuqmq28oyVId8T7sKH1+ST59ymN8 7sIv5fAzg6EbwdqVKCYZCXhHnYsND2R/GCm/tC/ilZXvu2dfKZixSxCcfJiqaNZIAypM sGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=yLz8AM33NtPVOG5Y8iy6SpZ9KxQYVmtCDPm950evRQQ=; b=wxueb/A0QCGqtnuhYsuT14RmvOdzuotD3tgb0nuqRBNY/FBaIZqdKHkK1O5a7F/F7r W/w838MEO/z0AW13QwD6Y/PsLjJ6XxUGRrVNCx6jvleJafg1BKViMM/coHjN5gLM8xyH OPhq5OzoKfZllJR7Fh9bhRgryaYdjm3sCoyyDJj3pJpwys4JiNwdy0yZIfsHZuUbljcE CWCj343LOtsEwYLpNaJKPLwvuaep8RO+SXVxjDNxx6ipVB6m/CWHJTSyD8+mQwz9pSTn U0xH/cFkFpTd/t6OGPctpBroPRzybmHmzJqaWfzr+XiCnO2pby6wQkE+i7PQ+j/JAleg Zo3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="EHMkqr/B"; 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 v84-v6si5008482pfa.103.2018.07.04.19.41.43; Wed, 04 Jul 2018 19:41:43 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="EHMkqr/B"; 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 S1753349AbeGEClm (ORCPT + 31 others); Wed, 4 Jul 2018 22:41:42 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:43890 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbeGEClg (ORCPT ); Wed, 4 Jul 2018 22:41:36 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w652duZX028145; Thu, 5 Jul 2018 11:39:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w652duZX028145 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1530758398; bh=yLz8AM33NtPVOG5Y8iy6SpZ9KxQYVmtCDPm950evRQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EHMkqr/BECluRCIKmyjqMJj6/fhCm0YMWjBL2SEbOej+Fys16zHTBN7FuWSrovQSs 6khyvYcAi81nOBAp63eeXswkQJtDLkqEir2YC2rsV7+ZF2MLLpj21B+R6cfMb8FmWF OnZWTHkss6a5krArkilbIQYL9ysQHLqv1neNMd9fJFWeMLxob6sNnyJzY9rM/nZcg6 kQXZ+oTXNrjCeq0rAyLGTaty7AsPCKE0I58Gj8GWJjOlLePFMxPAG4zCsVcA4jNNoE F7A1ay98P981deO4aIYp7ffH7I6auv0rAnp0iK+6EAx/VWNixvHJj//oxjUGfWxgEn Vvdn7YweLL80w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Dirk Gouders , Ulf Magnusson , Linus Torvalds , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v3 01/12] kconfig: rename file_write_dep and move it to confdata.c Date: Thu, 5 Jul 2018 11:39:38 +0900 Message-Id: <1530758389-30862-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530758389-30862-1-git-send-email-yamada.masahiro@socionext.com> References: <1530758389-30862-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org file_write_dep() is called only from conf_write_autoconf(). Move it from util.c to confdata.c to make it static. Also, rename it to conf_write_dep() since it should belong to the group of conf_write* functions. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 31 ++++++++++++++++++++++++++++++- scripts/kconfig/lkc.h | 1 - scripts/kconfig/util.c | 30 ------------------------------ 3 files changed, 30 insertions(+), 32 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 39e2097..4771820 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -813,6 +813,35 @@ int conf_write(const char *name) return 0; } +/* write a dependency file as used by kbuild to track dependencies */ +static int conf_write_dep(const char *name) +{ + struct file *file; + FILE *out; + + if (!name) + name = ".kconfig.d"; + out = fopen("..config.tmp", "w"); + if (!out) + return 1; + fprintf(out, "deps_config := \\\n"); + for (file = file_list; file; file = file->next) { + if (file->next) + fprintf(out, "\t%s \\\n", file->name); + else + fprintf(out, "\t%s\n", file->name); + } + fprintf(out, "\n%s: \\\n" + "\t$(deps_config)\n\n", conf_get_autoconfig_name()); + + env_write_dep(out, conf_get_autoconfig_name()); + + fprintf(out, "\n$(deps_config): ;\n"); + fclose(out); + rename("..config.tmp", name); + return 0; +} + static int conf_split_config(void) { const char *name; @@ -935,7 +964,7 @@ int conf_write_autoconf(void) sym_clear_all_valid(); - file_write_dep("include/config/auto.conf.cmd"); + conf_write_dep("include/config/auto.conf.cmd"); if (conf_split_config()) return 1; diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index ed3ff88..6b7bbc6 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -97,7 +97,6 @@ void menu_set_type(int type); /* util.c */ struct file *file_lookup(const char *name); -int file_write_dep(const char *name); void *xmalloc(size_t size); void *xcalloc(size_t nmemb, size_t size); void *xrealloc(void *p, size_t size); diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index a365594..d999683 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -29,36 +29,6 @@ struct file *file_lookup(const char *name) return file; } -/* write a dependency file as used by kbuild to track dependencies */ -int file_write_dep(const char *name) -{ - struct file *file; - FILE *out; - - if (!name) - name = ".kconfig.d"; - out = fopen("..config.tmp", "w"); - if (!out) - return 1; - fprintf(out, "deps_config := \\\n"); - for (file = file_list; file; file = file->next) { - if (file->next) - fprintf(out, "\t%s \\\n", file->name); - else - fprintf(out, "\t%s\n", file->name); - } - fprintf(out, "\n%s: \\\n" - "\t$(deps_config)\n\n", conf_get_autoconfig_name()); - - env_write_dep(out, conf_get_autoconfig_name()); - - fprintf(out, "\n$(deps_config): ;\n"); - fclose(out); - rename("..config.tmp", name); - return 0; -} - - /* Allocate initial growable string */ struct gstr str_new(void) {