From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/7] epoll_ctl: Add test for epoll_ctl03
Date: Tue, 24 Aug 2021 17:38:55 +0200 [thread overview]
Message-ID: <YSUSj8qaWPfMF1/w@yuki> (raw)
In-Reply-To: <20210817064924.127970-4-xieziyao@huawei.com>
> +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))
And use that here instead.
Otherwise it looks good.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2021-08-24 15:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 6:49 [LTP] [PATCH 0/7] epoll: Add more basic test for epoll_{create, create1, ctl} Xie Ziyao
2021-08-17 6:49 ` [LTP] [PATCH 1/7] epoll_ctl: Add docparse formatting and cleanup for epoll_ctl01 Xie Ziyao
2021-08-24 15:23 ` Cyril Hrubis
2021-08-17 6:49 ` [LTP] [PATCH 2/7] epoll_ctl: Add docparse formatting and cleanup for epoll_ctl02 Xie Ziyao
2021-08-24 15:24 ` Cyril Hrubis
2021-08-17 6:49 ` [LTP] [PATCH 3/7] epoll_ctl: Add test for epoll_ctl03 Xie Ziyao
2021-08-24 15:38 ` Cyril Hrubis [this message]
2021-08-26 2:02 ` Xie Ziyao
2021-08-17 6:49 ` [LTP] [PATCH 4/7] epoll_create1: Add docparse formatting and cleanup for epoll_create1_01 Xie Ziyao
2021-08-25 9:46 ` Cyril Hrubis
2021-08-17 6:49 ` [LTP] [PATCH 5/7] epoll_create1: Add test for epoll_create1_02 Xie Ziyao
2021-08-25 11:35 ` Cyril Hrubis
2021-08-17 6:49 ` [LTP] [PATCH 6/7] epoll_create: Add test for epoll_create01 Xie Ziyao
2021-08-25 12:00 ` Cyril Hrubis
2021-08-17 6:49 ` [LTP] [PATCH 7/7] epoll_create: Add test for epoll_create02 Xie Ziyao
2021-08-25 12:01 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YSUSj8qaWPfMF1/w@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox