Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1398591
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled |
| Date | 2016-05-11 01:40 +0200 |
| Message-ID | <rxppV-4nc-37@gated-at.bofh.it> (permalink) |
| References | <rx3IK-8cV-13@gated-at.bofh.it> <rx3IK-8cV-11@gated-at.bofh.it> <rxieL-5nU-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, 10 May 2016 11:52:15 -0400
Jeff Moyer <jmoyer@redhat.com> wrote:
> > +static inline bool blk_trace_note_message_enabled(struct request_queue *q)
> > +{
> > + struct blk_trace *bt = q->blk_trace;
> > + if (likely(!bt))
> > + return false;
> > + return bt->act_mask & BLK_TC_NOTIFY;
>
> Do we want to return !!(bt->act_mask & BLK_TC_NOTIFY)?
The return type is bool. I would think that gcc would be smart enough
to make the conversion.
To check, I compiled the following function:
bool testbool(int x)
{
return x & 1<<3;
}
and the result was:
0000000000000000 <testbool>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 89 7d fc mov %edi,-0x4(%rbp)
7: 8b 45 fc mov -0x4(%rbp),%eax
a: 83 e0 08 and $0x8,%eax
d: 85 c0 test %eax,%eax
f: 0f 95 c0 setne %al
12: 5d pop %rbp
13: c3 retq
I get the same by adding !!(x & 1<<3)
Looks like it does the conversion.
-- Steve
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Shaohua Li <shli@fb.com> - 2016-05-10 02:30 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Jeff Moyer <jmoyer@redhat.com> - 2016-05-10 18:00 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Steven Rostedt <rostedt@goodmis.org> - 2016-05-11 01:40 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Jeff Moyer <jmoyer@redhat.com> - 2016-05-11 15:50 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Shaohua Li <shli@fb.com> - 2016-05-11 02:30 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Jeff Moyer <jmoyer@redhat.com> - 2016-05-11 15:50 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Shaohua Li <shli@fb.com> - 2016-05-11 19:00 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Simon Guo <wei.guo.simon@gmail.com> - 2016-05-11 10:20 +0200
Re: [PATCH 3/3] blk-throttle: don't parse cgroup path if trace isn't enabled Shaohua Li <shli@fb.com> - 2016-05-11 19:00 +0200
csiph-web