unsigned long pos;
};
-static int klp_find_callback(void *data, const char *name,
- struct module *mod, unsigned long addr)
+static int klp_match_callback(void *data, unsigned long addr)
{
struct klp_find_arg *args = data;
- if ((mod && !args->objname) || (!mod && args->objname))
- return 0;
-
- if (strcmp(args->name, name))
- return 0;
-
- if (args->objname && strcmp(args->objname, mod->name))
- return 0;
-
args->addr = addr;
args->count++;
return 0;
}
-static int klp_match_callback(void *data, unsigned long addr)
+static int klp_find_callback(void *data, const char *name,
+ struct module *mod, unsigned long addr)
{
struct klp_find_arg *args = data;
- args->addr = addr;
- args->count++;
+ if ((mod && !args->objname) || (!mod && args->objname))
+ return 0;
- /*
- * Finish the search when the symbol is found for the desired position
- * or the position is not defined for a non-unique symbol.
- */
- if ((args->pos && (args->count == args->pos)) ||
- (!args->pos && (args->count > 1)))
- return 1;
+ if (strcmp(args->name, name))
+ return 0;
- return 0;
+ if (args->objname && strcmp(args->objname, mod->name))
+ return 0;
+
+ return klp_match_callback(data, addr);
}
static int klp_find_object_symbol(const char *objname, const char *name,