Re: [RFC][PATCH 02/10] mm: Remove likely() frommapping_unevictable()

From: Joe Perches
Date: Fri Dec 10 2010 - 02:06:39 EST


On Fri, 2010-12-10 at 16:00 +0900, KOSAKI Motohiro wrote:
> > [ Resending to Nick's real email ]
> >
> >
> > From: Steven Rostedt <srostedt@xxxxxxxxxx>
> >
> > The mapping_unevictable() has a likely() around the mapping parameter.
> > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
[]
> > static inline int mapping_unevictable(struct address_space *mapping)
> > {
> > - if (likely(mapping))
> > + if (mapping)
> > return test_bit(AS_UNEVICTABLE, &mapping->flags);
> > return !!mapping;
> > }
> I think you are right.
> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>

It'd be better to use

if (!mapping)
return 0;
return test_bit(AS_UNEVICTABLE, &mapping->flags);

to avoid the unnecessary !!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/