]> mj.ucw.cz Git - pciutils.git/commitdiff
intel_cleanup_io() no longer returns a value
authorMartin Mares <mj@ucw.cz>
Sun, 26 Dec 2021 22:02:47 +0000 (23:02 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 26 Dec 2021 22:02:47 +0000 (23:02 +0100)
The value was quite misleading, as witnessed by multiple implementations
doing it wrong. In fact, the only return value which ever made sense was -1.

lib/i386-io-beos.h
lib/i386-io-cygwin.h
lib/i386-io-djgpp.h
lib/i386-io-haiku.h
lib/i386-io-hurd.h
lib/i386-io-linux.h
lib/i386-io-sunos.h
lib/i386-io-windows.h
lib/i386-ports.c

index a0ee6c9444238f5459c93a74b84c727c9fd8513f..15f391b35e21b7d7b9dab6136d4908d7cff3e55d 100644 (file)
@@ -16,10 +16,9 @@ intel_setup_io(struct pci_access *a UNUSED)
   return 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  return 1;
 }
 
 static inline u8
index 16022482f268f89c7f597a83b676592324987b38..a8501ccdcff0366bd60cab4218ae48b8c9368067 100644 (file)
@@ -14,11 +14,10 @@ intel_setup_io(struct pci_access *a UNUSED)
   return (iopl(3) < 0) ? 0 : 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  iopl(3);
-  return -1;
+  iopl(0);
 }
 
 static inline void intel_io_lock(void)
index 41885dbfaccf5aa793b3b60cd10069d0fa3caa26..53f2f4e9bdc0a9760c0af400dbc02e08fc3aff99 100644 (file)
@@ -24,10 +24,9 @@ intel_setup_io(struct pci_access *a UNUSED)
   return 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  return 1;
 }
 
 static inline void intel_io_lock(void)
index 2bbe592672abaa8471c123a7c3ff026b4994f186..dd0094162a24005d93523f09616bd134a6472f92 100644 (file)
@@ -68,11 +68,10 @@ intel_setup_io(struct pci_access *a UNUSED)
   return (poke_driver_fd < 0) ? 0 : 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
   close(poke_driver_fd);
-  return 1;
 }
 
 static inline u8
index d6df9099a8b73bc4cd121754982e9d533acdcd76..000fd4204ac669fa681034798b96922bde7328ef 100644 (file)
@@ -18,12 +18,10 @@ intel_setup_io(struct pci_access *a UNUSED)
   return (ioperm (0, 65535, 1) == -1) ? 0 : 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
   ioperm (0, 65535, 0);
-
-  return -1;
 }
 
 static inline void intel_io_lock(void)
index b39b4eb8267d0585ab7bcdede85e7a9137812932..731e8e3b93872013d26fcaf3acf13669d1b0e7b1 100644 (file)
@@ -14,11 +14,10 @@ intel_setup_io(struct pci_access *a UNUSED)
   return (iopl(3) < 0) ? 0 : 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  iopl(3);
-  return -1;
+  iopl(0);
 }
 
 static inline void intel_io_lock(void)
index 6221d1360e9140f407cd9bcc5b968e9862a79ff4..903ad7c6a3be88ccfd206f5b81f254af64998c24 100644 (file)
@@ -16,11 +16,10 @@ intel_setup_io(struct pci_access *a UNUSED)
   return (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) ? 0 : 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
   /* FIXME: How to switch off I/O port access? */
-  return 1;
 }
 
 static inline u8
index ca8b3bb5b901263dfbfcad4b746f9de39f6dc852..772c6f26f791af151e1a50edfcffd5ed59f83596 100644 (file)
@@ -1290,7 +1290,7 @@ intel_setup_io(struct pci_access *a)
   return 1;
 }
 
-static inline int
+static inline void
 intel_cleanup_io(struct pci_access *a UNUSED)
 {
   /*
@@ -1298,7 +1298,6 @@ intel_cleanup_io(struct pci_access *a UNUSED)
    * systems ProcessUserModeIOPL permanently changes IOPL to 3 for the current
    * NT process, no revert for current process is possible.
    */
-  return 1;
 }
 
 static inline void intel_io_lock(void)
index b3b752cb1f3f7181295100dc64e17bef99344b2b..8b7ceb7f71c76f493606d256f4e4f6eca5e4ee15 100644 (file)
@@ -53,7 +53,10 @@ static void
 conf12_cleanup(struct pci_access *a UNUSED)
 {
   if (conf12_io_enabled > 0)
-    conf12_io_enabled = intel_cleanup_io(a);
+    {
+      intel_cleanup_io(a);
+      conf12_io_enabled = -1;
+    }
 }
 
 /*