Use -Werror in hardware/libhardware

* Remove unused local variables and function.
* Fix unused return value warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I269eca76cda2222c7a0176e85e92df0bb0924a0e
diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp
index b5360cc..a1f0104 100644
--- a/modules/sensors/multihal.cpp
+++ b/modules/sensors/multihal.cpp
@@ -515,6 +515,7 @@
     if (ctx != NULL) {
         int retval = ctx->close();
         delete ctx;
+        return retval;
     }
 
     if (sub_hw_modules != nullptr) {
@@ -586,15 +587,6 @@
 static int open_sensors(const struct hw_module_t* module, const char* name,
         struct hw_device_t** device);
 
-static bool starts_with(const char* s, const char* prefix) {
-    if (s == NULL || prefix == NULL) {
-        return false;
-    }
-    size_t s_size = strlen(s);
-    size_t prefix_size = strlen(prefix);
-    return s_size >= prefix_size && strncmp(s, prefix, prefix_size) == 0;
-}
-
 /*
  * Adds valid paths from the config file to the vector passed in.
  * The vector must not be null.