[LTP] [PATCH 3/7] epoll_ctl: Add test for epoll_ctl03
Xie Ziyao
xieziyao@huawei.com
Thu Aug 26 04:02:33 CEST 2021
Hi, Cyril,
>> +static void run_all(void)
>> +{
>> + unsigned int index, events_bitmap;
>> +
>> + for (index = 0; index < WIDTH_EPOLL_EVENTS; index++) {
>> + events_bitmap = ((EPOLLIN * ((index & 0x01) >> 0)) |
>> + (EPOLLOUT * ((index & 0x02) >> 1)) |
>> + (EPOLLPRI * ((index & 0x04) >> 2)) |
>> + (EPOLLERR * ((index & 0x08) >> 3)) |
>> + (EPOLLHUP * ((index & 0x10) >> 4)) |
>> + (EPOLLET * ((index & 0x20) >> 5)) |
>> + (EPOLLONESHOT * ((index & 0x40) >> 6)) |
>> + (EPOLLRDHUP * ((index & 0x80) >> 7)));
>
> I guess that we can as well add a IS_BIT_SET() macro that would do:
>
> #define IS_BIT_SET(val, bit) (((val) & (1<<(bit))) >> (bit))
Looks good, thanks. I've added this macro to include/tst_bitmap.h in the
v2 patchset, other changes have also been applied.
Besides, I've used a different outlook email to submit and hope it
doesn't cause misunderstandings.
>
> And use that here instead.
>
> Otherwise it looks good.
>
Please see: https://patchwork.ozlabs.org/project/ltp/list/?series=259628
Thanks for your review.
--
Best Regards,
Xie Ziyao
E-mail:ziyaoxie@outlook.com
More information about the ltp
mailing list