Skip to content

Commit f693153

Browse files
committed
modpost: drop RCS/CVS $Revision handling in MODULE_VERSION()
As far as I understood, this code gets rid of '$Revision$' or '$Revision:' of CVS, RCS or whatever in MODULE_VERSION() tags. Remove the primeval code. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 48a0f72 commit f693153

File tree

3 files changed

+0
-73
lines changed

3 files changed

+0
-73
lines changed

scripts/mod/modpost.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,9 +2066,6 @@ static void read_symbols(const char *modname)
20662066
check_sec_ref(mod, modname, &info);
20672067

20682068
version = get_modinfo(&info, "version");
2069-
if (version)
2070-
maybe_frob_rcs_version(modname, version, info.modinfo,
2071-
version - (char *)info.hdr);
20722069
if (version || (all_versions && !is_vmlinux(modname)))
20732070
get_src_version(modname, mod->srcversion,
20742071
sizeof(mod->srcversion)-1);

scripts/mod/modpost.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
188188
void add_moddevtable(struct buffer *buf, struct module *mod);
189189

190190
/* sumversion.c */
191-
void maybe_frob_rcs_version(const char *modfilename,
192-
char *version,
193-
void *modinfo,
194-
unsigned long modinfo_offset);
195191
void get_src_version(const char *modname, char sum[], unsigned sumlen);
196192

197193
/* from modpost.c */

scripts/mod/sumversion.c

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -429,69 +429,3 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
429429
release:
430430
release_file(file, len);
431431
}
432-
433-
static void write_version(const char *filename, const char *sum,
434-
unsigned long offset)
435-
{
436-
int fd;
437-
438-
fd = open(filename, O_RDWR);
439-
if (fd < 0) {
440-
warn("changing sum in %s failed: %s\n",
441-
filename, strerror(errno));
442-
return;
443-
}
444-
445-
if (lseek(fd, offset, SEEK_SET) == (off_t)-1) {
446-
warn("changing sum in %s:%lu failed: %s\n",
447-
filename, offset, strerror(errno));
448-
goto out;
449-
}
450-
451-
if (write(fd, sum, strlen(sum)+1) != strlen(sum)+1) {
452-
warn("writing sum in %s failed: %s\n",
453-
filename, strerror(errno));
454-
goto out;
455-
}
456-
out:
457-
close(fd);
458-
}
459-
460-
static int strip_rcs_crap(char *version)
461-
{
462-
unsigned int len, full_len;
463-
464-
if (strncmp(version, "$Revision", strlen("$Revision")) != 0)
465-
return 0;
466-
467-
/* Space for version string follows. */
468-
full_len = strlen(version) + strlen(version + strlen(version) + 1) + 2;
469-
470-
/* Move string to start with version number: prefix will be
471-
* $Revision$ or $Revision: */
472-
len = strlen("$Revision");
473-
if (version[len] == ':' || version[len] == '$')
474-
len++;
475-
while (isspace(version[len]))
476-
len++;
477-
memmove(version, version+len, full_len-len);
478-
full_len -= len;
479-
480-
/* Preserve up to next whitespace. */
481-
len = 0;
482-
while (version[len] && !isspace(version[len]))
483-
len++;
484-
memmove(version + len, version + strlen(version),
485-
full_len - strlen(version));
486-
return 1;
487-
}
488-
489-
/* Clean up RCS-style version numbers. */
490-
void maybe_frob_rcs_version(const char *modfilename,
491-
char *version,
492-
void *modinfo,
493-
unsigned long version_offset)
494-
{
495-
if (strip_rcs_crap(version))
496-
write_version(modfilename, version, version_offset);
497-
}

0 commit comments

Comments
 (0)