From patchwork Wed Sep 13 15:03:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9951513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42C476038F for ; Wed, 13 Sep 2017 15:03:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 343BC28872 for ; Wed, 13 Sep 2017 15:03:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28E1D2888C; Wed, 13 Sep 2017 15:03:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F14AC28872 for ; Wed, 13 Sep 2017 15:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbdIMPDM (ORCPT ); Wed, 13 Sep 2017 11:03:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38534 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbdIMPDM (ORCPT ); Wed, 13 Sep 2017 11:03:12 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ds9C1-00047b-TF; Wed, 13 Sep 2017 15:03:09 +0000 From: Colin King To: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] drivers/video/fbdev/atyfb: make const arrays static, reduces object code size Date: Wed, 13 Sep 2017 16:03:09 +0100 Message-Id: <20170913150309.6250-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Don't populate the const arrays ragepro_tbl and ragexl_tbl on the stack, instead make them static. Makes the object code smaller by over 380 bytes: Before: text data bss dec hex filename 41089 10592 768 52449 cce1 atyfb_base.o After: text data bss dec hex filename 40544 10752 768 52064 cb60 atyfb_base.o (gcc version 7.2.0, x86_64) Signed-off-by: Colin Ian King --- drivers/video/fbdev/aty/atyfb_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 3ec72f19114b..a9a8272f7a6e 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2272,10 +2272,10 @@ static void aty_bl_exit(struct backlight_device *bd) static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk) { - const int ragepro_tbl[] = { + static const int ragepro_tbl[] = { 44, 50, 55, 66, 75, 80, 100 }; - const int ragexl_tbl[] = { + static const int ragexl_tbl[] = { 50, 66, 75, 83, 90, 95, 100, 105, 110, 115, 120, 125, 133, 143, 166 };