diff options
author | Paul Dagnelie <[email protected]> | 2019-10-13 19:21:51 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-10-13 19:21:51 -0700 |
commit | 511fce6b1f939bd78687924aaa35dc83f8056ced (patch) | |
tree | c1a9036236debd0bd778327d4c6849f2512a3981 /include/sys/range_tree.h | |
parent | cdbba101f48bef68b46363a64880b51fa647ad45 (diff) |
Don't call sizeof on void
We get the sizeof the appropriate type, and don't cast away const.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>
Reviewed-by: Matt Macy <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes #9455
Diffstat (limited to 'include/sys/range_tree.h')
-rw-r--r-- | include/sys/range_tree.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/sys/range_tree.h b/include/sys/range_tree.h index d80faa933..6e0025a2f 100644 --- a/include/sys/range_tree.h +++ b/include/sys/range_tree.h @@ -126,11 +126,11 @@ rs_get_start_raw(const range_seg_t *rs, const range_tree_t *rt) ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES); switch (rt->rt_type) { case RANGE_SEG32: - return (((range_seg32_t *)rs)->rs_start); + return (((const range_seg32_t *)rs)->rs_start); case RANGE_SEG64: - return (((range_seg64_t *)rs)->rs_start); + return (((const range_seg64_t *)rs)->rs_start); case RANGE_SEG_GAP: - return (((range_seg_gap_t *)rs)->rs_start); + return (((const range_seg_gap_t *)rs)->rs_start); default: VERIFY(0); return (0); @@ -143,11 +143,11 @@ rs_get_end_raw(const range_seg_t *rs, const range_tree_t *rt) ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES); switch (rt->rt_type) { case RANGE_SEG32: - return (((range_seg32_t *)rs)->rs_end); + return (((const range_seg32_t *)rs)->rs_end); case RANGE_SEG64: - return (((range_seg64_t *)rs)->rs_end); + return (((const range_seg64_t *)rs)->rs_end); case RANGE_SEG_GAP: - return (((range_seg_gap_t *)rs)->rs_end); + return (((const range_seg_gap_t *)rs)->rs_end); default: VERIFY(0); return (0); |