From: Jon Hunter <jon-hunter@ti.com> To: Tony Lindgren <tony@atomide.com> Cc: linux-omap <linux-omap@vger.kernel.org>, linux-arm <linux-arm-kernel@lists.infradead.org>, Jon Hunter <jon-hunter@ti.com> Subject: [PATCH 4/8] ARM: OMAP2+: Remove unnecessary local variable in timer code Date: Tue, 13 Nov 2012 12:13:19 -0600 [thread overview] Message-ID: <1352830403-1706-5-git-send-email-jon-hunter@ti.com> (raw) In-Reply-To: <1352830403-1706-1-git-send-email-jon-hunter@ti.com> The function omap_dm_timer_init_one() declares two local variables of type int that are used to store the return value of functions called. One such local variable is sufficient and so remove one of these local variables. Signed-off-by: Jon Hunter <jon-hunter@ti.com> --- arch/arm/mach-omap2/timer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index e9fcc5f..1a662df 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -246,8 +246,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, struct device_node *np; struct omap_hwmod *oh; struct resource irq, mem; - int res = 0; - int r; + int r = 0; if (of_have_populated_dt()) { np = omap_get_timer_dt(omap_timer_match, NULL); @@ -307,10 +306,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, src = clk_get(NULL, fck_source); if (IS_ERR(src)) { - res = -EINVAL; + r = -EINVAL; } else { - res = clk_set_parent(timer->fclk, src); - if (IS_ERR_VALUE(res)) + r = clk_set_parent(timer->fclk, src); + if (IS_ERR_VALUE(r)) pr_warn("%s: %s cannot set source\n", __func__, oh->name); clk_put(src); @@ -331,7 +330,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, timer->rate = clk_get_rate(timer->fclk); timer->reserved = 1; - return res; + return r; } static void __init omap2_gp_clockevent_init(int gptimer_id, -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: jon-hunter@ti.com (Jon Hunter) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/8] ARM: OMAP2+: Remove unnecessary local variable in timer code Date: Tue, 13 Nov 2012 12:13:19 -0600 [thread overview] Message-ID: <1352830403-1706-5-git-send-email-jon-hunter@ti.com> (raw) In-Reply-To: <1352830403-1706-1-git-send-email-jon-hunter@ti.com> The function omap_dm_timer_init_one() declares two local variables of type int that are used to store the return value of functions called. One such local variable is sufficient and so remove one of these local variables. Signed-off-by: Jon Hunter <jon-hunter@ti.com> --- arch/arm/mach-omap2/timer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index e9fcc5f..1a662df 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -246,8 +246,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, struct device_node *np; struct omap_hwmod *oh; struct resource irq, mem; - int res = 0; - int r; + int r = 0; if (of_have_populated_dt()) { np = omap_get_timer_dt(omap_timer_match, NULL); @@ -307,10 +306,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, src = clk_get(NULL, fck_source); if (IS_ERR(src)) { - res = -EINVAL; + r = -EINVAL; } else { - res = clk_set_parent(timer->fclk, src); - if (IS_ERR_VALUE(res)) + r = clk_set_parent(timer->fclk, src); + if (IS_ERR_VALUE(r)) pr_warn("%s: %s cannot set source\n", __func__, oh->name); clk_put(src); @@ -331,7 +330,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, timer->rate = clk_get_rate(timer->fclk); timer->reserved = 1; - return res; + return r; } static void __init omap2_gp_clockevent_init(int gptimer_id, -- 1.7.9.5
next prev parent reply other threads:[~2012-11-13 18:13 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-11-13 18:13 [PATCH 0/8] ARM: OMAP: Clean-up DMTIMER Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` [PATCH 1/8] ARM: OMAP: Clean-up dmtimer reset code Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` [PATCH 2/8] ARM: OMAP: Define omap_dm_timer_prepare function as static Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` [PATCH 3/8] ARM: OMAP: Don't store timers physical address Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` Jon Hunter [this message] 2012-11-13 18:13 ` [PATCH 4/8] ARM: OMAP2+: Remove unnecessary local variable in timer code Jon Hunter 2012-11-13 18:13 ` [PATCH 5/8] ARM: OMAP: Remove unnecessary omap_dm_timer structure declaration Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` [PATCH 6/8] ARM: OMAP: Add platform data header for DMTIMERs Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 18:13 ` [PATCH 7/8] ARM: OMAP: Remove unnecessary inclusion of dmtimer.h Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-14 15:53 ` Jon Hunter 2012-11-14 15:53 ` Jon Hunter 2012-11-15 20:42 ` Omar Ramirez Luna 2012-11-15 20:42 ` Omar Ramirez Luna 2012-11-15 22:43 ` Greg Kroah-Hartman 2012-11-15 22:43 ` Greg Kroah-Hartman 2012-11-13 18:13 ` [PATCH 8/8] ARM: OMAP: Move plat/dmtimer.h to plat-omap/dmtimer.h Jon Hunter 2012-11-13 18:13 ` Jon Hunter 2012-11-13 22:26 ` Tony Lindgren 2012-11-13 22:26 ` Tony Lindgren 2012-11-13 22:54 ` Jon Hunter 2012-11-13 22:54 ` Jon Hunter 2012-11-13 23:34 ` Tony Lindgren 2012-11-13 23:34 ` Tony Lindgren
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1352830403-1706-5-git-send-email-jon-hunter@ti.com \ --to=jon-hunter@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.