Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbdILLpv (ORCPT ); Tue, 12 Sep 2017 07:45:51 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40474 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdILLpt (ORCPT ); Tue, 12 Sep 2017 07:45:49 -0400 From: Colin King To: Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] backlight: s6e63m0: make const arrays static, reduces object code size Date: Tue, 12 Sep 2017 12:45:45 +0100 Message-Id: <20170912114545.2131-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1391 Lines: 42 From: Colin Ian King Don't populate const arrays on the stack, instead make them static. Makes the object code smaller by nearly 400 bytes: Before: text data bss dec hex filename 15164 6336 0 21500 53fc drivers/video/backlight/s6e63m0.o After: text data bss dec hex filename 14669 6432 0 21101 526d drivers/video/backlight/s6e63m0.o Signed-off-by: Colin Ian King --- drivers/video/backlight/s6e63m0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 3c4a22a3063a..965c660b2f6b 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -446,7 +446,7 @@ static int s6e63m0_gamma_ctl(struct s6e63m0 *lcd, int gamma) static int s6e63m0_ldi_init(struct s6e63m0 *lcd) { int ret, i; - const unsigned short *init_seq[] = { + static const unsigned short *init_seq[] = { seq_panel_condition_set, seq_display_condition_set, seq_gamma_setting, @@ -467,7 +467,7 @@ static int s6e63m0_ldi_init(struct s6e63m0 *lcd) static int s6e63m0_ldi_enable(struct s6e63m0 *lcd) { int ret = 0, i; - const unsigned short *enable_seq[] = { + static const unsigned short *enable_seq[] = { seq_stand_by_off, seq_display_on, }; -- 2.14.1