]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
modprobe: remove unneeded variable str_start
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 10 Feb 2022 02:14:23 +0000 (11:14 +0900)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 4 Apr 2022 15:14:41 +0000 (08:14 -0700)
The variable 'str_start' is not useful here.

Replace it with 'str'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
tools/modprobe.c

index 48b1c8ceb78dd3e1da995c4f0b056f6d7918dfb5..ca372b8733976a21358c70f5ff7363cd2a191c38 100644 (file)
@@ -684,7 +684,7 @@ static int options_from_array(char **args, int nargs, char **output)
 static char **prepend_options_from_env(int *p_argc, char **orig_argv)
 {
        const char *p, *env = getenv("MODPROBE_OPTIONS");
-       char **new_argv, *str_start, *str_end, *str, *s, *quote;
+       char **new_argv, *str_end, *str, *s, *quote;
        int i, argc = *p_argc;
        size_t envlen, space_count = 0;
 
@@ -702,10 +702,10 @@ static char **prepend_options_from_env(int *p_argc, char **orig_argv)
                return NULL;
 
        new_argv[0] = orig_argv[0];
-       str_start = str = (char *) (new_argv + argc + space_count + 3);
+       str = (char *) (new_argv + argc + space_count + 3);
        memcpy(str, env, envlen + 1);
 
-       str_end = str_start + envlen;
+       str_end = str + envlen;
 
        quote = NULL;
        for (i = 1, s = str; *s != '\0'; s++) {