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: 10507811 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 9FD4D601EA for ; Thu, 5 Jul 2018 02:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FF5B28C3F for ; Thu, 5 Jul 2018 02:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82F8228DB5; Thu, 5 Jul 2018 02:43:31 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 27E3728C3F for ; Thu, 5 Jul 2018 02:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbeGEClj (ORCPT ); Wed, 4 Jul 2018 22:41:39 -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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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) {