From patchwork Fri Apr 13 05:06:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 133321 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp345749ljb; Thu, 12 Apr 2018 22:10:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx49ka9xzNNDRn++SjdYKM2Qh3jOxYBifu4NioWZ3oVbXL6Jye3BrxEZ9yOkkKITuRhNdUQbd X-Received: by 10.99.4.5 with SMTP id 5mr2904606pge.147.1523596240109; Thu, 12 Apr 2018 22:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523596240; cv=none; d=google.com; s=arc-20160816; b=c2z6lfWPjWLjW8pbqcyxeYTXqjZeZ+bXYE2/JLETsMWnZ7eymWT3JO+YJm1+kQj/jz kjV5IebredtR8wKJnpYZOwIV3NlOPygkTxSx/REgvSSckvkaIc9NunDWafDUa6DpY6oD ck/mekYQLNx+BvN9ND3AvKLWDMZvrxcwsI52sXyogu93H7N52Zre5cI7WTMkny9JKVNZ h0hVc7sIBo5gDJCIdVkbv8ilZchX3Cda8Myul0UPlFU5GL/jAHUXki6RU4mMj/MuJMsv 1rhpgSn27WgifDv4+YdLblfxPWaIm3oCbEyC4E6w7Tj5eQDI8vTjZBd+gE9eHJmm6bj5 3gCg== 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=xf6Ah/J4+SToU+K/ZeZa9XVRX0GK60bEzd6Qz746jQA=; b=kEkiBZwKK1blZTLIfoYNKN6cNuxd+uSC9T10bMIqTxTzLmZkahyBainZqHg9SujZB/ 681thySdV1F/x6bbcKZW5+e/k6WVSvJWOfkkbPUZpC6S+zOSCmlAb2K2JfVuYRxYYmxU jYhsqlDAxqk6i8i0URyWgD5Nvn74s2zyChaJkvPZdmdtKTxi+59lqwFq4lWiSj2a3+Qd /3Ar+ftizsg3f9Mdk5frbMr4G8wJZOP7eTQexAu74wf1MrAFSXT0CxLyA468sMbcLwl2 aVP3uyfAg9AoXr9vWBtS9Eyyh6q+JyFkoiSJ8Jr3X5XB5qSE8I186L8xFv3pHXPo4B3d yHwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=o29xVALm; 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 k9si3443994pgr.146.2018.04.12.22.10.39; Thu, 12 Apr 2018 22:10:40 -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=o29xVALm; 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 S1752986AbeDMFIg (ORCPT + 29 others); Fri, 13 Apr 2018 01:08:36 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54961 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbeDMFIa (ORCPT ); Fri, 13 Apr 2018 01:08:30 -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 w3D56lg1029209; Fri, 13 Apr 2018 14:06:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w3D56lg1029209 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523596014; bh=xf6Ah/J4+SToU+K/ZeZa9XVRX0GK60bEzd6Qz746jQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o29xVALmDeJG0gPcZlV9wPcupFzaC4lPPa364caqSV0Hg2QIKzwAcWYoNBI4plJR8 aWMWKLpBt2Gy7DDSdDfqjO/UzrsbIBYt7v9MPtAr+/yIeR71YbxtrDYzB8zzrXTOD6 w0whenia2rKTKKLZmH/qnVbVk7GS0/RUtYdF+VmKlV77Zo49MAFuVNR23yxf7lCb+6 CH5HDGAYWHCTkLofELj66tuYmWAiJwtDzIKiRxuQ2oYkE+n0cyXWBa6MU3z81wy1Tj 4fKAi3lAAuOzguYUv866W5i6Pmn8XuRw2N284Ed8zUOJdzOToc8YSYh3hiolT5xb9E VQDO8/M6fTu3w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 07/30] kconfig: remove sym_expand_string_value() Date: Fri, 13 Apr 2018 14:06:16 +0900 Message-Id: <1523595999-27433-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> References: <1523595999-27433-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 There is no more caller of sym_expand_string_value(). Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None scripts/kconfig/lkc_proto.h | 1 - scripts/kconfig/symbol.c | 53 --------------------------------------------- 2 files changed, 54 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 9f465fe..c46929f 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -31,7 +31,6 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; struct symbol * sym_lookup(const char *name, int flags); struct symbol * sym_find(const char *name); -char *sym_expand_string_value(const char *in); const char * sym_escape_string_value(const char *in); struct symbol ** sym_re_search(const char *pattern); const char * sym_type_name(enum symbol_type type); diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 2460648..7c9a88e 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -879,59 +879,6 @@ struct symbol *sym_find(const char *name) return symbol; } -/* - * Expand symbol's names embedded in the string given in argument. Symbols' - * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to - * the empty string. - */ -char *sym_expand_string_value(const char *in) -{ - const char *src; - char *res; - size_t reslen; - - /* - * Note: 'in' might come from a token that's about to be - * freed, so make sure to always allocate a new string - */ - reslen = strlen(in) + 1; - res = xmalloc(reslen); - res[0] = '\0'; - - while ((src = strchr(in, '$'))) { - char *p, name[SYMBOL_MAXLENGTH]; - const char *symval = ""; - struct symbol *sym; - size_t newlen; - - strncat(res, in, src - in); - src++; - - p = name; - while (isalnum(*src) || *src == '_') - *p++ = *src++; - *p = '\0'; - - sym = sym_find(name); - if (sym != NULL) { - sym_calc_value(sym); - symval = sym_get_string_value(sym); - } - - newlen = strlen(res) + strlen(symval) + strlen(src) + 1; - if (newlen > reslen) { - reslen = newlen; - res = xrealloc(res, reslen); - } - - strcat(res, symval); - in = src; - } - strcat(res, in); - - return res; -} - const char *sym_escape_string_value(const char *in) { const char *p;