Re: [PATCH][mm-next] mm, swap: make bool enable_vma_readahead and function swap_vma_readahead static

From: Huang\, Ying
Date: Fri Feb 23 2018 - 19:52:46 EST


Colin King <colin.king@xxxxxxxxxxxxx> writes:

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> The bool enable_vma_readahead and function swap_vma_readahead are local
> to the source and do not need to be in global scope, so make them static.
>
> Cleans up sparse warnings:
> mm/swap_state.c:41:6: warning: symbol 'enable_vma_readahead' was not
> declared. Should it be static?
> mm/swap_state.c:742:13: warning: symbol 'swap_vma_readahead' was not
> declared. Should it be static?
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Acked-by: "Huang, Ying" <ying.huang@xxxxxxxxx>

> ---
> mm/swap_state.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/swap_state.c b/mm/swap_state.c
> index 8dde719e973c..f3952138f01d 100644
> --- a/mm/swap_state.c
> +++ b/mm/swap_state.c
> @@ -38,7 +38,7 @@ static const struct address_space_operations swap_aops = {
>
> struct address_space *swapper_spaces[MAX_SWAPFILES] __read_mostly;
> static unsigned int nr_swapper_spaces[MAX_SWAPFILES] __read_mostly;
> -bool enable_vma_readahead __read_mostly = true;
> +static bool enable_vma_readahead __read_mostly = true;
>
> #define SWAP_RA_WIN_SHIFT (PAGE_SHIFT / 2)
> #define SWAP_RA_HITS_MASK ((1UL << SWAP_RA_WIN_SHIFT) - 1)
> @@ -739,8 +739,8 @@ static void swap_ra_info(struct vm_fault *vmf,
> pte_unmap(orig_pte);
> }
>
> -struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask,
> - struct vm_fault *vmf)
> +static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask,
> + struct vm_fault *vmf)
> {
> struct blk_plug plug;
> struct vm_area_struct *vma = vmf->vma;