linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] userfaultfd: remove set but not used variable 'h'
@ 2019-10-09 12:27 YueHaibing
  2019-10-10  0:45 ` Mike Kravetz
  0 siblings, 1 reply; 7+ messages in thread
From: YueHaibing @ 2019-10-09 12:27 UTC (permalink / raw)
  To: Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Mike Kravetz, Stephen Rothwell, Wei Yang,
	Hugh Dickins
  Cc: YueHaibing, linux-mm, linux-kernel, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
mm/userfaultfd.c:217:17: warning:
 variable 'h' set but not used [-Wunused-but-set-variable]

It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
for all huge page size calculation")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 mm/userfaultfd.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 4cb4ef3d9128..1b0d7abad1d4 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -214,7 +214,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 	unsigned long src_addr, dst_addr;
 	long copied;
 	struct page *page;
-	struct hstate *h;
 	unsigned long vma_hpagesize;
 	pgoff_t idx;
 	u32 hash;
@@ -271,8 +270,6 @@ static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm,
 			goto out_unlock;
 	}
 
-	h = hstate_vma(dst_vma);
-
 	while (src_addr < src_start + len) {
 		pte_t dst_pteval;





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-09 12:27 [PATCH -next] userfaultfd: remove set but not used variable 'h' YueHaibing
@ 2019-10-10  0:45 ` Mike Kravetz
  2019-10-10  1:23   ` Wei Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Kravetz @ 2019-10-10  0:45 UTC (permalink / raw)
  To: YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Wei Yang, Hugh Dickins
  Cc: linux-mm, linux-kernel, kernel-janitors

On 10/9/19 5:27 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
> mm/userfaultfd.c:217:17: warning:
>  variable 'h' set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
> for all huge page size calculation")
> 

Thanks!  That should have been removed with the recent cleanups.

> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-10  0:45 ` Mike Kravetz
@ 2019-10-10  1:23   ` Wei Yang
  2019-10-10  2:25     ` Mike Kravetz
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2019-10-10  1:23 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Wei Yang, Hugh Dickins,
	linux-mm, linux-kernel, kernel-janitors

On Wed, Oct 09, 2019 at 05:45:57PM -0700, Mike Kravetz wrote:
>On 10/9/19 5:27 AM, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>> 
>> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
>> mm/userfaultfd.c:217:17: warning:
>>  variable 'h' set but not used [-Wunused-but-set-variable]
>> 
>> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
>> for all huge page size calculation")
>> 
>
>Thanks!  That should have been removed with the recent cleanups.
>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
>Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

If I am correct, this is removed in a recent patch.

>-- 
>Mike Kravetz

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-10  1:23   ` Wei Yang
@ 2019-10-10  2:25     ` Mike Kravetz
  2019-10-10  3:30       ` Wei Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Kravetz @ 2019-10-10  2:25 UTC (permalink / raw)
  To: Wei Yang
  Cc: YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Hugh Dickins, linux-mm,
	linux-kernel, kernel-janitors

On 10/9/19 6:23 PM, Wei Yang wrote:
> On Wed, Oct 09, 2019 at 05:45:57PM -0700, Mike Kravetz wrote:
>> On 10/9/19 5:27 AM, YueHaibing wrote:
>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>
>>> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
>>> mm/userfaultfd.c:217:17: warning:
>>>  variable 'h' set but not used [-Wunused-but-set-variable]
>>>
>>> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
>>> for all huge page size calculation")
>>>
>>
>> Thanks!  That should have been removed with the recent cleanups.
>>
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>
>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
> 
> If I am correct, this is removed in a recent patch.

I'm having a hard time figuring out what is actually in the latest mmotm
tree.  Andrew added a build fixup patch ab169389eb5 in linux-next which
adds the reference to h.  Is there a patch after that to remove the reference?

-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-10  2:25     ` Mike Kravetz
@ 2019-10-10  3:30       ` Wei Yang
  2019-10-10  3:42         ` Mike Kravetz
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2019-10-10  3:30 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: Wei Yang, YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Hugh Dickins, linux-mm,
	linux-kernel, kernel-janitors

On Wed, Oct 09, 2019 at 07:25:18PM -0700, Mike Kravetz wrote:
>On 10/9/19 6:23 PM, Wei Yang wrote:
>> On Wed, Oct 09, 2019 at 05:45:57PM -0700, Mike Kravetz wrote:
>>> On 10/9/19 5:27 AM, YueHaibing wrote:
>>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>>
>>>> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
>>>> mm/userfaultfd.c:217:17: warning:
>>>>  variable 'h' set but not used [-Wunused-but-set-variable]
>>>>
>>>> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
>>>> for all huge page size calculation")
>>>>
>>>
>>> Thanks!  That should have been removed with the recent cleanups.
>>>
>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>
>>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
>> 
>> If I am correct, this is removed in a recent patch.
>
>I'm having a hard time figuring out what is actually in the latest mmotm
>tree.  Andrew added a build fixup patch ab169389eb5 in linux-next which
>adds the reference to h.  Is there a patch after that to remove the reference?
>

