summaryrefslogtreecommitdiffstats
path: root/sys/sys/ktr.h
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2000-09-10 14:36:55 +0000
committerdfr <dfr@FreeBSD.org>2000-09-10 14:36:55 +0000
commit0ab743ee180e7c2663016f6225bbbf956c80f9bd (patch)
tree11aafaa4d07b574c692d76e08d0400c06b3c863b /sys/sys/ktr.h
parent2bb8dc380d807dadaaa755c17e1c754468c616b6 (diff)
downloadFreeBSD-src-0ab743ee180e7c2663016f6225bbbf956c80f9bd.zip
FreeBSD-src-0ab743ee180e7c2663016f6225bbbf956c80f9bd.tar.gz
Use '&' instead of '%' to calculate the new value for ktr_idx.
Diffstat (limited to 'sys/sys/ktr.h')
-rw-r--r--sys/sys/ktr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h
index fcafa6e..92413b2 100644
--- a/sys/sys/ktr.h
+++ b/sys/sys/ktr.h
@@ -153,7 +153,7 @@ extern struct ktr_entry ktr_buf[];
disable_intr(); \
do { \
_ktr_saveidx = ktr_idx; \
- _ktr_newidx = (ktr_idx + 1) % KTR_ENTRIES; \
+ _ktr_newidx = (ktr_idx + 1) & (KTR_ENTRIES - 1); \
} while (atomic_cmpset_int(&ktr_idx, _ktr_saveidx, _ktr_newidx) == 0); \
_ktrptr = &ktr_buf[_ktr_saveidx]; \
restore_intr(_tr_intrsave); \
@@ -212,7 +212,7 @@ extern struct ktr_entry ktr_buf[];
int _ktr_newidx, _ktr_saveidx; \
do { \
_ktr_saveidx = ktr_idx; \
- _ktr_newidx = (ktr_idx + 1) % KTR_ENTRIES; \
+ _ktr_newidx = (ktr_idx + 1) & (KTR_ENTRIES - 1); \
} while (atomic_cmpset_int(&ktr_idx, _ktr_saveidx, _ktr_newidx) == 0); \
_ktrptr = &ktr_buf[_ktr_saveidx]; \
nanotime(&_ktrptr->ktr_tv); \
OpenPOWER on IntegriCloud