]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2-util: make one sd_json_dispatch_field[] table static const
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Jun 2024 15:50:55 +0000 (17:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 14 Jun 2024 11:22:47 +0000 (13:22 +0200)
src/shared/tpm2-util.c

index 421bb051f12c5e2f4be1be8365c33e315fcbcca8..df38d8b2462c24226eee0ddef33a5284871905af 100644 (file)
@@ -6991,7 +6991,7 @@ int tpm2_pcrlock_policy_from_json(
         /* We use a type check of _JSON_VARIANT_TYPE_INVALID for the integer fields to allow
          * json_dispatch_uint32() to parse strings as integers to work around the integer type weakness of
          * JSON's design. */
-        sd_json_dispatch_field policy_dispatch[] = {
+        static const sd_json_dispatch_field policy_dispatch[] = {
                 { "pcrBank",    SD_JSON_VARIANT_STRING,        json_dispatch_tpm2_algorithm, offsetof(Tpm2PCRLockPolicy, algorithm),       SD_JSON_MANDATORY },
                 { "pcrValues",  SD_JSON_VARIANT_ARRAY,         sd_json_dispatch_variant,     offsetof(Tpm2PCRLockPolicy, prediction_json), SD_JSON_MANDATORY },
                 { "nvIndex",    _SD_JSON_VARIANT_TYPE_INVALID, sd_json_dispatch_uint32,      offsetof(Tpm2PCRLockPolicy, nv_index),        SD_JSON_MANDATORY },