lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [v3 PATCH 1/2] mm: swap: make page_evictable() inline
From
Date


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.

> }

\
 
 \ /
  Last update: 2020-03-17 20:30    [W:0.109 / U:1.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site