[patch 37/39] staging: ozwpan: Remove hrtimer_active() check

From: Thomas Gleixner
Date: Tue Apr 14 2015 - 17:12:32 EST


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 <tglx@xxxxxxxxxxxxx>
---
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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/