staging: rtl*/security: Use static const in array declarations
authorJoe Perches <joe@perches.com>
Wed, 15 Jul 2020 17:29:37 +0000 (10:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jul 2020 10:08:44 +0000 (12:08 +0200)
Use static const in declarations where appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Link: https://lore.kernel.org/r/818bbd25924f0c733a4a39d426fd30392d4eae80.camel@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_security.c
drivers/staging/rtl8712/rtl871x_security.c
drivers/staging/rtl8723bs/core/rtw_security.c

index f9139f72b3a786d5b9c0c1d2578580be79767c52..3483c3d9cb56c7f5e5ec0c3816d86a1c72f8229f 100644 (file)
@@ -734,7 +734,7 @@ exit:
 /******** SBOX Table *********/
 /*****************************/
 
-static  u8 sbox_table[256] = {
+static const u8 sbox_table[256] = {
        0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
        0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
        0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
@@ -817,7 +817,7 @@ static void next_key(u8 *key, int round)
 {
        u8 rcon;
        u8 sbox_key[4];
-       u8 rcon_table[12] = {
+       static const u8 rcon_table[12] = {
                0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
                0x1b, 0x36, 0x36, 0x36
        };
index 73e3d5ef3af27e2d4d9927f6416911c2494dea79..c05010d85212c003fde15626f8d8c73553e57d06 100644 (file)
@@ -762,7 +762,7 @@ static void next_key(u8 *key, sint round)
 {
        u8 rcon;
        u8 sbox_key[4];
-       u8 rcon_table[12] = {
+       static const u8 rcon_table[12] = {
                0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
                0x1b, 0x36, 0x36, 0x36
        };
index 0f95009a30b6ffcb933920d3867e88994e005530..0f15c96183a0ce73c91269e3c802bb986a674847 100644 (file)
@@ -10,7 +10,7 @@
 #include <drv_types.h>
 #include <rtw_debug.h>
 
-static const char *_security_type_str[] = {
+static const char * const _security_type_str[] = {
        "N/A",
        "WEP40",
        "TKIP",
@@ -842,7 +842,7 @@ exit:
 /******** SBOX Table *********/
 /*****************************/
 
-       static  u8 sbox_table[256] = {
+       static const u8 sbox_table[256] = {
                        0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
                        0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
                        0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
@@ -957,7 +957,7 @@ static void next_key(u8 *key, sint round)
 {
                u8 rcon;
                u8 sbox_key[4];
-               u8 rcon_table[12] = {
+               static const u8 rcon_table[12] = {
                        0x01, 0x02, 0x04, 0x08,
                        0x10, 0x20, 0x40, 0x80,
                        0x1b, 0x36, 0x36, 0x36