← Commit list

1b6715345

Denys Vlasenko
Denys Vlasenko
2015-01-11
SUCCESS Duration: 143s

Subject

modprobe-small: code shrink

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

modutils/modprobe-small.c+9 -12
@@ -163,6 +163,15 @@ static char *filename2modname(const char *filename, char *modname)
return modname;
}
+static int pathname_matches_modname(const char *pathname, const char *modname)
+{
+ int r;
+ char name[MODULE_NAME_LEN];
+ filename2modname(bb_get_last_path_component_nostrip(pathname), name);
+ r = (strcmp(name, modname) == 0);
+ return r;
+}
+
/* Take "word word", return malloced "word",NUL,"word",NUL,NUL */
static char* str_2_list(const char *str)
{
@@ -295,18 +304,6 @@ static void parse_module(module_info *info, const char *pathname)
free(module_image);
}
-static int pathname_matches_modname(const char *pathname, const char *modname)
-{
- int r;
- char name[MODULE_NAME_LEN];
- const char *fname = bb_get_last_path_component_nostrip(pathname);
- const char *suffix = strrstr(fname, ".ko");
- safe_strncpy(name, fname, suffix - fname + 1);
- replace(name, '-', '_');
- r = (strcmp(name, modname) == 0);
- return r;
-}
-
static FAST_FUNC int fileAction(const char *pathname,
struct stat *sb UNUSED_PARAM,
void *modname_to_match,