From patchwork Thu Sep 5 16:37:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11133683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A30D013B1 for ; Thu, 5 Sep 2019 16:38:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1753D2082E for ; Thu, 5 Sep 2019 16:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732131AbfIEQhb (ORCPT ); Thu, 5 Sep 2019 12:37:31 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40710 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbfIEQhb (ORCPT ); Thu, 5 Sep 2019 12:37:31 -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 1i5ulD-0005h3-3d; Thu, 05 Sep 2019 16:37:27 +0000 From: Colin King To: Dan Williams , Vinod Koul , dmaengine@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: iop-adma: make array 'handler' static const, makes object smaller Date: Thu, 5 Sep 2019 17:37:26 +0100 Message-Id: <20190905163726.19690-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Colin Ian King Don't populate the array 'handler' on the stack but instead make it static const. Makes the object code smaller by 80 bytes. Before: text data bss dec hex filename 38225 9084 64 47373 b90d drivers/dma/iop-adma.o After: text data bss dec hex filename 38081 9148 64 47293 b8bd drivers/dma/iop-adma.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- drivers/dma/iop-adma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index a3f942a6a946..4dc5478fc156 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c @@ -1359,9 +1359,11 @@ static int iop_adma_probe(struct platform_device *pdev) iop_adma_device_clear_err_status(iop_chan); for (i = 0; i < 3; i++) { - irq_handler_t handler[] = { iop_adma_eot_handler, - iop_adma_eoc_handler, - iop_adma_err_handler }; + static const irq_handler_t handler[] = { + iop_adma_eot_handler, + iop_adma_eoc_handler, + iop_adma_err_handler + }; int irq = platform_get_irq(pdev, i); if (irq < 0) { ret = -ENXIO;