Skip to content

Commit

Permalink
serial: 8250: 8250_omap: make a const array static, makes object smaller
Browse files Browse the repository at this point in the history
Don't populate the const array k3_soc_devices on the stack but instead it
static. Makes the object code smaller by 44 bytes:

Before:
   text    data     bss     dec     hex filename
  31628    5609     128   37365    91f5 drivers/tty/serial/8250/8250_omap.o

After:
   text    data     bss     dec     hex filename
  31520    5673     128   37321    91c9 drivers/tty/serial/8250/8250_omap.o
Reduction of 44 bytes

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210715140759.27244-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Colin Ian King authored and Greg Kroah-Hartman committed Jul 21, 2021
1 parent 2734d6c commit cb3ea80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/8250/8250_omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ static void omap_8250_pm(struct uart_port *port, unsigned int state,
static void omap_serial_fill_features_erratas(struct uart_8250_port *up,
struct omap8250_priv *priv)
{
const struct soc_device_attribute k3_soc_devices[] = {
static const struct soc_device_attribute k3_soc_devices[] = {
{ .family = "AM65X", },
{ .family = "J721E", .revision = "SR1.0" },
{ /* sentinel */ }
Expand Down

0 comments on commit cb3ea80

Please sign in to comment.