compat: remove unused `addr` parameter from bt_mmap
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 2 Nov 2023 19:26:00 +0000 (19:26 +0000)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 3 Nov 2023 18:56:03 +0000 (14:56 -0400)
Change-Id: Iecf7764f5fd669369064aa3b3fafe2575d933f28
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11204
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/common/mmap-align.h
src/compat/mman.c
src/compat/mman.h
src/plugins/ctf/fs-src/data-stream-file.cpp

index 7c16493530eef9043d82ac1744141b7eba0ad085..4d81b25714283a1959fecd41bb3524f2043c14ef 100644 (file)
@@ -58,7 +58,7 @@ struct mmap_align_data *mmap_align(size_t length, int prot,
         * boundary.
         */
        mma->page_aligned_length = BT_ALIGN(length + offset - page_aligned_offset, page_size);
-       mma->page_aligned_addr = bt_mmap(NULL, mma->page_aligned_length,
+       mma->page_aligned_addr = bt_mmap(mma->page_aligned_length,
                prot, flags, fd, page_aligned_offset, log_level);
        if (mma->page_aligned_addr == MAP_FAILED) {
                free(mma);
index 1cc1c44c8380f571284cc6e3948b1c8f72fce2e2..79ff759901bebb5240676ee3db8486e9c4406b4f 100644 (file)
@@ -152,8 +152,8 @@ DWORD map_prot_flags(int prot, DWORD *dwDesiredAccess)
        return 0;
 }
 
-void *bt_mmap(void *addr __attribute__((unused)), size_t length, int prot,
-               int flags, int fd, off_t offset, int log_level)
+void *bt_mmap(size_t length, int prot, int flags, int fd, off_t offset,
+               int log_level)
 {
        struct mmap_mapping *mapping = NULL;
        void *mapping_addr;
index 5aaab7602f2c4d111e8ad4bfca41ade7cfe9593c..33febccbb1c1e760c601a821ed6d3522e9e2bebe 100644 (file)
@@ -30,7 +30,7 @@
  * Note that some platforms (e.g. Windows) do not allow read-only
  * mappings to exceed the file's size (even within a page).
  */
-BT_EXTERN_C void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
+BT_EXTERN_C void *bt_mmap(size_t length, int prot, int flags, int fd,
        off_t offset, int log_level);
 
 BT_EXTERN_C int bt_munmap(void *addr, size_t length);
@@ -47,10 +47,10 @@ BT_EXTERN_C size_t bt_mmap_get_offset_align_size(int log_level);
 #include "common/common.h"
 
 static inline
-void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
+void *bt_mmap(size_t length, int prot, int flags, int fd,
        off_t offset, int log_level __attribute__((unused)))
 {
-       return (void *) mmap(addr, length, prot, flags, fd, offset);
+       return (void *) mmap(NULL, length, prot, flags, fd, offset);
 }
 
 static inline
index 1a49d87889c1c76ec0efc330fbe7680fb94d1280..482383b1c7819d91fd57a02f84c1c311fb0249d4 100644 (file)
@@ -125,7 +125,7 @@ static enum ctf_msg_iter_medium_status ds_file_mmap(struct ctf_fs_ds_file *ds_fi
     BT_ASSERT(ds_file->mmap_len > 0);
 
     ds_file->mmap_addr =
-        bt_mmap((void *) 0, ds_file->mmap_len, PROT_READ, MAP_PRIVATE, fileno(ds_file->file->fp),
+        bt_mmap(ds_file->mmap_len, PROT_READ, MAP_PRIVATE, fileno(ds_file->file->fp),
                 ds_file->mmap_offset_in_file, ds_file->log_level);
     if (ds_file->mmap_addr == MAP_FAILED) {
         BT_COMP_LOGE("Cannot memory-map address (size %zu) of file \"%s\" (%p) at offset %jd: %s",
This page took 0.026126 seconds and 4 git commands to generate.