Re: [v3 PATCH 1/2] mm: swap: make page_evictable() inline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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.

  }





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux