From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] kconfig: remove const qualifier from str_get()
Date: Sun, 13 Nov 2022 19:59:42 +0900 [thread overview]
Message-ID: <20221113105943.3753945-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20221113105943.3753945-1-masahiroy@kernel.org>
update_text() apparently edits the buffer returned by str_get().
(and there is no reason why it shouldn't)
Remove 'const' quailifier and casting.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/lkc.h | 2 +-
scripts/kconfig/mconf.c | 4 ++--
scripts/kconfig/util.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 6ac2eabe109d..e7118d62a45f 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -76,7 +76,7 @@ struct gstr str_new(void);
void str_free(struct gstr *gs);
void str_append(struct gstr *gs, const char *s);
void str_printf(struct gstr *gs, const char *fmt, ...);
-const char *str_get(struct gstr *gs);
+char *str_get(struct gstr *gs);
/* menu.c */
void _menu_init(void);
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 9d3cf510562f..d7f7e1bf7dd4 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -440,8 +440,8 @@ static void search_conf(void)
res = get_relations_str(sym_arr, &head);
set_subtitle();
- dres = show_textbox_ext("Search Results", (char *)
- str_get(&res), 0, 0, keys, &vscroll,
+ dres = show_textbox_ext("Search Results", str_get(&res), 0, 0,
+ keys, &vscroll,
&hscroll, &update_text, (void *)
&data);
again = false;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 29585394df71..b78f114ad48c 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -74,7 +74,7 @@ void str_printf(struct gstr *gs, const char *fmt, ...)
}
/* Retrieve value of growable string */
-const char *str_get(struct gstr *gs)
+char *str_get(struct gstr *gs)
{
return gs->s;
}
--
2.34.1
next prev parent reply other threads:[~2022-11-13 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 10:59 [PATCH 1/3] kconfig: remove unneeded variable in get_prompt_str() Masahiro Yamada
2022-11-13 10:59 ` Masahiro Yamada [this message]
2022-11-13 10:59 ` [PATCH 3/3] kconfig: remove redundant (void *) cast in search_conf() Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221113105943.3753945-2-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox