From patchwork Thu Apr 28 13:20:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8970281 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 555929F441 for ; Thu, 28 Apr 2016 13:21:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55BEB202F0 for ; Thu, 28 Apr 2016 13:21:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E723202C8 for ; Thu, 28 Apr 2016 13:21:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1avlsn-0007XJ-OU; Thu, 28 Apr 2016 13:21:29 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1avlsk-0007RE-M0 for linux-mediatek@lists.infradead.org; Thu, 28 Apr 2016 13:21:28 +0000 Received: by mail-wm0-x231.google.com with SMTP id g17so41141777wme.1 for ; Thu, 28 Apr 2016 06:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3iplu3va/S311nTX9SNrwnIJizM89jCvIqaNm4Q05v0=; b=H2/cnijR5CE21n4AcA+8D4y51kAeoUrfSlzi1cFR2ePMEonlVkDGACDOF2SojrSc3R gN5PNLHhigdfgr9zZGadKHpzATHBD5ayW1LaIbZIhvuUxto9ZvmOFXbhooKVMhEUHRRx iWKaM5UlwvpGJsOwuyNwzJwGURZWl1m4Ueeo4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3iplu3va/S311nTX9SNrwnIJizM89jCvIqaNm4Q05v0=; b=mtSTqkT6dRdeRXPSfIy3v46Df2tutyR7wf5Ird8sqPB06L4PloxvmInukSQ0U5s1lv mPGrMyIOyzG8Ol9laxQ+pn5jl2AuplTIUGQYRPCRpXv9y6sd1zM4qe5H97Ur2mJrJ1zH t21dsrI/F0yHIprdygh1tDTPrjWdu58pz5jZSQuyu0asmHarpuuZjJ42+HIMiX4pDaaY 94yYtv8NmatPUGlHJGOaVldSO+YbYkf5a+x1EqVkirGU65jVawkv1TJ3X2Lhs36Fe9yi ZQern6hPi2fTnuHIObf7fqNRTW2A/AwSXQp+CuHf6AyME5FA1CkZacQO67GbItQ+7a1/ /vRw== X-Gm-Message-State: AOPr4FWJVbOwRopV+q6RJlBCpT43XjJN86IZ+xa2VgpVJNc2Le5zrXn64RqsZzo64LMrCHf6 X-Received: by 10.28.47.208 with SMTP id v199mr32347021wmv.56.1461849665032; Thu, 28 Apr 2016 06:21:05 -0700 (PDT) Received: from localhost.localdomain (pur13-1-78-242-214-186.fbx.proxad.net. [78.242.214.186]) by smtp.gmail.com with ESMTPSA id 63sm1293188wmz.5.2016.04.28.06.21.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Apr 2016 06:21:04 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Subject: [PATCH 2/5] clocksource/drivers/mtk_timer: Add __init attribute Date: Thu, 28 Apr 2016 15:20:45 +0200 Message-Id: <1461849648-12751-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461849648-12751-1-git-send-email-daniel.lezcano@linaro.org> References: <20160428131908.GC5197@linaro.org> <1461849648-12751-1-git-send-email-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160428_062126_863269_BDE34C18 X-CRM114-Status: GOOD ( 11.24 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Julia Lawall , "moderated list:ARM/Mediatek SoC..." , "open list:CLOCKSOURCE, CLOC..." , "moderated list:ARM/Mediatek SoC..." MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall Add __init attribute on a function that is only called from other __init functions and that is not inlined, at least with gcc version 4.8.4 on an x86 machine with allyesconfig. Currently, the function is put in the .text.unlikely segment. Declaring it as __init will cause it to be put in the .init.text and to disappear after initialization. The result of objdump -x on the function before the change is as follows: 0000000000000000 l F .text.unlikely 000000000000006f mtk_timer_setup.isra.4 And after the change it is as follows: 0000000000000000 l F .init.text 000000000000006a mtk_timer_setup.isra.4 Done with the help of Coccinelle. The semantic patch checks for local static non-init functions that are called from an __init function and are not called from any other function. Signed-off-by: Julia Lawall Signed-off-by: Daniel Lezcano Acked-by: Matthias Brugger --- drivers/clocksource/mtk_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c index d67bc35..7e583f8 100644 --- a/drivers/clocksource/mtk_timer.c +++ b/drivers/clocksource/mtk_timer.c @@ -152,7 +152,7 @@ static irqreturn_t mtk_timer_interrupt(int irq, void *dev_id) } static void -mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option) +__init mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option) { writel(TIMER_CTRL_CLEAR | TIMER_CTRL_DISABLE, evt->gpt_base + TIMER_CTRL_REG(timer));