lkml.org 
[lkml]   [2019]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] mm/hmm: fix unused variable warnings
    On Wed, Mar 6, 2019 at 12:51 AM John Hubbard <jhubbard@nvidia.com> wrote:
    >
    > With some Kconfig local hacks that removed all HUGE* support, while leaving
    > HMM enabled, I was able to reproduce your results, and also to verify the
    > fix. It also makes sense from reading it.

    Thanks for the confirmation.

    > Also, I ran into one more warning as well:
    >
    > mm/hmm.c: In function ‘hmm_vma_walk_pud’:
    > mm/hmm.c:764:25: warning: unused variable ‘vma’ [-Wunused-variable]
    > struct vm_area_struct *vma = walk->vma;
    > ^~~
    >
    > ...which can be fixed like this:
    >
    > diff --git a/mm/hmm.c b/mm/hmm.c
    > index c4beb1628cad..c1cbe82d12b5 100644
    > --- a/mm/hmm.c
    > +++ b/mm/hmm.c
    > @@ -761,7 +761,6 @@ static int hmm_vma_walk_pud(pud_t *pudp,
    > {
    > struct hmm_vma_walk *hmm_vma_walk = walk->private;
    > struct hmm_range *range = hmm_vma_walk->range;
    > - struct vm_area_struct *vma = walk->vma;
    > unsigned long addr = start, next;
    > pmd_t *pmdp;
    > pud_t pud;
    > @@ -807,7 +806,7 @@ static int hmm_vma_walk_pud(pud_t *pudp,
    > return 0;
    > }
    >
    > - split_huge_pud(vma, pudp, addr);
    > + split_huge_pud(walk->vma, pudp, addr);
    > if (pud_none(*pudp))
    > goto again;
    >
    > ...so maybe you'd like to fold that into your patch?

    I also ran into this one last night during further randconfig testing,
    and came up with the same patch that you showed here. I'll
    send this one to Andrew and add a Reported-by line for you,
    since he already merged the first patch.

    I'll leave it up to Andrew to fold the fixes into one, or into the original
    patches if he thinks that makes sense.

    Arnd

    \
     
     \ /
      Last update: 2019-03-06 11:20    [W:3.408 / U:0.428 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site