From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667AbdIEMH5 (ORCPT ); Tue, 5 Sep 2017 08:07:57 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45396 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751615AbdIEMHz (ORCPT ); Tue, 5 Sep 2017 08:07:55 -0400 From: Colin King To: Mauro Carvalho Chehab , Sean Young , Hans Verkuil , linux-media@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] imon: make two const arrays static, reduces object code size Date: Tue, 5 Sep 2017 13:07:50 +0100 Message-Id: <20170905120750.16627-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 From: Colin Ian King Don't populate the const arrays vfd_packet6 and fp_packet on the stack, instead make them static. Makes the object code smaller by over 600 bytes: Before: text data bss dec hex filename 43794 17920 1024 62738 f512 drivers/media/rc/imon.o After: text data bss dec hex filename 42994 18080 1024 62098 f292 drivers/media/rc/imon.o Signed-off-by: Colin Ian King --- drivers/media/rc/imon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7b3f31cc63d2..c50875a8c5b6 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -943,7 +943,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, int seq; int retval = 0; struct imon_context *ictx; - const unsigned char vfd_packet6[] = { + static const unsigned char vfd_packet6[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF }; ictx = file->private_data; @@ -2047,8 +2047,8 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) { struct rc_dev *rdev; int ret; - const unsigned char fp_packet[] = { 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x88 }; + static const unsigned char fp_packet[] = { + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88 }; rdev = rc_allocate_device(ictx->dev_descr->flags & IMON_IR_RAW ? RC_DRIVER_IR_RAW : RC_DRIVER_SCANCODE); -- 2.14.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Colin King Date: Tue, 05 Sep 2017 12:07:50 +0000 Subject: [PATCH] [media] imon: make two const arrays static, reduces object code size Message-Id: <20170905120750.16627-1-colin.king@canonical.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mauro Carvalho Chehab , Sean Young , Hans Verkuil , linux-media@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Colin Ian King Don't populate the const arrays vfd_packet6 and fp_packet on the stack, instead make them static. Makes the object code smaller by over 600 bytes: Before: text data bss dec hex filename 43794 17920 1024 62738 f512 drivers/media/rc/imon.o After: text data bss dec hex filename 42994 18080 1024 62098 f292 drivers/media/rc/imon.o Signed-off-by: Colin Ian King --- drivers/media/rc/imon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7b3f31cc63d2..c50875a8c5b6 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -943,7 +943,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, int seq; int retval = 0; struct imon_context *ictx; - const unsigned char vfd_packet6[] = { + static const unsigned char vfd_packet6[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF }; ictx = file->private_data; @@ -2047,8 +2047,8 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) { struct rc_dev *rdev; int ret; - const unsigned char fp_packet[] = { 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x88 }; + static const unsigned char fp_packet[] = { + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88 }; rdev = rc_allocate_device(ictx->dev_descr->flags & IMON_IR_RAW ? RC_DRIVER_IR_RAW : RC_DRIVER_SCANCODE); -- 2.14.1