module/*.ko: prune .data, global .rodata

Evaluated every variable that lives in .data (and globals in .rodata)
in the kernel modules, and constified/eliminated/localised them
appropriately. This means that all read-only data is now actually
read-only data, and, if possible, at file scope. A lot of previously-
global-symbols became inlinable (and inlined!) constants. Probably
not in a big Wowee Performance Moment, but hey.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12899
This commit is contained in:
наб
2022-01-15 00:37:55 +01:00
committed by GitHub
parent 7adc190098
commit 18168da727
147 changed files with 781 additions and 876 deletions
+3 -3
View File
@@ -200,7 +200,7 @@ typedef enum {
#define I_ U8_ILLEGAL_CHAR
#define O_ U8_OUT_OF_RANGE_CHAR
const int8_t u8_number_of_bytes[0x100] = {
static const int8_t u8_number_of_bytes[0x100] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -238,7 +238,7 @@ const int8_t u8_number_of_bytes[0x100] = {
#undef I_
#undef O_
const uint8_t u8_valid_min_2nd_byte[0x100] = {
static const uint8_t u8_valid_min_2nd_byte[0x100] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -280,7 +280,7 @@ const uint8_t u8_valid_min_2nd_byte[0x100] = {
0, 0, 0, 0, 0, 0, 0, 0,
};
const uint8_t u8_valid_max_2nd_byte[0x100] = {
static const uint8_t u8_valid_max_2nd_byte[0x100] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
-4
View File
@@ -139,11 +139,7 @@ static const uchar_t remaining_bytes_tbl[0x100] = {
* the first byte of a UTF-8 character. Index is remaining bytes at above of
* the character.
*/
#ifdef _KERNEL
const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
#else
static const uchar_t u8_masks_tbl[6] = { 0x00, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
#endif /* _KERNEL */
/*
* The following two vectors are to provide valid minimum and