From patchwork Thu May 17 20:42:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 160012 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 73ACBB6FAA for ; Fri, 18 May 2012 06:42:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753872Ab2EQUmS (ORCPT ); Thu, 17 May 2012 16:42:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34001 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500Ab2EQUmR (ORCPT ); Thu, 17 May 2012 16:42:17 -0400 Received: from akpm.mtv.corp.google.com (216-239-45-4.google.com [216.239.45.4]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E3106308; Thu, 17 May 2012 20:42:16 +0000 (UTC) Date: Thu, 17 May 2012 13:42:16 -0700 From: Andrew Morton To: Viresh Kumar Cc: , , , , , , , , , , , Subject: Re: [PATCH V3 Resend 07/12] ata/sata_mv: Remove conditional compilation of clk code Message-Id: <20120517134216.8590c88a.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On Tue, 8 May 2012 09:22:34 +0530 Viresh Kumar wrote: > With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, > there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif > macros. There have been significant changes to drivers/ata/sata_mv.c in linux-next so I have reworked the patch as below. I notice that with x86_64 allmodconfig (CONFIG_HAVE_CLK=n), this patch adds quite a lot of program text: text data bss dec hex filename 26926 2657 7648 37231 916f drivers/ata/sata_mv.o 27528 2657 7832 38017 9481 drivers/ata/sata_mv.o This is an unacceptable increase for a purely cosmetic change! For some reason, ata-pata_arasan-remove-conditional-compilation-of-clk-code.patch shrinks drivers/ata/pata_arasan_cf.o by 60 bytes, so that's good. drivers/net/can/c_can/c_can_platform.o got 18 bytes bigger, which we can live with. I checked a few other patches and didn't see similar code bloat. I note that usb-musb-remove-conditional-compilation-of-clk-code.patch accidentally fixed the build of drivers/usb/musb/ux500.c. In the mainline kernel I get drivers/usb/musb/ux500.c: In function 'ux500_probe': drivers/usb/musb/ux500.c:89: error: expected expression before 'do' drivers/usb/musb/ux500.c: In function 'ux500_resume': drivers/usb/musb/ux500.c:175: error: expected expression before 'do' possibly because this driver isn't supposed to be built with x86_64 allmodconfig, but someone obviously has a borked clk_enable() definition. drivers/usb/gadget/pxa25x_udc.c does it wrongly. Anyway, I will drop ata-sata_mv-remove-conditional-compilation-of-clk-code.patch - please grab current linux-next and see what we can do about the code size issue? Thanks. From: Viresh Kumar Subject: ata/sata_mv: remove conditional compilation of clk code With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h, there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif macros. Signed-off-by: Viresh Kumar Reviewed-by: Andrew Lunn Cc: Jeff Garzik Cc: Russell King Cc: Mike Turquette Cc: Sergei Shtylyov Signed-off-by: Andrew Morton --- drivers/ata/sata_mv.c | 14 -------------- 1 file changed, 14 deletions(-) diff -puN drivers/ata/sata_mv.c~ata-sata_mv-remove-conditional-compilation-of-clk-code drivers/ata/sata_mv.c --- a/drivers/ata/sata_mv.c~ata-sata_mv-remove-conditional-compilation-of-clk-code +++ a/drivers/ata/sata_mv.c @@ -551,10 +551,8 @@ struct mv_host_priv { u32 irq_mask_offset; u32 unmask_all_irqs; -#if defined(CONFIG_HAVE_CLK) struct clk *clk; struct clk **port_clks; -#endif /* * These consistent DMA memory pools give us guaranteed * alignment for hardware-accessed data structures, @@ -4028,9 +4026,7 @@ static int mv_platform_probe(struct plat struct resource *res; int n_ports = 0; int rc; -#if defined(CONFIG_HAVE_CLK) int port; -#endif ata_print_version_once(&pdev->dev, DRV_VERSION); @@ -4058,13 +4054,11 @@ static int mv_platform_probe(struct plat if (!host || !hpriv) return -ENOMEM; -#if defined(CONFIG_HAVE_CLK) hpriv->port_clks = devm_kzalloc(&pdev->dev, sizeof(struct clk *) * n_ports, GFP_KERNEL); if (!hpriv->port_clks) return -ENOMEM; -#endif host->private_data = hpriv; hpriv->n_ports = n_ports; hpriv->board_idx = chip_soc; @@ -4074,7 +4068,6 @@ static int mv_platform_probe(struct plat resource_size(res)); hpriv->base -= SATAHC0_REG_BASE; -#if defined(CONFIG_HAVE_CLK) hpriv->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(hpriv->clk)) dev_notice(&pdev->dev, "cannot get optional clkdev\n"); @@ -4088,7 +4081,6 @@ static int mv_platform_probe(struct plat if (!IS_ERR(hpriv->port_clks[port])) clk_prepare_enable(hpriv->port_clks[port]); } -#endif /* * (Re-)program MBUS remapping windows if we are asked to. @@ -4115,7 +4107,6 @@ static int mv_platform_probe(struct plat return 0; err: -#if defined(CONFIG_HAVE_CLK) if (!IS_ERR(hpriv->clk)) { clk_disable_unprepare(hpriv->clk); clk_put(hpriv->clk); @@ -4126,7 +4117,6 @@ err: clk_put(hpriv->port_clks[port]); } } -#endif return rc; } @@ -4142,13 +4132,10 @@ err: static int __devexit mv_platform_remove(struct platform_device *pdev) { struct ata_host *host = platform_get_drvdata(pdev); -#if defined(CONFIG_HAVE_CLK) struct mv_host_priv *hpriv = host->private_data; int port; -#endif ata_host_detach(host); -#if defined(CONFIG_HAVE_CLK) if (!IS_ERR(hpriv->clk)) { clk_disable_unprepare(hpriv->clk); clk_put(hpriv->clk); @@ -4159,7 +4146,6 @@ static int __devexit mv_platform_remove( clk_put(hpriv->port_clks[port]); } } -#endif return 0; }