[LinuxPPS] [PATCH 07/11] pps/kapi.c: Minor code cleanup.
George Spelvin
linux at horizon.com
Fri Feb 6 14:32:59 CET 2009
Get rid of an unnecessary goto.
---
drivers/pps/kapi.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index 15cd5a2..fa8ec89 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -98,18 +98,12 @@ void pps_put_source(struct pps_device *pps)
spin_lock_irqsave(&pps_idr_lock, flags);
BUG_ON(atomic_read(&pps->usage) == 0);
- if (!atomic_dec_and_test(&pps->usage)) {
- pps = NULL;
- goto exit;
- }
-
- /* No more reference to the PPS source. We can safely remove the
- * PPS data struct.
- */
- idr_remove(&pps_idr, pps->id);
-
-exit:
+ if (atomic_dec_and_test(&pps->usage))
+ idr_remove(&pps_idr, pps->id); /* No more refs - can remove */
+ else
+ pps = NULL; /* Still in use */
spin_unlock_irqrestore(&pps_idr_lock, flags);
+
kfree(pps);
}
--
1.6.0.6
More information about the LinuxPPS
mailing list