summaryrefslogtreecommitdiffstats
path: root/scripts/recordmcount.c
diff options
context:
space:
mode:
authorMatt Helsley <mhelsley@vmware.com>2019-07-24 14:04:57 -0700
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-08-31 12:19:38 -0400
commit17e262e9954bc3b6c857670f60b5b015f53509a7 (patch)
tree9bb366f7bc3147f7243a53c345a566e359778898 /scripts/recordmcount.c
parenta146207916092a49bd01ef861ac9582fd318c21a (diff)
downloadlinux-stable-17e262e9954bc3b6c857670f60b5b015f53509a7.tar.gz
linux-stable-17e262e9954bc3b6c857670f60b5b015f53509a7.tar.bz2
linux-stable-17e262e9954bc3b6c857670f60b5b015f53509a7.zip
recordmcount: Remove unused fd from uwrite() and ulseek()
uwrite() works within the pseudo-mapping and extends it as necessary without needing the file descriptor (fd) parameter passed to it. Similarly, ulseek() doesn't need its fd parameter. These parameters were only added because the functions bear a conceptual resemblance to write() and lseek(). Worse, they obscure the fact that at the time uwrite() and ulseek() are called fd_map is not a valid file descriptor. Remove the unused file descriptor parameters that make it look like fd_map is still valid. Link: http://lkml.kernel.org/r/2a136e820ee208469d375265c7b8eb28570749a0.1563992889.git.mhelsley@vmware.com Signed-off-by: Matt Helsley <mhelsley@vmware.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'scripts/recordmcount.c')
-rw-r--r--scripts/recordmcount.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index c0dd46344063..1fe5fba99959 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -92,7 +92,7 @@ succeed_file(void)
/* ulseek, uwrite, ...: Check return value for errors. */
static off_t
-ulseek(int const fd, off_t const offset, int const whence)
+ulseek(off_t const offset, int const whence)
{
switch (whence) {
case SEEK_SET:
@@ -113,7 +113,7 @@ ulseek(int const fd, off_t const offset, int const whence)
}
static size_t
-uwrite(int const fd, void const *const buf, size_t const count)
+uwrite(void const *const buf, size_t const count)
{
size_t cnt = count;
off_t idx = 0;
@@ -183,8 +183,8 @@ static int make_nop_x86(void *map, size_t const offset)
return -1;
/* convert to nop */
- ulseek(fd_map, offset - 1, SEEK_SET);
- uwrite(fd_map, ideal_nop, 5);
+ ulseek(offset - 1, SEEK_SET);
+ uwrite(ideal_nop, 5);
return 0;
}
@@ -232,10 +232,10 @@ static int make_nop_arm(void *map, size_t const offset)
return -1;
/* Convert to nop */
- ulseek(fd_map, off, SEEK_SET);
+ ulseek(off, SEEK_SET);
do {
- uwrite(fd_map, ideal_nop, nop_size);
+ uwrite(ideal_nop, nop_size);
} while (--cnt > 0);
return 0;
@@ -252,8 +252,8 @@ static int make_nop_arm64(void *map, size_t const offset)
return -1;
/* Convert to nop */
- ulseek(fd_map, offset, SEEK_SET);
- uwrite(fd_map, ideal_nop, 4);
+ ulseek(offset, SEEK_SET);
+ uwrite(ideal_nop, 4);
return 0;
}