Skip to content

Commit 666b7eb

Browse files
committed
Apply editorial changes
1 parent 937feee commit 666b7eb

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static uint32_t cache_size, cache_size_bits;
2222
static struct mpool *cache_mp;
2323

2424
/* hash function for the cache */
25-
HASH_FUNC_IMPL(cache_hash, cache_size_bits, cache_size);
25+
HASH_FUNC_IMPL(cache_hash, cache_size_bits, cache_size)
2626

2727
#if RV32_HAS(ARC)
2828
/* The Adaptive Replacement Cache (ARC) improves the traditional LRU strategy

src/emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void rv_debug(riscv_t *rv)
278278
#endif /* RV32_HAS(GDBSTUB) */
279279

280280
/* hash function for the block map */
281-
HASH_FUNC_IMPL(map_hash, BLOCK_MAP_CAPACITY_BITS, 1 << BLOCK_MAP_CAPACITY_BITS);
281+
HASH_FUNC_IMPL(map_hash, BLOCK_MAP_CAPACITY_BITS, 1 << BLOCK_MAP_CAPACITY_BITS)
282282

283283
/* allocate a basic block */
284284
static block_t *block_alloc(riscv_t *rv)

src/io.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ uint32_t memory_ifetch(uint32_t addr)
9595
return *(type *) (data_memory_base + addr); \
9696
}
9797

98-
MEM_READ_IMPL(w, uint32_t);
99-
MEM_READ_IMPL(s, uint16_t);
100-
MEM_READ_IMPL(b, uint8_t);
98+
MEM_READ_IMPL(w, uint32_t)
99+
MEM_READ_IMPL(s, uint16_t)
100+
MEM_READ_IMPL(b, uint8_t)
101101

102102
#define MEM_WRITE_IMPL(size, type) \
103103
void memory_write_##size(uint32_t addr, const uint8_t *src) \
104104
{ \
105105
*(type *) (data_memory_base + addr) = *(const type *) src; \
106106
}
107107

108-
MEM_WRITE_IMPL(w, uint32_t);
109-
MEM_WRITE_IMPL(s, uint16_t);
110-
MEM_WRITE_IMPL(b, uint8_t);
108+
MEM_WRITE_IMPL(w, uint32_t)
109+
MEM_WRITE_IMPL(s, uint16_t)
110+
MEM_WRITE_IMPL(b, uint8_t)

src/utils.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ void rv_clock_gettime(struct timespec *tp);
1515
* See
1616
* https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/hash.h
1717
*/
18-
#define HASH_FUNC_IMPL(name, size_bits, size) \
19-
FORCE_INLINE uint32_t name(uint32_t val) \
20-
{ \
21-
/* 0x61C88647 is 32-bit golden ratio */ \
22-
return (val * 0x61C88647 >> (32 - size_bits)) & ((size) -1); \
18+
#define HASH_FUNC_IMPL(name, size_bits, size) \
19+
FORCE_INLINE uint32_t name(uint32_t val) \
20+
{ \
21+
/* 0x61C88647 is 32-bit golden ratio */ \
22+
return (val * 0x61C88647 >> (32 - size_bits)) & ((size) - (1)); \
2323
}

0 commit comments

Comments
 (0)