Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2143335imm; Mon, 28 May 2018 02:30:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp4Rchy2yN7ECoMcsSIIbD5o0S8z/iz3DPCuy4qLbZLB1Q8ZJ8XRk2YngZ5pAd0QXZsqi4a X-Received: by 2002:a65:4ecc:: with SMTP id w12-v6mr9972577pgq.214.1527499804106; Mon, 28 May 2018 02:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499804; cv=none; d=google.com; s=arc-20160816; b=I1YM8Db5E2ePCHewWt0MOXDEVGtxPnrtapMQhgjvuQJFTU4+bqOPqYo6mdP2cZxEWL U4aCEYVOhBDrfQSOWC/dgR9LpT14TV9snyPy1KS2+tnvfBVYtpQYriZonniRIzMzeaD2 Lb3wON9+EtiH5h2OpKT0FZqPObNy8x4dV1QuOKuFHD5qrwtA9FvG2hdEO0pog5Nxdt7a r7uuDdZKXlT42Z1eVinkQ67xFwC22/GdRXDVy5xb26E66V2PfuvlwmQzMVLmHGeSGVlS YHl8GACf/YThGYyBqLFfdtj9UVCAZP8NBHVY/8iD/Cnnn5QxQAs2IyWVZCgFpoX6jEac 3u8A== 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=V7aT5q12Mz8VRqDnP3delQOQnBaFgtyqn3U4iSjRNGo=; b=0ILxAY34cc03LQTCash1IHUhKnqSK1JnSk73AjYyvIO7RqgGHNgwJqsZkQn5f2Ej00 DBrCG++HUxGWySIKZjwmeP9rLzdvj6ROXjAC1RMuRDl178pQtiqR3k88zBvQReWixcKa yEGZtKE/LR5tN+F1fnHpLxVr+q6ur78trexlwZVV/Z/SfKaLCmbfVrAwgOyS0JZ6yPbB 63wSNG7VmS4RNFUSvc2eJxCwwAo17/zUAzVBLHJywo9fMgmXNFLDk3OSV4aiCG4eJd7D hDiz7zAd0q0IKUfjnNRth2ISRMaz72aWnwEHdlZm786Q9VFwQ2T2Nbpm12Z34zA0Kxoi HRIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=h8Uvu++x; 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 y9-v6si30253099pfk.34.2018.05.28.02.29.49; Mon, 28 May 2018 02:30:04 -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=h8Uvu++x; 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 S933881AbeE1J2P (ORCPT + 99 others); Mon, 28 May 2018 05:28:15 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:21666 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754337AbeE1JYR (ORCPT ); Mon, 28 May 2018 05:24:17 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInN027506; Mon, 28 May 2018 18:22:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInN027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499344; bh=V7aT5q12Mz8VRqDnP3delQOQnBaFgtyqn3U4iSjRNGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h8Uvu++xk2B3VFteKCfJPZkjFoj9hgbb0jl5a2rT/efVbPbgLWjcuArE3Ky3h1VEL 0z6bh/WuBxg5Em34sy+s8XH54omqnZny+03TuXzQuYmdVcUepU4nPFsFaBH2V30Nai ezrlKztVCCdIKBIbfXFLx2t0MHTiC2Wsxp7H989Vfp/LzjfrhkAOZvkInSxKVZyWaL 9du3I0r38DL5DU0hmUiYMeObWcbBaIYuUtZRbx3APiV/+s7Taw62NiYrObNMiM1tIc KiMGNncapRiRc70+Vss3q9oc2UM8NuiK36BLSKxdlG0OxMGh8UdE03UhCVROJeHQJS h3jxgjcsgHYsg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 06/31] kconfig: remove sym_expand_string_value() Date: Mon, 28 May 2018 18:21:43 +0900 Message-Id: <1527499328-13213-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-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 Reviewed-by: Kees Cook --- Changes in v5: None Changes in v4: None 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(-) 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; -- 2.7.4