projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scripts: modpost: fix compilation warning
[firefly-linux-kernel-4.4.55.git]
/
scripts
/
mod
/
modpost.c
diff --git
a/scripts/mod/modpost.c
b/scripts/mod/modpost.c
index 9d9c5b905b359e58b9eb98eac457ef81d7f8179b..5ba203b9eddf90366bf05986c830eecc54c4b509 100644
(file)
--- a/
scripts/mod/modpost.c
+++ b/
scripts/mod/modpost.c
@@
-1703,12
+1703,11
@@
static void check_sec_ref(struct module *mod, const char *modname,
static char *remove_dot(char *s)
{
static char *remove_dot(char *s)
{
- char *end;
- int n = strcspn(s, ".");
+ size_t n = strcspn(s, ".");
- if (n
> 0 && s[n] != 0
) {
- s
trtoul(s + n + 1, &end, 10
);
- if
(end > s + n + 1 && (*end == '.' || *end
== 0))
+ if (n
&& s[n]
) {
+ s
ize_t m = strspn(s + n + 1, "0123456789"
);
+ if
(m && (s[n + m] == '.' || s[n + m]
== 0))
s[n] = 0;
}
return s;
s[n] = 0;
}
return s;