6c0556
commit 23e15ea1ae80ec2120afdf643691359644cf2873
6c0556
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
6c0556
Date:   Thu Jun 10 09:51:50 2021 +0530
6c0556
6c0556
    gconv_conf: Remove unused variables
6c0556
    
6c0556
    The modules and nmodules parameters passed to add_modules, add_alias,
6c0556
    etc. are not used and are hence unnecessary.  Remove them so that
6c0556
    their signatures match the functions in iconvconfig.
6c0556
    
6c0556
    Reviewed-by: DJ Delorie <dj@redhat.com>
6c0556
    Reviewed-by: Andreas Schwab <schwab@linux-m68k.org>
6c0556
6c0556
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
6c0556
index 3099bf192adce711..dc12ce24844474cc 100644
6c0556
--- a/iconv/gconv_conf.c
6c0556
+++ b/iconv/gconv_conf.c
6c0556
@@ -125,7 +125,7 @@ detect_conflict (const char *alias)
6c0556
 
6c0556
 /* The actual code to add aliases.  */
6c0556
 static void
6c0556
-add_alias2 (const char *from, const char *to, const char *wp, void *modules)
6c0556
+add_alias2 (const char *from, const char *to, const char *wp)
6c0556
 {
6c0556
   /* Test whether this alias conflicts with any available module.  */
6c0556
   if (detect_conflict (from))
6c0556
@@ -154,7 +154,7 @@ add_alias2 (const char *from, const char *to, const char *wp, void *modules)
6c0556
 
6c0556
 /* Add new alias.  */
6c0556
 static void
6c0556
-add_alias (char *rp, void *modules)
6c0556
+add_alias (char *rp)
6c0556
 {
6c0556
   /* We now expect two more string.  The strings are normalized
6c0556
      (converted to UPPER case) and strored in the alias database.  */
6c0556
@@ -179,7 +179,7 @@ add_alias (char *rp, void *modules)
6c0556
     return;
6c0556
   *wp++ = '\0';
6c0556
 
6c0556
-  add_alias2 (from, to, wp, modules);
6c0556
+  add_alias2 (from, to, wp);
6c0556
 }
6c0556
 
6c0556
 
6c0556
@@ -243,8 +243,7 @@ insert_module (struct gconv_module *newp, int tobefreed)
6c0556
 
6c0556
 /* Add new module.  */
6c0556
 static void
6c0556
-add_module (char *rp, const char *directory, size_t dir_len, void **modules,
6c0556
-	    size_t *nmodules, int modcounter)
6c0556
+add_module (char *rp, const char *directory, size_t dir_len, int modcounter)
6c0556
 {
6c0556
   /* We expect now
6c0556
      1. `from' name
6c0556
@@ -357,8 +356,7 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules,
6c0556
 
6c0556
 /* Read the next configuration file.  */
6c0556
 static void
6c0556
-read_conf_file (const char *filename, const char *directory, size_t dir_len,
6c0556
-		void **modules, size_t *nmodules)
6c0556
+read_conf_file (const char *filename, const char *directory, size_t dir_len)
6c0556
 {
6c0556
   /* Note the file is opened with cancellation in the I/O functions
6c0556
      disabled.  */
6c0556
@@ -408,10 +406,10 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len,
6c0556
 
6c0556
       if (rp - word == sizeof ("alias") - 1
6c0556
 	  && memcmp (word, "alias", sizeof ("alias") - 1) == 0)
6c0556
-	add_alias (rp, *modules);
6c0556
+	add_alias (rp);
6c0556
       else if (rp - word == sizeof ("module") - 1
6c0556
 	       && memcmp (word, "module", sizeof ("module") - 1) == 0)
6c0556
-	add_module (rp, directory, dir_len, modules, nmodules, modcounter++);
6c0556
+	add_module (rp, directory, dir_len, modcounter++);
6c0556
       /* else */
6c0556
 	/* Otherwise ignore the line.  */
6c0556
     }
6c0556
@@ -537,8 +535,6 @@ void
6c0556
 attribute_hidden
6c0556
 __gconv_read_conf (void)
6c0556
 {
6c0556
-  void *modules = NULL;
6c0556
-  size_t nmodules = 0;
6c0556
   int save_errno = errno;
6c0556
   size_t cnt;
6c0556
 
6c0556
@@ -570,7 +566,7 @@ __gconv_read_conf (void)
6c0556
 			    gconv_conf_filename, sizeof (gconv_conf_filename));
6c0556
 
6c0556
       /* Read the gconv-modules configuration file first.  */
6c0556
-      read_conf_file (buf, elem, elem_len, &modules, &nmodules);
6c0556
+      read_conf_file (buf, elem, elem_len);
6c0556
 
6c0556
       /* Next, see if there is a gconv-modules.d directory containing
6c0556
 	 configuration files and if it is non-empty.  */
6c0556
@@ -597,7 +593,7 @@ __gconv_read_conf (void)
6c0556
 		  char *conf;
6c0556
 		  if (__asprintf (&conf, "%s/%s", buf, ent->d_name) < 0)
6c0556
 		    continue;
6c0556
-		  read_conf_file (conf, elem, elem_len, &modules, &nmodules);
6c0556
+		  read_conf_file (conf, elem, elem_len);
6c0556
 		  free (conf);
6c0556
 		}
6c0556
 	    }
6c0556
@@ -631,7 +627,7 @@ __gconv_read_conf (void)
6c0556
       const char *to = __rawmemchr (from, '\0') + 1;
6c0556
       cp = __rawmemchr (to, '\0') + 1;
6c0556
 
6c0556
-      add_alias2 (from, to, cp, modules);
6c0556
+      add_alias2 (from, to, cp);
6c0556
     }
6c0556
   while (*cp != '\0');
6c0556