From patchwork Wed Apr 18 11:52:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 133620 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5784504ljb; Wed, 18 Apr 2018 04:54:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx49ITl0HpvywMwwXkY3kO+l+vwX5zOSMmZ5VI4b5DVLVAhED4FLumeuUqLieW5vYA/9wzvQu X-Received: by 10.99.114.14 with SMTP id n14mr1485463pgc.384.1524052444163; Wed, 18 Apr 2018 04:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524052444; cv=none; d=google.com; s=arc-20160816; b=b+W/fRZ4Z+0r4RxSSUQ1XwqrLNHJGdTVT35p3aYcs7u/hK//tcOGtPRhfGfMd4OuTC 11DKASIT+IvA7cG18qBTWbyX5BES27B03W8VnjRDr3OAuI9mIUpK11yD/3Wk631JsGtT UsgA4FAWE5kcEivvAVQzj6O/H5zDkv3ZtfgvcixZHmEjsnFRGOMhPh5XlqSwFxtCs1yY yFcU0EUzuSs/PtjbhwpYfXIqp0+kbg9Dfon68rkbiTErwZwVJfGUksdV+TYwTJn1Ly9N RIGY2y6wscRjkT+qhmdoYAmTwP4Iv9eb2xQo3KLprOXjj2Vy8No5R57HXXqXm0sgigin HgZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=YGIosZJaIBcI/z9qFNNbm+Ylu0EB+yDUSx5bxIXHxsc=; b=0q9qrXbjj6OdiNi5Aa9aIoynbOug5Rvp84/YFBJuRN+5oOvHSXQvofAy7e7nJ0bfZi CkUJQc8MfHp7DF6112hHikgaMvIoEdNsQawsWMZmbPHxY3l6PyoDIm9KtOmbnOGQzyzY PitBLUmwHYTZup7qY9TrwHNR2sEkBN6oG8K8zHSTPj6/D+iHsV0co9KwiSs43WMAndkb hAlhR0nPmp2mWiNBwptd5kBqCme45Anq1qiZ5ExBPXfwQBt2GDI2K2YHSzG77z6DBg7u YBuk+n3qU5R663NExHiN7MQdPmpNgVPDgFCYUo1nVPzzI4gntFosGTHK20EYePVYgxuv XjTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gCMeMCTG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x189si952787pgb.384.2018.04.18.04.54.03; Wed, 18 Apr 2018 04:54:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gCMeMCTG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753931AbeDRLyB (ORCPT + 29 others); Wed, 18 Apr 2018 07:54:01 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:38992 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753560AbeDRLx7 (ORCPT ); Wed, 18 Apr 2018 07:53:59 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w3IBqaYC007367; Wed, 18 Apr 2018 20:52:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w3IBqaYC007367 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1524052358; bh=YGIosZJaIBcI/z9qFNNbm+Ylu0EB+yDUSx5bxIXHxsc=; h=From:To:Cc:Subject:Date:From; b=gCMeMCTGdihufb+hoVwHx6pXtq3lEi06pMMgIUjubrRqS9AWzP40djRRcvyeAkVnz pXI2R7WefGjV7XTKyBXjMTeFB4yzDovdjSvOnUiBS6CK7xza2JMRwP2o5z3AbOKZlB WSIWrplv9l4fpoyuRPRmWWzLfQ3BsrdRkEgg2J34XoYJr29TIUpq9fqJYP5+lvLRe/ Gnd/BEL53xoyyWtZZh4P6dw0RU7VTLyVQ95MBSlc+H9j3j4xyy9rGcKVN4wVMBMu5t UkiHRR41m7ZA1GWCbsK27qg7xykyuH3Lvo5Rd7BDBkKecKOLIw9fiH7lqFrpzGn4eV gk4DVqO4v7Uww== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-clk@vger.kernel.org Cc: Stephen Boyd , Nicholas Piggin , Arnd Bergmann , Maxime Ripard , Masahiro Yamada , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Subject: [PATCH] clk: sunxi-ng: replace lib-y with obj-y Date: Wed, 18 Apr 2018 20:52:31 +0900 Message-Id: <1524052351-14103-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We had commit 06e226c7fb23 ("clk: sunxi-ng: Move all clock types to a library") and commit 799c43415442 ("kbuild: thin archives make default for all archs") in the same development cycle, from different trees. With migration to the thin archive, the entire drivers/clk/sunxi-ng/lib.a is linked to the vmlinux. This does not break build, but we do not get any size saving. However, we do not need to go back to the individual Kconfig options. The default configuration pulls in all (or most) of the CCU parts anyway. Also, once we enable CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, we can simply list all files with obj-y, and the linker will drop all unused functions by itself. After the long discussion [1], people there agreed to fix this, but nobody sent a patch after all. I am doing it now. I lifted up CONFIG_SUNXI_CCU to drivers/clk/Makefile because everything in drivers/clk/sunxi-ng/ depends on SUNXI_CCU. [1] https://patchwork.kernel.org/patch/9796521/ Signed-off-by: Masahiro Yamada --- drivers/clk/Makefile | 2 +- drivers/clk/sunxi-ng/Makefile | 39 +++++++++++++++------------------------ 2 files changed, 16 insertions(+), 25 deletions(-) -- 2.7.4 Acked-by: Stephen Boyd diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index de6d06a..23a7fdc 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -94,7 +94,7 @@ obj-$(CONFIG_ARCH_SPRD) += sprd/ obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ -obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/ +obj-$(CONFIG_SUNXI_CCU) += sunxi-ng/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-y += ti/ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile index 128a40e..9ac0fb9 100644 --- a/drivers/clk/sunxi-ng/Makefile +++ b/drivers/clk/sunxi-ng/Makefile @@ -1,24 +1,24 @@ # SPDX-License-Identifier: GPL-2.0 # Common objects -lib-$(CONFIG_SUNXI_CCU) += ccu_common.o -lib-$(CONFIG_SUNXI_CCU) += ccu_mmc_timing.o -lib-$(CONFIG_SUNXI_CCU) += ccu_reset.o +obj-y += ccu_common.o +obj-y += ccu_mmc_timing.o +obj-y += ccu_reset.o # Base clock types -lib-$(CONFIG_SUNXI_CCU) += ccu_div.o -lib-$(CONFIG_SUNXI_CCU) += ccu_frac.o -lib-$(CONFIG_SUNXI_CCU) += ccu_gate.o -lib-$(CONFIG_SUNXI_CCU) += ccu_mux.o -lib-$(CONFIG_SUNXI_CCU) += ccu_mult.o -lib-$(CONFIG_SUNXI_CCU) += ccu_phase.o -lib-$(CONFIG_SUNXI_CCU) += ccu_sdm.o +obj-y += ccu_div.o +obj-y += ccu_frac.o +obj-y += ccu_gate.o +obj-y += ccu_mux.o +obj-y += ccu_mult.o +obj-y += ccu_phase.o +obj-y += ccu_sdm.o # Multi-factor clocks -lib-$(CONFIG_SUNXI_CCU) += ccu_nk.o -lib-$(CONFIG_SUNXI_CCU) += ccu_nkm.o -lib-$(CONFIG_SUNXI_CCU) += ccu_nkmp.o -lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o -lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o +obj-y += ccu_nk.o +obj-y += ccu_nkm.o +obj-y += ccu_nkmp.o +obj-y += ccu_nm.o +obj-y += ccu_mp.o # SoC support obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o @@ -37,12 +37,3 @@ obj-$(CONFIG_SUN8I_R40_CCU) += ccu-sun8i-r40.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o - -# The lib-y file goals is supposed to work only in arch/*/lib or lib/. In our -# case, we want to use that goal, but even though lib.a will be properly -# generated, it will not be linked in, eventually resulting in a linker error -# for missing symbols. -# -# We can work around that by explicitly adding lib.a to the obj-y goal. This is -# an undocumented behaviour, but works well for now. -obj-$(CONFIG_SUNXI_CCU) += lib.a