While polishing rumpdisk I made these trivial patches which may be useful.

Damien
>From 364be01ee8120f795c588c30f92557a9c3f97578 Mon Sep 17 00:00:00 2001
From: Damien Zammit <dam...@zamaudio.com>
Date: Fri, 10 Apr 2020 22:17:31 +1000
Subject: [PATCH 1/2] pci-ops.c: Use compatible pointers

---
 pci-arbiter/pci-ops.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pci-arbiter/pci-ops.c b/pci-arbiter/pci-ops.c
index 19aee71d..3346e55a 100644
--- a/pci-arbiter/pci-ops.c
+++ b/pci-arbiter/pci-ops.c
@@ -85,7 +85,7 @@ S_pci_conf_read (struct protid * master, int reg, char **data,
   error_t err;
   pthread_mutex_t *lock;
   struct pcifs_dirent *e;
-  size_t actual_len;
+  pciaddr_t actual_len;
 
   if (!master)
     return EOPNOTSUPP;
@@ -118,7 +118,7 @@ S_pci_conf_read (struct protid * master, int reg, char **data,
 
   if (!err)
     {
-      *datalen = actual_len;
+      *datalen = (size_t)actual_len;
       /* Update atime */
       UPDATE_TIMES (e, TOUCH_ATIME);
     }
@@ -134,7 +134,7 @@ S_pci_conf_write (struct protid * master, int reg, char *data, size_t datalen,
   error_t err;
   pthread_mutex_t *lock;
   struct pcifs_dirent *e;
-  size_t actual_len;
+  pciaddr_t actual_len;
 
   if (!master)
     return EOPNOTSUPP;
@@ -156,7 +156,7 @@ S_pci_conf_write (struct protid * master, int reg, char *data, size_t datalen,
 
   if (!err)
     {
-      *amount = actual_len;
+      *amount = (size_t)actual_len;
       /* Update mtime and ctime */
       UPDATE_TIMES (e, TOUCH_MTIME | TOUCH_CTIME);
     }
-- 
2.25.1

>From 6faa5510874ce0f9f920a55c2f3a8184c2c710c8 Mon Sep 17 00:00:00 2001
From: Damien Zammit <dam...@zamaudio.com>
Date: Sat, 11 Apr 2020 12:25:03 +1000
Subject: [PATCH 2/2] pci-arbiter: Remove done TODO item

---
 pci-arbiter/TODO | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pci-arbiter/TODO b/pci-arbiter/TODO
index 20060842..30ae66d0 100644
--- a/pci-arbiter/TODO
+++ b/pci-arbiter/TODO
@@ -9,6 +9,4 @@
   Update len with remaining allowed size once op() returns EIO
   so that we get short reads/writes implemented by leaving it to pciaccess
 
-- Upstream hurdish access method + x86 fixes to libpciaccess
-
   BTW we could also support libpci.
-- 
2.25.1

Reply via email to