Remove lh_FOO_doall.

This is not exported, and lh_FOO_doall_arg is sufficient.

Change-Id: I251a4490577cbde71e09470f5a8898e3c8a457ce
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/48207
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c
index 42d5f81..bc147f3 100644
--- a/crypto/conf/conf.c
+++ b/crypto/conf/conf.c
@@ -156,12 +156,14 @@
   OPENSSL_free(value);
 }
 
+static void value_free_arg(CONF_VALUE *value, void *arg) { value_free(value); }
+
 void NCONF_free(CONF *conf) {
   if (conf == NULL || conf->data == NULL) {
     return;
   }
 
-  lh_CONF_VALUE_doall(conf->data, value_free);
+  lh_CONF_VALUE_doall_arg(conf->data, value_free_arg, NULL);
   lh_CONF_VALUE_free(conf->data);
   OPENSSL_free(conf);
 }
diff --git a/crypto/lhash/internal.h b/crypto/lhash/internal.h
index 8b88640..64dca1d 100644
--- a/crypto/lhash/internal.h
+++ b/crypto/lhash/internal.h
@@ -230,30 +230,18 @@
   }                                                                            \
                                                                                \
   typedef struct {                                                             \
-    void (*doall)(type *);                                                     \
     void (*doall_arg)(type *, void *);                                         \
     void *arg;                                                                 \
   } LHASH_DOALL_##type;                                                        \
                                                                                \
-  OPENSSL_INLINE void lh_##type##_call_doall(void *value, void *arg) {         \
-    const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg;            \
-    cb->doall((type *)value);                                                  \
-  }                                                                            \
-                                                                               \
   OPENSSL_INLINE void lh_##type##_call_doall_arg(void *value, void *arg) {     \
     const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg;            \
     cb->doall_arg((type *)value, cb->arg);                                     \
   }                                                                            \
                                                                                \
-  OPENSSL_INLINE void lh_##type##_doall(LHASH_OF(type) *lh,                    \
-                                        void (*func)(type *)) {                \
-    LHASH_DOALL_##type cb = {func, NULL, NULL};                                \
-    OPENSSL_lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall, &cb);           \
-  }                                                                            \
-                                                                               \
   OPENSSL_INLINE void lh_##type##_doall_arg(                                   \
       LHASH_OF(type) *lh, void (*func)(type *, void *), void *arg) {           \
-    LHASH_DOALL_##type cb = {NULL, func, arg};                                 \
+    LHASH_DOALL_##type cb = {func, arg};                                       \
     OPENSSL_lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall_arg, &cb);       \
   }
 
diff --git a/crypto/lhash/lhash_test.cc b/crypto/lhash/lhash_test.cc
index aa6b435..6b4bfad 100644
--- a/crypto/lhash/lhash_test.cc
+++ b/crypto/lhash/lhash_test.cc
@@ -94,15 +94,6 @@
                         &actual);
       std::sort(actual.begin(), actual.end());
       EXPECT_EQ(expected, actual);
-
-      // Also test |lh_*_doall|.
-      actual.clear();
-      static ValueList *global_actual_list;
-      global_actual_list = &actual;
-      lh_char_doall(lh.get(),
-                    [](char *ptr) { global_actual_list->push_back(ptr); });
-      std::sort(actual.begin(), actual.end());
-      EXPECT_EQ(expected, actual);
     }
 
     enum Action {