I checked linux-next tree, this commit removes the reference.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=add4eaeef3766b7491d70d473c48c0b6d6ca5cb7

>-- 
>Mike Kravetz

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-10  3:30       ` Wei Yang
@ 2019-10-10  3:42         ` Mike Kravetz
  2019-10-10  3:53           ` Wei Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Kravetz @ 2019-10-10  3:42 UTC (permalink / raw)
  To: Wei Yang
  Cc: YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Hugh Dickins, linux-mm,
	linux-kernel, kernel-janitors

On 10/9/19 8:30 PM, Wei Yang wrote:
> On Wed, Oct 09, 2019 at 07:25:18PM -0700, Mike Kravetz wrote:
>> On 10/9/19 6:23 PM, Wei Yang wrote:
>>> On Wed, Oct 09, 2019 at 05:45:57PM -0700, Mike Kravetz wrote:
>>>> On 10/9/19 5:27 AM, YueHaibing wrote:
>>>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>>>
>>>>> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
>>>>> mm/userfaultfd.c:217:17: warning:
>>>>>  variable 'h' set but not used [-Wunused-but-set-variable]
>>>>>
>>>>> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
>>>>> for all huge page size calculation")
>>>>>
>>>>
>>>> Thanks!  That should have been removed with the recent cleanups.
>>>>
>>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>>
>>>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
>>>
>>> If I am correct, this is removed in a recent patch.
>>
>> I'm having a hard time figuring out what is actually in the latest mmotm
>> tree.  Andrew added a build fixup patch ab169389eb5 in linux-next which
>> adds the reference to h.  Is there a patch after that to remove the reference?
>>
> 
> I checked linux-next tree, this commit removes the reference.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=add4eaeef3766b7491d70d473c48c0b6d6ca5cb7
> 

Yes, but unless I am mistaken this adds it back,

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ab169389eb5ff9da7113a21737574edc6d22c072

-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] userfaultfd: remove set but not used variable 'h'
  2019-10-10  3:42         ` Mike Kravetz
@ 2019-10-10  3:53           ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2019-10-10  3:53 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: Wei Yang, YueHaibing, Andrea Arcangeli, Joel Fernandes (Google),
	Andrew Morton, Stephen Rothwell, Hugh Dickins, linux-mm,
	linux-kernel, kernel-janitors

On Wed, Oct 09, 2019 at 08:42:46PM -0700, Mike Kravetz wrote:
>On 10/9/19 8:30 PM, Wei Yang wrote:
>> On Wed, Oct 09, 2019 at 07:25:18PM -0700, Mike Kravetz wrote:
>>> On 10/9/19 6:23 PM, Wei Yang wrote:
>>>> On Wed, Oct 09, 2019 at 05:45:57PM -0700, Mike Kravetz wrote:
>>>>> On 10/9/19 5:27 AM, YueHaibing wrote:
>>>>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>>>>
>>>>>> mm/userfaultfd.c: In function '__mcopy_atomic_hugetlb':
>>>>>> mm/userfaultfd.c:217:17: warning:
>>>>>>  variable 'h' set but not used [-Wunused-but-set-variable]
>>>>>>
>>>>>> It is not used since commit 78911d0e18ac ("userfaultfd: use vma_pagesize
>>>>>> for all huge page size calculation")
>>>>>>
>>>>>
>>>>> Thanks!  That should have been removed with the recent cleanups.
>>>>>
>>>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>>>
>>>>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
>>>>
>>>> If I am correct, this is removed in a recent patch.
>>>
>>> I'm having a hard time figuring out what is actually in the latest mmotm
>>> tree.  Andrew added a build fixup patch ab169389eb5 in linux-next which
>>> adds the reference to h.  Is there a patch after that to remove the reference?
>>>
>> 
>> I checked linux-next tree, this commit removes the reference.
>> 
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=add4eaeef3766b7491d70d473c48c0b6d6ca5cb7
>> 
>
>Yes, but unless I am mistaken this adds it back,
>
>https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ab169389eb5ff9da7113a21737574edc6d22c072
>

Oops, we may leave this to Andrew.

>-- 
>Mike Kravetz

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-10  3:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 12:27 [PATCH -next] userfaultfd: remove set but not used variable 'h' YueHaibing
2019-10-10  0:45 ` Mike Kravetz
2019-10-10  1:23   ` Wei Yang
2019-10-10  2:25     ` Mike Kravetz
2019-10-10  3:30       ` Wei Yang
2019-10-10  3:42         ` Mike Kravetz
2019-10-10  3:53           ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).