Messages in this thread | | | Date | Wed, 21 Sep 2005 15:11:30 -0400 | From | Bill Davidsen <> | Subject | Re: A pettiness question. |
| |
liyu wrote: > Hi, All. > I found there are use double operator ! continuously sometimes in > kernel. > e.g: > > static inline int is_page_cache_freeable(struct page *page) > { > return page_count(page) - !!PagePrivate(page) == 2; > } > > Who would like tell me why write like above? > !!(N) is easier to write than ((N) ? 1 : 0) -- -bill davidsen (davidsen@tmr.com) "The secret to procrastination is to put things off until the last possible moment - but no longer" -me
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |