From: Jens Axboe Date: Thu, 18 Aug 2016 14:17:53 +0000 (-0600) Subject: fio: use the proper enum type for the shifted IO engine flags X-Git-Tag: fio-2.14~27 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8f6d1311afd37bf70b5b0bd7ebb0944ed9460d34 fio: use the proper enum type for the shifted IO engine flags Signed-off-by: Jens Axboe --- diff --git a/fio.h b/fio.h index 0da0bc5d..a62b1559 100644 --- a/fio.h +++ b/fio.h @@ -563,7 +563,8 @@ enum { static inline enum fio_ioengine_flags td_ioengine_flags(struct thread_data *td) { - return (td->flags >> TD_ENG_FLAG_SHIFT) & TD_ENG_FLAG_MASK; + return (enum fio_ioengine_flags) + ((td->flags >> TD_ENG_FLAG_SHIFT) & TD_ENG_FLAG_MASK); } static inline void td_set_ioengine_flags(struct thread_data *td) @@ -571,9 +572,10 @@ static inline void td_set_ioengine_flags(struct thread_data *td) td->flags |= (td->io_ops->flags << TD_ENG_FLAG_SHIFT); } -static inline bool td_ioengine_flagged(struct thread_data *td, unsigned int val) +static inline bool td_ioengine_flagged(struct thread_data *td, + enum fio_ioengine_flags flags) { - return ((td->flags >> TD_ENG_FLAG_SHIFT) & val) != 0; + return ((td->flags >> TD_ENG_FLAG_SHIFT) & flags) != 0; } extern void td_set_runstate(struct thread_data *, int);