Re: [PATCH] mm: cleanup swap unused warning

From: Christoph Lameter
Date: Tue May 16 2006 - 11:57:45 EST

On Tue, 16 May 2006, Con Kolivas wrote:

> On Thursday 11 May 2006 09:04, Christoph Lameter wrote:
> > On Wed, 10 May 2006, Con Kolivas wrote:
> > > Are there any users of swp_entry_t when CONFIG_SWAP is not defined?
> >
> > Yes, a migration entry is a form of swap entry.
> mm/vmscan.c: In function ÿÿremove_mappingÿÿ:
> mm/vmscan.c:387: warning: unused variable ÿÿswapÿÿ
> Ok so if we fix it by making swp_entry_t __attribute__((__unused__) we break
> swap migration code?

This will generally break page migration in mm.

> If we make swap_free() an empty static inline function then gcc compiles in
> the variable needlessly and we won't know it.

PageSwapCache() returns false if CONFIG_SWAP is not set and therefore no
code is generated.