From patchwork Sun Jun 21 20:41:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 6652871 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 455319F39B for ; Sun, 21 Jun 2015 20:42:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9619920675 for ; Sun, 21 Jun 2015 20:42:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCE8E20676 for ; Sun, 21 Jun 2015 20:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755076AbbFUUmI (ORCPT ); Sun, 21 Jun 2015 16:42:08 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:33900 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754724AbbFUUmH (ORCPT ); Sun, 21 Jun 2015 16:42:07 -0400 Received: by lagx9 with SMTP id x9so11166117lag.1 for ; Sun, 21 Jun 2015 13:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=3ekW6coI6QSUGPWNxBFLOrKpqgXoNQGCq9thjGHpvT4=; b=wUIEUiCmd0k5IHBvTVZD4+nQXL0ivD5SYCM8wMmOVVknOaPyvnD0g5zo+8biKNKcXg BHF9BhuVKfpVIBk4tnaqUT3TH8bxuVxr3AWoeOh4GGf18rqYq5pzwdMR8lc3IKndt9a1 tHwXOwGIanuPSHpQ4ZwVkb6hPGCK6aS8WyMaKzh85L63Z+3rM3y+lkm/pndlnzrwM3xc GIJxuoEN4IH4Ln2fGHI+9NeG8or0twlOkOHNaFkFgoLoodXYrFPrDyuc8MnpU5JPA0DZ /c+wl0fqTCu02s7HGV4DBAav+n4/C8c4UmiZ9z9mJmGtVFv1aye6qR3vYl0zQsXojB9T oktw== X-Received: by 10.152.225.166 with SMTP id rl6mr27213952lac.36.1434919324730; Sun, 21 Jun 2015 13:42:04 -0700 (PDT) Received: from [172.17.138.217] ([79.104.5.73]) by mx.google.com with ESMTPSA id h3sm4200428lbj.19.2015.06.21.13.42.03 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 13:42:03 -0700 (PDT) Message-ID: <1434919299.4096.1.camel@mtux> Subject: [PATCH] clocksource: exynos_mct: remove unneeded container_of() From: Alexey Klimov To: linux-samsung-soc@vger.kernel.org, k.kozlowski@samsung.com Cc: sboyd@codeaurora.org, t.dakhran@gmail.com, kgene@kernel.org Date: Sun, 21 Jun 2015 23:41:39 +0300 In-Reply-To: <1434322238.5390.16.camel@mtux> References: <1434322238.5390.16.camel@mtux> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, 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 Patch removes unneeded container_of() macro in exynos4_local_timer_setup(). Instead let's pass mevt pointer to setup and stop functions from exynos4_mct_cpu_notify() and let them get evt pointer. Tested on odroid-xu3. Signed-off-by: Alexey Klimov Acked-by: Stephen Boyd Reviewed-by: Krzysztof Kozlowski --- drivers/clocksource/exynos_mct.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 83564c9..752a37c 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -446,13 +446,11 @@ static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int exynos4_local_timer_setup(struct clock_event_device *evt) +static int exynos4_local_timer_setup(struct mct_clock_event_device *mevt) { - struct mct_clock_event_device *mevt; + struct clock_event_device *evt = &mevt->evt; unsigned int cpu = smp_processor_id(); - mevt = container_of(evt, struct mct_clock_event_device, evt); - mevt->base = EXYNOS4_MCT_L_BASE(cpu); snprintf(mevt->name, sizeof(mevt->name), "mct_tick%d", cpu); @@ -484,8 +482,10 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt) return 0; } -static void exynos4_local_timer_stop(struct clock_event_device *evt) +static void exynos4_local_timer_stop(struct mct_clock_event_device *mevt) { + struct clock_event_device *evt = &mevt->evt; + evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); if (mct_int_type == MCT_INT_SPI) free_irq(evt->irq, this_cpu_ptr(&percpu_mct_tick)); @@ -505,11 +505,11 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self, switch (action & ~CPU_TASKS_FROZEN) { case CPU_STARTING: mevt = this_cpu_ptr(&percpu_mct_tick); - exynos4_local_timer_setup(&mevt->evt); + exynos4_local_timer_setup(mevt); break; case CPU_DYING: mevt = this_cpu_ptr(&percpu_mct_tick); - exynos4_local_timer_stop(&mevt->evt); + exynos4_local_timer_stop(mevt); break; } @@ -557,7 +557,7 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem goto out_irq; /* Immediately configure the timer on the boot CPU */ - exynos4_local_timer_setup(&mevt->evt); + exynos4_local_timer_setup(mevt); return; out_irq: