[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65617abd-d7b7-5e1c-46a3-77e9cddcc514@linux.alibaba.com>
Date: Tue, 17 Mar 2020 12:29:33 -0700
From: Yang Shi <yang.shi@...ux.alibaba.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: shakeelb@...gle.com, vbabka@...e.cz, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [v3 PATCH 1/2] mm: swap: make page_evictable() inline
On 3/17/20 12:21 PM, Matthew Wilcox wrote:
> On Wed, Mar 18, 2020 at 01:42:50AM +0800, Yang Shi wrote:
>> -static inline int mapping_unevictable(struct address_space *mapping)
>> +static inline bool mapping_unevictable(struct address_space *mapping)
>> {
>> if (mapping)
>> return test_bit(AS_UNEVICTABLE, &mapping->flags);
> Shouldn't this be:
>
> -static inline int mapping_unevictable(struct address_space *mapping)
> +static inline bool mapping_unevictable(struct address_space *mapping)
> {
> - if (mapping)
> - return test_bit(AS_UNEVICTABLE, &mapping->flags);
> - return !!mapping;
> + return mapping && test_bit(AS_UNEVICTABLE, &mapping->flags);
Looks neater. Will take it in thew new version.
> }
Powered by blists - more mailing lists