treewide: add const to static arrays
authorRosen Penev <[email protected]>
Sun, 31 Aug 2025 21:01:55 +0000 (14:01 -0700)
committerHauke Mehrtens <[email protected]>
Tue, 2 Dec 2025 22:32:42 +0000 (23:32 +0100)
Allows more compiler optimization.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19932
Signed-off-by: Hauke Mehrtens <[email protected]>
16 files changed:
package/kernel/button-hotplug/src/button-hotplug.c
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_amazon_se.h
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9.h
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_ar9_retx.h
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube.h
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_danube_retx.h
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_fw_vr9.h
package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c
package/kernel/lantiq/ltq-deu/src/ifxmips_tcrypt.h
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_amazon_se.h
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_ar9.h
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_danube.h
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_fw_vr9.h
target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch

index 1b77cd7922aeb3e3578253167f633b53870ac0fd..2819d29b94182531de0fa4d506c74a4df2251a6e 100644 (file)
@@ -72,7 +72,7 @@ extern u64 uevent_next_seqnum(void);
                .name = (_name),        \
        }
 
-static struct bh_map button_map[] = {
+static const struct bh_map button_map[] = {
        BH_MAP(BTN_0,           "BTN_0"),
        BH_MAP(BTN_1,           "BTN_1"),
        BH_MAP(BTN_2,           "BTN_2"),
index 0c16f34b0d728995ba3a31f7053fe6788e3f4174..5b40e34950cc356195525c980c8165ac3633cab1 100644 (file)
@@ -72,7 +72,7 @@ extern u64 uevent_next_seqnum(void);
                .name = (_name),        \
        }
 
-static struct bh_map button_map[] = {
+static const struct bh_map button_map[] = {
        BH_MAP(BTN_0,                   "BTN_0"),
        BH_MAP(BTN_1,                   "BTN_1"),
        BH_MAP(BTN_2,                   "BTN_2"),
index b0a9c91bc4d7fb63370424aa683c0476423eb006..0ce80945f5106256adada270a13c4403c9be1443 100644 (file)
@@ -34,7 +34,7 @@
 #define ATM_FW_VER_MINOR        16
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
  0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80004cc8, 0xc2000000, 0xda0800f9, 0x80004330,
@@ -450,7 +450,7 @@ static unsigned int firmware_binary_code[] = {
  0x9d000000, 0xcd4000f8, 0x00000000, 0x00000000, 0x9d000000, 0x4158a000, 0xcd4000f8, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 5ee6d23bb1a5579e7873338702835cfed951820f..d0164df7a8aad40f91ab6902c004eb7c823d1549 100644 (file)
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        16
 
 
-static unsigned int ar9_fw_bin[] = {
+static const unsigned int ar9_fw_bin[] = {
  0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80004980, 0xc2000000, 0xda0800f9, 0x80003fe8,
@@ -432,7 +432,7 @@ static unsigned int ar9_fw_bin[] = {
  0xcd4000f8, 0x00000000,
 };
 
-static unsigned int ar9_fw_data[] = {
+static const unsigned int ar9_fw_data[] = {
 };
 
 
index 51e4f9c6c9af7fb3f23691665feb2b6aec26d5ec..3cc62e696d89d44825c86e63cd4b09325453da37 100644 (file)
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        15
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004B8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFE0, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C00F8, 0xC2000002, 0xDA0800F9, 0xC0001B50, 0x8C100000, 0x00000000, 0x00000000,
@@ -604,7 +604,7 @@ static unsigned int firmware_binary_code[] = {
     0xCDC000F8, 0xC1C00000, 0xC0004734, 0x9CC00000, 0xCDC000F8, 0xC0004732, 0xCD8000F8,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 57b7586bd073aa6b4c6410058944c4cb24a46f04..60de8d1d70007e271c91bb14ddb09ad5d8692738 100644 (file)
@@ -35,7 +35,7 @@
 //  add multiple queue per PVC feature
 
 
-static unsigned int danube_fw_bin[] = {
+static const unsigned int danube_fw_bin[] = {
     0x800004A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFC8, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C0000, 0xC2000002, 0xDA080001, 0x80004968, 0xC2000000, 0xDA080001, 0x80003FD0,
@@ -435,7 +435,7 @@ static unsigned int danube_fw_bin[] = {
     0xCD400000, 0x00000000,
 };
 
-static unsigned int danube_fw_data[] = {
+static const unsigned int danube_fw_data[] = {
 };
 
 
index 1c915dbba114bfe4852ffd5198aaae87c008b1e6..bf31753ed38ae9ec025a8825344f9f960f240def 100644 (file)
@@ -33,7 +33,7 @@
 #define ATM_FW_VER_MINOR        15
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFC8, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C0000, 0xC2000002, 0xDA080001, 0xC0001B50, 0x8C100000, 0x00000000, 0x00000000,
@@ -605,7 +605,7 @@ static unsigned int firmware_binary_code[] = {
     0xCDC00000, 0xC1C00000, 0xC0004734, 0x9CC00000, 0xCDC00000, 0xC0004732, 0xCD800000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 42a26ec539ac28f15a75825ded3d710d77d89724..8b73c0714746ba2af98734992f9bfbd0392d97fb 100644 (file)
@@ -32,7 +32,7 @@
 #define ATM_FW_VER_MINOR        24
 
 
-static u32 vr9_fw_bin[] = {
+static const u32 vr9_fw_bin[] = {
     0x800004B8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000FFE0, 0x00000000, 0x00000000, 0x00000000,
     0xC1000002, 0xD90C00F8, 0xC2000002, 0xDA0800F9, 0x80004390, 0xC2000000, 0xDA0800F9, 0x80003A10,
@@ -419,7 +419,7 @@ static u32 vr9_fw_bin[] = {
     0xCE0000F8, 0xC000697E, 0xCE4000F8, 0x9D000000, 0x4158A000, 0xCD4000F8, 0x00000000,
 };
 
-static u32 vr9_fw_data[] = {
+static const u32 vr9_fw_data[] = {
 };
 
 
index cdf9a89a1a58ba91b45cec8a6cb4b2ac8b49d126..09354b9fddb26a38a514b725d9f225932520f3cd 100644 (file)
@@ -956,7 +956,7 @@ struct lq_aes_alg {
 };
 
 /* AES supported algo array */
-static struct lq_aes_alg aes_drivers_alg[] = {
+static const struct lq_aes_alg aes_drivers_alg[] = {
      {
          .alg = {
            .cra_name       = "aes",
index e96379f1d4c14d56d9decc2b0e6cae82c13eb6d2..3eb9f8699732b0f9dc67b341c43462e5edf55437 100644 (file)
@@ -754,7 +754,7 @@ struct lq_des_alg {
 };
 
 /* DES Supported algo array */
-static struct lq_des_alg des_drivers_alg [] = {
+static const struct lq_des_alg des_drivers_alg [] = {
     {
         .alg = {
             .cra_name        = "des",
index 1e7047b593299ae0b2e3c365dc8f30b194ae98be..5c301bdd46e34afce813740c9579aee9df830dc0 100644 (file)
@@ -38,7 +38,7 @@ static int alg_speed_test(const char *alg, const char *driver,
                          struct cipher_speed_template *t,
                          unsigned int tcount, u8 *keysize);
 
-static struct cipher_speed_template des3_speed_template[] = {
+static const struct cipher_speed_template des3_speed_template[] = {
        {
                .key    = "\x01\x23\x45\x67\x89\xab\xcd\xef"
                          "\x55\x55\x55\x55\x55\x55\x55\x55"
@@ -50,18 +50,18 @@ static struct cipher_speed_template des3_speed_template[] = {
 /*
  * Cipher speed tests
  */
-static u8 speed_template_8[] = {8, 0};
-static u8 speed_template_24[] = {24, 0};
-static u8 speed_template_8_32[] = {8, 32, 0};
-static u8 speed_template_16_32[] = {16, 32, 0};
-static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
-static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
-static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
+static const u8 speed_template_8[] = {8, 0};
+static const u8 speed_template_24[] = {24, 0};
+static const u8 speed_template_8_32[] = {8, 32, 0};
+static const u8 speed_template_16_32[] = {16, 32, 0};
+static const u8 speed_template_16_24_32[] = {16, 24, 32, 0};
+static const u8 speed_template_32_40_48[] = {32, 40, 48, 0};
+static const u8 speed_template_32_48_64[] = {32, 48, 64, 0};
 
 /*
  * Digest speed tests
  */
-static struct hash_speed generic_hash_speed_template[] = {
+static const struct hash_speed generic_hash_speed_template[] = {
        { .blen = 16,   .plen = 16, },
        { .blen = 64,   .plen = 16, },
        { .blen = 64,   .plen = 64, },
index ae33bcc66a3bf524cef3fbd901da3a0e4ac4e5d0..663a8b7af6744a560d4a69d3cd6978aae2ab384d 100644 (file)
@@ -32,7 +32,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x800055e0, 0xc2000000, 0xda0800f9, 0x80005580,
@@ -486,7 +486,7 @@ static unsigned int firmware_binary_code[] = {
     0xcd4000f8, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index a61d313852cac6b3cd6fd6150c883f53a036aaeb..bb370e1558b03f70e46365fbdcd9fcbd97924c02 100644 (file)
@@ -30,7 +30,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c00f8, 0xc2000002, 0xda0800f9, 0x80005270, 0xc2000000, 0xda0800f9, 0x80005210,
@@ -466,7 +466,7 @@ static unsigned int firmware_binary_code[] = {
     0x4194a000, 0x5d940040, 0x88000012, 0xc59400f8, 0x9d000000, 0xcd4000f8, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 3451682fb2b12e7dcec57afc026addf878a72c18..4484eb2667a858679310ed6e4a9f1c5db724ad97 100644 (file)
@@ -31,7 +31,7 @@
 #define PTM_FW_VER_MINOR        17
 
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
     0x800004a0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffc8, 0x00000000, 0x00000000, 0x00000000,
     0xc1000002, 0xd90c0000, 0xc2000002, 0xda080001, 0x80005618, 0xc2000000, 0xda080001, 0x800055b8,
@@ -482,7 +482,7 @@ static unsigned int firmware_binary_code[] = {
     0x4194a000, 0x5d940040, 0x8800fffa, 0xc5940000, 0x9d000000, 0xcd400000, 0x00000000, 0x00000000,
 };
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 3aa9f1851f01da34f8575301c18e0db8f96651f0..599d5099c7f724c8b2dad19223e7fdddb322b5a7 100644 (file)
@@ -28,7 +28,7 @@
 ** 01/08/2014    Lantiq PPE FW Team        VR9 E1 PPE Firmware Binary
 *******************************************************************************/
 
-static unsigned int firmware_binary_code[] = {
+static const unsigned int firmware_binary_code[] = {
  0x80000980, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8000ffe0, 0x00000000, 0x00000000, 0x00000000,
  0x94000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -471,7 +471,7 @@ static unsigned int firmware_binary_code[] = {
  0x84009b42, 0x6f9d0010, 0x739da000, 0x6f9e0010, 0x735da000, 0x6f9f0010, 0x735da000, 0xc1c0001e,
  0x775da000, 0xc000e440, 0xcf4000f8, 0x80009ae8, 0x00000000, 0x00000000, 0x00000000,};
 
-static unsigned int firmware_binary_data[] = {
+static const unsigned int firmware_binary_data[] = {
 };
 
 
index 6f99497c36daa62971e4d0e455be4cc6339716f2..e697a64066b9edde44fb4ff8d02c85651d0a40ed 100644 (file)
@@ -820,7 +820,7 @@ Cc: Robert Marko <[email protected]>
 +static IEI_WT61P803_PUZZLE_ATTR_RW(power_loss_recovery, IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY, 0);
 +static IEI_WT61P803_PUZZLE_ATTR_RO(power_status, IEI_WT61P803_PUZZLE_POWER_STATUS, 0);
 +
-+static struct attribute *iei_wt61p803_puzzle_attrs[] = {
++static const struct attribute *iei_wt61p803_puzzle_attrs[] = {
 +      &dev_attr_version.dev_attr.attr,
 +      &dev_attr_build_info.dev_attr.attr,
 +      &dev_attr_bootloader_mode.dev_attr.attr,