[PATCH] Use time_before in hamradio drivers
Use of time_before() macro, defined at linux/jiffies.h, which deal with wrapping correctly and are nicer to read. Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org> baycom_epp.c | 3 ++- baycom_par.c | 3 ++- baycom_ser_fdx.c | 3 ++- baycom_ser_hdx.c | 3 ++- mkiss.c | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:

committed by
Jeff Garzik

parent
6b9b97ce70
commit
cd8749b4aa
@@ -54,6 +54,7 @@
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/hdlcdrv.h>
|
||||
#include <linux/baycom.h>
|
||||
#include <linux/jiffies.h>
|
||||
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
|
||||
/* prototypes for ax25_encapsulate and ax25_rebuild_header */
|
||||
#include <net/ax25.h>
|
||||
@@ -287,7 +288,7 @@ static inline void baycom_int_freq(struct baycom_state *bc)
|
||||
* measure the interrupt frequency
|
||||
*/
|
||||
bc->debug_vals.cur_intcnt++;
|
||||
if ((cur_jiffies - bc->debug_vals.last_jiffies) >= HZ) {
|
||||
if (time_after_eq(cur_jiffies, bc->debug_vals.last_jiffies + HZ)) {
|
||||
bc->debug_vals.last_jiffies = cur_jiffies;
|
||||
bc->debug_vals.last_intcnt = bc->debug_vals.cur_intcnt;
|
||||
bc->debug_vals.cur_intcnt = 0;
|
||||
|
Reference in New Issue
Block a user