ANDROID: GKI: gki_module: Provide namespacing for cmp_name()

There are more than one functions called cmp_name() and at least one of
them is exported.  Let's namespace this one to avoid any confusion or
collisions.

  kernel/module/gki_module.c:27:12: error: static declaration of 'cmp_name' follows non-static declaration
     27 | static int cmp_name(const void *sym, const void *protected_sym)
        |            ^
  kernel/module/internal.h:109:5: note: previous declaration is here
    109 | int cmp_name(const void *name, const void *sym);
        |     ^

Fixes: e9669eeb2f ("ANDROID: GKI: Add module load time symbol protection")
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I8f85c6b9546ab1547f8a5200919888249c9d7592
This commit is contained in:
Lee Jones
2024-03-19 08:54:16 +00:00
parent 2426ed640a
commit 0a3766b330
+3 -3
View File
@@ -24,7 +24,7 @@
#define MAX_STRCMP_LEN (max(MAX_UNPROTECTED_NAME_LEN, MAX_PROTECTED_EXPORTS_NAME_LEN))
/* bsearch() comparision callback */
static int cmp_name(const void *sym, const void *protected_sym)
static int gki_cmp_name(const void *sym, const void *protected_sym)
{
return strncmp(sym, protected_sym, MAX_STRCMP_LEN);
}
@@ -38,7 +38,7 @@ bool gki_is_module_protected_export(const char *name)
{
if (NR_UNPROTECTED_SYMBOLS) {
return bsearch(name, gki_protected_exports_symbols, NR_PROTECTED_EXPORTS_SYMBOLS,
MAX_PROTECTED_EXPORTS_NAME_LEN, cmp_name) != NULL;
MAX_PROTECTED_EXPORTS_NAME_LEN, gki_cmp_name) != NULL;
} else {
/*
* If there are no symbols in unprotected list; We don't need to
@@ -58,7 +58,7 @@ bool gki_is_module_unprotected_symbol(const char *name)
{
if (NR_UNPROTECTED_SYMBOLS) {
return bsearch(name, gki_unprotected_symbols, NR_UNPROTECTED_SYMBOLS,
MAX_UNPROTECTED_NAME_LEN, cmp_name) != NULL;
MAX_UNPROTECTED_NAME_LEN, gki_cmp_name) != NULL;
} else {
/*
* If there are no symbols in unprotected list;