Received: by 10.223.176.5 with SMTP id f5csp2096121wra; Thu, 8 Feb 2018 08:22:51 -0800 (PST) X-Google-Smtp-Source: AH8x226Pq22NGdO30Co2Bl2fjQRxghy4X9HD0phQTkq3qYD7kdxiGDS4Oo+/2Vta94ytFSirQBZ0 X-Received: by 10.101.83.131 with SMTP id x3mr937288pgq.65.1518106971158; Thu, 08 Feb 2018 08:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518106971; cv=none; d=google.com; s=arc-20160816; b=pDR2smZotBARLn7Gyudt5U4jDy6VBkA+n3lqA07A6/4tFHTui9+OaLrMzxaZmCRo04 jYS+pSdZspyk5Y1iK7HA7hewfjZS3hI0hX29q1jyXWYMJRu2Op7hAOSJvVDH6YppyQiM XaQmLMma8tEC8/OARR39Fsfz78OXHNtwjEIdvO0i4eM4ZchdcpOqAl7vkI4Q+dfea6zd suVoIeDBpZZrllJyW7iAqW23iXG1izbNLVKjFnoTAJRJjK2xqxGkaEYDwYMhTrTNB5Pp X/KfUQfml1qA2YwY2S0gkEgCriQEgY1ARSo8Gf+vAZU/24XCmyvKngIwYIyDzx9Di9OS nRKQ== 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 x143si145023pgx.147.2018.02.08.08.22.35; Thu, 08 Feb 2018 08:22:51 -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 S1752547AbeBHQVm (ORCPT + 99 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(-) 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; } } -- 2.7.4