From patchwork Fri Jul 20 07:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142439 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2649844ljj; Fri, 20 Jul 2018 00:48:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeX4XE2KJp7X5JmHm7o8StMtqKZfbOiVTAFGHjRojbipcBbr+kvdC9FDejL64pUQw6RnMlu X-Received: by 2002:a17:902:7884:: with SMTP id q4-v6mr1065542pll.174.1532072895183; Fri, 20 Jul 2018 00:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532072895; cv=none; d=google.com; s=arc-20160816; b=WBDM66yNAs1FqkobEdRTESEQr3cXVXWwK7aCaqirkWjxG6lwUxTSMx6eiAs7GPvjvL Y0NdphtjiNMKS932l9oIaAxcMKt3EwVyMN3XFQL/eB77BjuAgG+ZJ058o7Gmr87L0h4p Fp6x3AfreoDZExGj5lDLwdJvmocgPQ4frRGNtEsp/VL0UVM8KLIVzQkZsvIECdty9etT KUig+uCatzNX7Xc4er2wnPjANHZSRQboBOINwYhz0QCFgLH29PHCe31oINPtmXloW107 nMOUNs7vyWXOcJIw2QRRvigzQYRcB7LChxdvwq1mhQ95ORQilX1ePgra4XsuHWYMEWpK 9gLw== 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=+vx41ZFtpKJwWZU71ii9pTSFQCyA/XRd3YVe6EEB2ys=; b=dS0rC7HKkX9zhe5CUaqzSIVkf2sv7HBSB9ikpbmJnCP69hhTQqJPYj1RyF+X/K/SqM uAhJqNDCOEgU4kuAWT2UV/EhhcRMzNuhfDaZbZ9cJ1+y0eoZx/zS8YufvOV8ZmopgFXN G7KeAQwGnyaC0AMFER4FCk9xFJ1tfzUgeVIAFcUsKdlYT5/znYpyDsNlrkreAFpyGbR8 CBJSZgWiAxTUZIewPRbPXaKkSHNzjRDRyKYGlLTTYv/V3w8yd4jdwTntv4zDB3qS5fo8 NUSTt3AtBN1lG10mqNZG+zkjw8sTUuGO0Cfgq823km1rMrpPv90F0QmHOalHqRVwgMkS 91Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=h95JPZ4v; 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 34-v6si1305175pgs.243.2018.07.20.00.48.14; Fri, 20 Jul 2018 00:48:15 -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=h95JPZ4v; 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 S1728064AbeGTIfL (ORCPT + 31 others); Fri, 20 Jul 2018 04:35:11 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:28803 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727748AbeGTIfK (ORCPT ); Fri, 20 Jul 2018 04:35:10 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w6K7kdir008048; Fri, 20 Jul 2018 16:46:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w6K7kdir008048 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1532072800; bh=+vx41ZFtpKJwWZU71ii9pTSFQCyA/XRd3YVe6EEB2ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h95JPZ4v9qNh+9Rb8e94J5yrNyW5wNrmrKREXf1yjRzlhpdkLw4UfGy+UYRHDLjpT pqL4yN9ZXoAPACKUKa26qcm0ELXMuGkiDrLPP39EKlp6qqhC/gmDqaK9AFCVRlkF2j BAw4t7ll6vGsFzO8t0w3hWPiBNfbkOAeg4D6O5A6oTW4c1PP4HgIijiFJK4Pykub4E zXC6XNCpmdg4YJxSOP7j7ek7WQreTnyVPGPK9Ii0TBZnrahgKm/VlTbsK2+9FcZW1Q HVsRKHg0wPzaxX/Rye+4FzFvbpsIVpyEzwBCRhTUm0aLscIRBDa2cIH1vQTL5GG7fC YUzKzDkUgomRg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Dirk Gouders , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v4 01/11] kconfig: rename file_write_dep and move it to confdata.c Date: Fri, 20 Jul 2018 16:46:26 +0900 Message-Id: <1532072796-7947-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532072796-7947-1-git-send-email-yamada.masahiro@socionext.com> References: <1532072796-7947-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 --- Changes in v4: None 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) {