On Wed, 6 Dec 2006, David Howells wrote: > > + if (get_wq_data(work) == cwq > + && test_bit(WORK_STRUCT_PENDING, &work->management) > > I wonder if those can be combined, perhaps: Gcc should do it for us, afaik. I didn't check, but gcc is generally pretty good at combining logical operations like this, because it's very common. > Otherwise for i386 the compiler can't combine them because test_bit() is done > with inline asm. Nope. Look again. test_bit() with a constant number is done very much in C, and very much on purpose. _Exactly_ to allow the compiler to combine these kinds of things. > And: > > + if (!test_bit(WORK_STRUCT_PENDING, &work->management)) > > Should possibly be: > > + if (!work_pending(work)) Yeah, that's a worthy cleanup. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- References:
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Linus Torvalds <[email protected]>
- [PATCH] Export current_is_keventd() for libphy
- From: Ben Collins <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: "Maciej W. Rozycki" <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andy Fleming <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: "Maciej W. Rozycki" <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- From: David Howells <[email protected]>
- Re: [PATCH] Export current_is_keventd() for libphy
- Prev by Date: Re: Change x86 prefix order
- Next by Date: Re: Subtleties of __attribute__((packed))
- Previous by thread: Re: [PATCH] Export current_is_keventd() for libphy
- Next by thread: Re: [PATCH] Export current_is_keventd() for libphy
- Index(es):