gpu: ipu-v3: make const arrays int_reg static, shrinks object size
Subsystems (3)
PATCH 1/1 gpu: ipu-v3: make const arrays int_reg static, shrinks object size
From: Colin Ian King <[email protected]>
Don't populate the const read-only arrays int_reg on the stack but instead make them static. Makes the object code smaller by over 80 bytes:
Before:
text data bss dec hex filename 28024 8936 192 37152 9120 drivers/gpu/ipu-v3/ipu-common.o
After:
text data bss dec hex filename 27794 9080 192 37066 90ca drivers/gpu/ipu-v3/ipu-common.o
(gcc version 7.2.0 x86_64)
Signed-off-by Colin Ian King <[email protected]>
--- drivers/gpu/ipu-v3/ipu-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/ipu-v3/ipu-common.c +2 -2
@@ -1089,7 +1089,7 @@ static void ipu_irq_handler(struct irq_desc *desc) {struct ipu_soc *ipu =irq_desc_get_handler_data (desc);struct irq_chip *chip =irq_desc_get_chip (desc); -const int int_reg[] = {0 ,1 ,2 ,3 ,10 ,11 ,12 ,13 ,14 }; +static const int int_reg[] = {0 ,1 ,2 ,3 ,10 ,11 ,12 ,13 ,14 };chained_irq_enter (chip, desc);
@@ -1102,7 +1102,7 @@ static void ipu_err_irq_handler(struct irq_desc *desc) {struct ipu_soc *ipu =irq_desc_get_handler_data (desc);struct irq_chip *chip =irq_desc_get_chip (desc); -const int int_reg[] = {4 ,5 ,8 ,9 }; +static const int int_reg[] = {4 ,5 ,8 ,9 };chained_irq_enter (chip, desc);
Signature · 1 line
2.15.1
Hi Colin,
Quoted 34 lines · Colin King
From: Colin Ian King <[email protected]>
Don't populate the const read-only arrays
int_regon the stack but instead make them static. Makes the object code smaller by over 80 bytes:Before:
text data bss dec hex filename 28024 8936 192 37152 9120 drivers/gpu/ipu-v3/ipu-common.oAfter:
text data bss dec hex filename 27794 9080 192 37066 90ca drivers/gpu/ipu-v3/ipu-common.o(gcc version 7.2.0
x86_64)Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/ipu-v3/ipu-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/ipu-v3/ipu-common.c +1
-1@@ -1089,7 +1089,7 @@ static void ipu_irq_handler(struct irq_desc *desc) {struct ipu_soc *ipu =irq_desc_get_handler_data (desc);struct irq_chip *chip =irq_desc_get_chip (desc); -const int int_reg[] = {0 ,1 ,2 ,3 ,10 ,11 ,12 ,13 ,14 }; +static const int int_reg[] = {0 ,1 ,2 ,3 ,10 ,11 ,12 ,13 ,14 };chained_irq_enter (chip, desc);
drivers/gpu/ipu-v3/ipu-common.c static void ipu_err_irq_handler(struct irq_desc *desc) · line 1107
Quoted 7 lines
drivers/gpu/ipu-v3/ipu-common.c +1
-1@@ -1102,7 +1102,7 @@ static void ipu_err_irq_handler(struct irq_desc *desc) {struct ipu_soc *ipu =irq_desc_get_handler_data (desc);struct irq_chip *chip =irq_desc_get_chip (desc); -const int int_reg[] = {4 ,5 ,8 ,9 }; +static const int int_reg[] = {4 ,5 ,8 ,9 };chained_irq_enter (chip, desc);
Applied to imx-drm/next, thank you.
regards
Philipp