@@ -94,7 +94,7 @@ ocxl_err global_mmio_open(ocxl_afu *afu)
9494{
9595 char path [PATH_MAX + 1 ];
9696 int length = snprintf (path , sizeof (path ), "%s/global_mmio_area" , afu -> sysfs_path );
97- if (length >= sizeof (path )) {
97+ if (length >= ( int ) sizeof (path )) {
9898 ocxl_err rc = OCXL_NO_DEV ;
9999 errmsg (afu , rc , "global MMIO path truncated" );
100100 return rc ;
@@ -211,7 +211,7 @@ static ocxl_err mmio_map(ocxl_afu *afu, size_t size, int prot, uint64_t flags, o
211211 return rc ;
212212 }
213213
214- void * addr = mmap (NULL , afu -> per_pasid_mmio .length , prot , MAP_SHARED , afu -> fd , 0 );
214+ void * addr = mmap (NULL , afu -> per_pasid_mmio .length , prot , MAP_SHARED , afu -> fd , offset );
215215 if (addr == MAP_FAILED ) {
216216 ocxl_err rc = OCXL_NO_MEM ;
217217 errmsg (afu , rc , "Could not map per-PASID MMIO: %d: %s" , errno , strerror (errno ));
@@ -427,7 +427,7 @@ inline static ocxl_err mmio_check(ocxl_mmio_h region, off_t offset, size_t size)
427427 return rc ;
428428 }
429429
430- if (offset >= mmio -> length - (size - 1 )) {
430+ if (offset >= ( off_t )( mmio -> length - (size - 1 ) )) {
431431 ocxl_err rc = OCXL_OUT_OF_BOUNDS ;
432432 errmsg (mmio -> afu , rc , "%s MMIO access of 0x%016lx exceeds limit of 0x%016lx" ,
433433 mmio -> type == OCXL_GLOBAL_MMIO ? "Global" : "Per-PASID" ,
0 commit comments