]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chid: don't hardcode magic numbers for non-official CHIDs
authorTobias Heider <tobias.heider@canonical.com>
Sun, 10 Aug 2025 14:27:46 +0000 (16:27 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Aug 2025 09:18:53 +0000 (11:18 +0200)
They are constructed from EXTRA_CHID_BASE + offset

src/boot/chid.c

index 74be7d594f31d46c58b47c15aff7df789e136ec2..28f2b7b8984354ab8c4c83684c7d1d3a542cc7af 100644 (file)
@@ -105,7 +105,8 @@ EFI_STATUS chid_match(const void *hwid_buffer, size_t hwid_length, uint32_t matc
         const Device *devices = ASSERT_PTR(hwid_buffer);
 
         EFI_GUID chids[CHID_TYPES_MAX] = {};
-        static const size_t priority[] = { 17, 16, 15, 3, 6, 8, 10, 4, 5, 7, 9, 11 }; /* From most to least specific. */
+        static const size_t priority[] = { EXTRA_CHID_BASE + 2, EXTRA_CHID_BASE + 1, EXTRA_CHID_BASE + 0,
+                                           3, 6, 8, 10, 4, 5, 7, 9, 11 }; /* From most to least specific. */
 
         status = populate_board_chids(chids);
         if (EFI_STATUS_IS_ERROR(status))