From 0058f85f20d1adff61d424c623a27da9f869925b Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 18 Sep 2024 01:18:23 +0100 Subject: envlist: Remove unused envlist_parse envlist_parse, envlist_parse_set, envlist_parse_unset were added in 2009 but never used, see: 04a6dfebb6 ("linux-user: Add generic env variable handling") Remove them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- util/envlist.c | 69 ---------------------------------------------------------- 1 file changed, 69 deletions(-) (limited to 'util') diff --git a/util/envlist.c b/util/envlist.c index db937c0427..15fdbb109d 100644 --- a/util/envlist.c +++ b/util/envlist.c @@ -12,9 +12,6 @@ struct envlist { size_t el_count; /* number of entries */ }; -static int envlist_parse(envlist_t *envlist, - const char *env, int (*)(envlist_t *, const char *)); - /* * Allocates new envlist and returns pointer to it. */ @@ -51,72 +48,6 @@ envlist_free(envlist_t *envlist) g_free(envlist); } -/* - * Parses comma separated list of set/modify environment - * variable entries and updates given enlist accordingly. - * - * For example: - * envlist_parse(el, "HOME=foo,SHELL=/bin/sh"); - * - * inserts/sets environment variables HOME and SHELL. - * - * Returns 0 on success, errno otherwise. - */ -int -envlist_parse_set(envlist_t *envlist, const char *env) -{ - return (envlist_parse(envlist, env, &envlist_setenv)); -} - -/* - * Parses comma separated list of unset environment variable - * entries and removes given variables from given envlist. - * - * Returns 0 on success, errno otherwise. - */ -int -envlist_parse_unset(envlist_t *envlist, const char *env) -{ - return (envlist_parse(envlist, env, &envlist_unsetenv)); -} - -/* - * Parses comma separated list of set, modify or unset entries - * and calls given callback for each entry. - * - * Returns 0 in case of success, errno otherwise. - */ -static int -envlist_parse(envlist_t *envlist, const char *env, - int (*callback)(envlist_t *, const char *)) -{ - char *tmpenv, *envvar; - char *envsave = NULL; - int ret = 0; - assert(callback != NULL); - - if ((envlist == NULL) || (env == NULL)) - return (EINVAL); - - tmpenv = g_strdup(env); - envsave = tmpenv; - - do { - envvar = strchr(tmpenv, ','); - if (envvar != NULL) { - *envvar = '\0'; - } - if ((*callback)(envlist, tmpenv) != 0) { - ret = errno; - break; - } - tmpenv = envvar + 1; - } while (envvar != NULL); - - g_free(envsave); - return ret; -} - /* * Sets environment value to envlist in similar manner * than putenv(3). -- cgit v1.2.3 From ecffadf602f34cc1cf4c3ae81502564673d410e8 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 18 Sep 2024 17:53:23 +0100 Subject: util/cutils: Remove unused qemu_get_exec_dir qemu_get_exec_dir has been unused since commit: 5bebe03f51 ("util/cutils: Clean up global variable shadowing in get_relocated_path()") Remove it, and fix up a comment that pointed to it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- util/cutils.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'util') diff --git a/util/cutils.c b/util/cutils.c index 42364039a5..9803f11a59 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1144,11 +1144,6 @@ void qemu_init_exec_dir(const char *argv0) #endif } -const char *qemu_get_exec_dir(void) -{ - return exec_dir; -} - char *get_relocated_path(const char *dir) { size_t prefix_len = strlen(CONFIG_PREFIX); -- cgit v1.2.3 From dc86dd55d53c18a5f3840088c8c449671b86ad09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 11 Sep 2024 17:12:03 +0200 Subject: license: Simplify GPL-2.0-or-later license descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the "2 | 3+" expression can be simplified as "2+", it is pointless to mention the GPLv3 license. Add the corresponding SPDX identifier to remove all doubt. Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- util/timed-average.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/timed-average.c b/util/timed-average.c index 2b49d532ce..5b5c22afd8 100644 --- a/util/timed-average.c +++ b/util/timed-average.c @@ -8,10 +8,12 @@ * Benoît Canet * Alberto Garcia * + * SPDX-License-Identifier: GPL-2.0-or-later + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or - * (at your option) version 3 or any later version. + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit v1.2.3