From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932950AbbDNVM2 (ORCPT ); Tue, 14 Apr 2015 17:12:28 -0400 Received: from www.linutronix.de ([62.245.132.108]:38197 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932249AbbDNVJF (ORCPT ); Tue, 14 Apr 2015 17:09:05 -0400 Message-Id: <20150414203503.659259447@linutronix.de> User-Agent: quilt/0.63-1 Date: Tue, 14 Apr 2015 21:09:27 -0000 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Preeti U Murthy , Viresh Kumar , Marcelo Tosatti , Frederic Weisbecker Subject: [patch 37/39] staging: ozwpan: Remove hrtimer_active() check References: <20150414203303.702062272@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=staging-ozwpan-remove-hrtimer-active-check.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hrtimer_cancel() can be called unconditionally and this code is hardly a hotpath which wants to avoid the out of line call. Signed-off-by: Thomas Gleixner --- drivers/staging/ozwpan/ozpd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) Index: tip/drivers/staging/ozwpan/ozpd.c =================================================================== --- tip.orig/drivers/staging/ozwpan/ozpd.c +++ tip/drivers/staging/ozwpan/ozpd.c @@ -175,10 +175,8 @@ static void oz_pd_free(struct work_struc */ void oz_pd_destroy(struct oz_pd *pd) { - if (hrtimer_active(&pd->timeout)) - hrtimer_cancel(&pd->timeout); - if (hrtimer_active(&pd->heartbeat)) - hrtimer_cancel(&pd->heartbeat); + hrtimer_cancel(&pd->timeout); + hrtimer_cancel(&pd->heartbeat); INIT_WORK(&pd->workitem, oz_pd_free); if (!schedule_work(&pd->workitem)) @@ -247,7 +245,7 @@ void oz_pd_heartbeat(struct oz_pd *pd, u more = 1; } } - if ((!more) && (hrtimer_active(&pd->heartbeat))) + if (!more) hrtimer_cancel(&pd->heartbeat); if (pd->mode & OZ_F_ISOC_ANYTIME) { int count = 8;