]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names-hash.c
update-pciids: Re-compress pci.ids if needed
[pciutils.git] / lib / names-hash.c
index d0748c7b9e16550b2a5b345f933d4fe0b5e2d079..8c7567604acb8595b05e0e7b42f3a514a458e098 100644 (file)
@@ -3,7 +3,9 @@
  *
  *     Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
  *
  *
  *     Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
  *
- *     Can be freely distributed and used under the terms of the GNU GPL.
+ *     Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ *     SPDX-License-Identifier: GPL-2.0-or-later
  */
 
 #include <string.h>
  */
 
 #include <string.h>
@@ -103,6 +105,8 @@ char
            continue;
          if (n->src == SRC_CACHE && !(flags & PCI_LOOKUP_CACHE))
            continue;
            continue;
          if (n->src == SRC_CACHE && !(flags & PCI_LOOKUP_CACHE))
            continue;
+         if (n->src == SRC_HWDB && (flags & (PCI_LOOKUP_SKIP_LOCAL | PCI_LOOKUP_NO_HWDB)))
+           continue;
          if (!best || best->src < n->src)
            best = n;
        }
          if (!best || best->src < n->src)
            best = n;
        }
@@ -112,12 +116,11 @@ char
   return NULL;
 }
 
   return NULL;
 }
 
-static void
+void
 pci_id_hash_free(struct pci_access *a)
 {
   pci_mfree(a->id_hash);
   a->id_hash = NULL;
 pci_id_hash_free(struct pci_access *a)
 {
   pci_mfree(a->id_hash);
   a->id_hash = NULL;
-  a->id_cache_status = 0;
   while (a->current_id_bucket)
     {
       struct id_bucket *buck = a->current_id_bucket;
   while (a->current_id_bucket)
     {
       struct id_bucket *buck = a->current_id_bucket;
@@ -125,10 +128,3 @@ pci_id_hash_free(struct pci_access *a)
       pci_mfree(buck);
     }
 }
       pci_mfree(buck);
     }
 }
-
-void
-pci_free_name_list(struct pci_access *a)
-{
-  pci_id_cache_flush(a);
-  pci_id_hash_free(a);
-}