From patchwork Thu Feb 8 16:19:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 127676 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1641168ljc; Thu, 8 Feb 2018 08:21:46 -0800 (PST) X-Google-Smtp-Source: AH8x2257PgoMF5kzjXKS7QxKykPBfRAjgyHtWcCF21JTmPhM2Zee1VdhH07okDOIzWyHkjB+fPVX X-Received: by 2002:a17:902:70cc:: with SMTP id l12-v6mr1120434plt.67.1518106906060; Thu, 08 Feb 2018 08:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518106906; cv=none; d=google.com; s=arc-20160816; b=xuT9tX42JyHaXuxjebU0VP9C7xEk4Utg2gMTtqQM+sVQ0mdHNTi55O/NPJzprQ5lsq qdL9VXRETdNZdJDlmRxv5N5J1UAuyjdAUTkcKnIyTUgQzyNoWD1aF6050fZlQ8EOUJpd xh621PxuVKz9eU5JODSwWaJ8vvDVl2JOZZ42HbD+FWaXB5KAbjpTRFVED2ijJQ2nCxXZ SRs76lLj+fWot5/8JoFpT1lZQZsgP1Y8N35phTinnRO7qux6ofE922uz5wpww0K7TANJ qNOdy7+3r08cAZOpxbU2pgDebEFd5Kua+gL3W5ghDwPEV9kzEccJeFSfrSKDB4Omd8zN vM5g== 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=I9Hg17wLX5kmhRTYQxGVGOrJ6uikTpQIK1iRwVy31w4=; b=ymB3Y3GJPykwm4skGEJz3BwEozbWMSejTtfG08iyHg0pn7UaEx5QVMGoLwoXvgoGhX IrVdGLGfyBCNEuGwuYKqJyS2+4W9vaPjr5TuYqlrkXMj0+bBARl+AMqo9+1t6VkfisTU T9S9/8a+Gi68Zp+KWubTjMG6DArZ93aWWBDzTUSpVYIhHoncQ8d7l2W+0nYHzACXYCTl /LpXyPXPRW02sylSOMbPKVjLDW0yezNqGkeXcZ3SdRaWcNdLgtUH2CQZuPRpoSmijFDS 3vuaWc8ZTPwI36jZ/DChT9mmm3aOLG6N495vp7rv8g4BeQ0+9EIJpuSeowxQrBnjdjtc qYpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=uOpsnhMm; 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 q187si134694pga.547.2018.02.08.08.21.45; Thu, 08 Feb 2018 08:21:46 -0800 (PST) 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=uOpsnhMm; 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 S1752562AbeBHQVm (ORCPT + 13 others); Thu, 8 Feb 2018 11:21:42 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:19339 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbeBHQVg (ORCPT ); Thu, 8 Feb 2018 11:21:36 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-12.nifty.com with ESMTP id w18GJP1F021191; Fri, 9 Feb 2018 01:19:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w18GJP1F021191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518106769; bh=I9Hg17wLX5kmhRTYQxGVGOrJ6uikTpQIK1iRwVy31w4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOpsnhMmLvQJ1ufjabp45JUOqL2NTF/HxNNk5nPY4MUKoteKX55T4aeqZusT5JQVn kSQEkWS0TPW4Xxe7s2LFScBmBZdHXsZhQilA3mQre9Wu/AHn22GlkWholM90SRNuFM Qskq5Lu73w3t2QVDo6mNiKPygnxgTmdPLszuDBP9T6r48JIWqAN52DUzxdWKXc0C59 IvEnvv25mtxu0J2X4Q36WvH+WOOVwbiImk1amVsMPVXOuScp/SsZoi5b1FmVln7oQx 9jgXepmWfoYRpVsxStkMLdpn4RPOc+dOgWak8Sl1EbLaCs5COgH5OtXpD6HT1yKAFP P+XPo6YlsUCMw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Linus Torvalds Cc: Greg Kroah-Hartman , Andrew Morton , Kees Cook , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Martin Schwidefsky , Pavel Machek , linux-s390@vger.kernel.org, Jiri Kosina , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/7] kconfig: remove const qualifier from sym_expand_string_value() Date: Fri, 9 Feb 2018 01:19:08 +0900 Message-Id: <1518106752-29228-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518106752-29228-1-git-send-email-yamada.masahiro@socionext.com> References: <1518106752-29228-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 This function returns realloc'ed memory, so the returned pointer must be passed to free() when done. Change the return value type to save casting. Signed-off-by: Masahiro Yamada --- scripts/kconfig/lkc_proto.h | 2 +- scripts/kconfig/symbol.c | 2 +- scripts/kconfig/util.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 5d86e2d..9dc8abf 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -31,7 +31,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; struct symbol * sym_lookup(const char *name, int flags); struct symbol * sym_find(const char *name); -const char * sym_expand_string_value(const char *in); +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 bc3ec6a..893eae6 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -901,7 +901,7 @@ struct symbol *sym_find(const char *name) * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to * the empty string. */ -const char *sym_expand_string_value(const char *in) +char *sym_expand_string_value(const char *in) { const char *src; char *res; diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 01ead28..befaec9 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -14,11 +14,11 @@ struct file *file_lookup(const char *name) { struct file *file; - const char *file_name = sym_expand_string_value(name); + char *file_name = sym_expand_string_value(name); for (file = file_list; file; file = file->next) { if (!strcmp(name, file->name)) { - free((void *)file_name); + free(file_name); return file; } }