diff options
author | Richard Braun <rbraun@sceen.net> | 2017-01-13 00:16:09 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-01-13 00:16:09 +0100 |
commit | cf59c5fa63b4639777fbe28fba79cfbd63fa6d4e (patch) | |
tree | 6cd4b64fc94f7cc9c2c1f75ba298169a88248657 /kern/sref.c | |
parent | 27e9a04a0a07707d7a85dc65198b4ab8f32888f6 (diff) |
Replace unsigned long with uintptr_t for integer/pointer conversions
This is mostly done for the machine-independent part.
Diffstat (limited to 'kern/sref.c')
-rw-r--r-- | kern/sref.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kern/sref.c b/kern/sref.c index 528eb22..a9253dc 100644 --- a/kern/sref.c +++ b/kern/sref.c @@ -240,18 +240,18 @@ sref_queue_concat(struct sref_queue *queue1, struct sref_queue *queue2) queue1->size += queue2->size; } -static inline unsigned long +static inline uintptr_t sref_counter_hash(const struct sref_counter *counter) { - unsigned long va; + uintptr_t va; - va = (unsigned long)counter; + va = (uintptr_t)counter; assert(P2ALIGNED(va, 1UL << SREF_HASH_SHIFT)); return (va >> SREF_HASH_SHIFT); } -static inline unsigned long +static inline uintptr_t sref_counter_index(const struct sref_counter *counter) { return (sref_counter_hash(counter) & (SREF_MAX_DELTAS - 1)); @@ -430,7 +430,7 @@ sref_end_epoch(struct sref_queue *queue) } static inline struct sref_delta * -sref_cache_delta(struct sref_cache *cache, unsigned int i) +sref_cache_delta(struct sref_cache *cache, unsigned long i) { assert(i < ARRAY_SIZE(cache->deltas)); return &cache->deltas[i]; @@ -441,7 +441,7 @@ sref_cache_init(struct sref_cache *cache, unsigned int cpu) { char name[EVCNT_NAME_SIZE]; struct sref_delta *delta; - unsigned int i; + unsigned long i; mutex_init(&cache->lock); |