All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown()
@ 2019-01-20  8:12 Yang Fan
  2019-01-20  8:13 ` [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' " Yang Fan
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yang Fan @ 2019-01-20  8:12 UTC (permalink / raw)
  To: akpm, will.deacon; +Cc: Yang Fan, linux-mm, linux-kernel

This patchset remove some redundancy in function 
arch_get_unmapped_area_topdown().

[PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' in 
arch_get_unmapped_area_topdown()
[PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer 
parameters

Yang Fan (2):
  mm/mmap.c: Remove redundant variable 'addr' in
    arch_get_unmapped_area_topdown()
  mm/mmap.c: Remove redundant const qualifier of the no-pointer
    parameters

 mm/mmap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' in arch_get_unmapped_area_topdown()
  2019-01-20  8:12 [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Yang Fan
@ 2019-01-20  8:13 ` Yang Fan
  2019-01-23 14:09   ` William Kucharski
  2019-01-20  8:13 ` [PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer parameters Yang Fan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Yang Fan @ 2019-01-20  8:13 UTC (permalink / raw)
  To: akpm, will.deacon; +Cc: Yang Fan, linux-mm, linux-kernel

The variable 'addr' is redundant in arch_get_unmapped_area_topdown(), 
just use parameter 'addr0' directly. Then remove the const qualifier 
of the parameter, and change its name to 'addr'.

Signed-off-by: Yang Fan <nullptr.cpp@gmail.com>
---
 mm/mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index f901065c4c64..f2d163ac827a 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2126,13 +2126,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
  */
 #ifndef HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 unsigned long
-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 			  const unsigned long len, const unsigned long pgoff,
 			  const unsigned long flags)
 {
 	struct vm_area_struct *vma, *prev;
 	struct mm_struct *mm = current->mm;
-	unsigned long addr = addr0;
 	struct vm_unmapped_area_info info;
 	const unsigned long mmap_end = arch_get_mmap_end(addr);
 
-- 
2.17.1


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

* [PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer parameters
  2019-01-20  8:12 [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Yang Fan
  2019-01-20  8:13 ` [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' " Yang Fan
@ 2019-01-20  8:13 ` Yang Fan
  2019-01-20 17:09 ` [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Mike Rapoport
  2019-01-27  4:11 ` [PATCH v2] " Yang Fan
  3 siblings, 0 replies; 6+ messages in thread
From: Yang Fan @ 2019-01-20  8:13 UTC (permalink / raw)
  To: akpm, will.deacon; +Cc: Yang Fan, linux-mm, linux-kernel

In according with other functions, remove the const qualifier of the 
no-pointer parameters in function arch_get_unmapped_area_topdown().

Signed-off-by: Yang Fan <nullptr.cpp@gmail.com>
---
 mm/mmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index f2d163ac827a..84cdde125d4d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2127,8 +2127,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 #ifndef HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 unsigned long
 arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
-			  const unsigned long len, const unsigned long pgoff,
-			  const unsigned long flags)
+			  unsigned long len, unsigned long pgoff,
+			  unsigned long flags)
 {
 	struct vm_area_struct *vma, *prev;
 	struct mm_struct *mm = current->mm;
-- 
2.17.1


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

* Re: [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown()
  2019-01-20  8:12 [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Yang Fan
  2019-01-20  8:13 ` [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' " Yang Fan
  2019-01-20  8:13 ` [PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer parameters Yang Fan
@ 2019-01-20 17:09 ` Mike Rapoport
  2019-01-27  4:11 ` [PATCH v2] " Yang Fan
  3 siblings, 0 replies; 6+ messages in thread
From: Mike Rapoport @ 2019-01-20 17:09 UTC (permalink / raw)
  To: Yang Fan; +Cc: akpm, will.deacon, linux-mm, linux-kernel

Hi,

On Sun, Jan 20, 2019 at 09:12:26AM +0100, Yang Fan wrote:
> This patchset remove some redundancy in function 
> arch_get_unmapped_area_topdown().
> 
> [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' in 
> arch_get_unmapped_area_topdown()
> [PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer 
> parameters
> 
> Yang Fan (2):
>   mm/mmap.c: Remove redundant variable 'addr' in
>     arch_get_unmapped_area_topdown()
>   mm/mmap.c: Remove redundant const qualifier of the no-pointer
>     parameters

I think it would be better to merge these patches into one.
For the merged patch feel free to add

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
 
>  mm/mmap.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> -- 
> 2.17.1
> 

-- 
Sincerely yours,
Mike.


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

* Re: [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' in arch_get_unmapped_area_topdown()
  2019-01-20  8:13 ` [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' " Yang Fan
@ 2019-01-23 14:09   ` William Kucharski
  0 siblings, 0 replies; 6+ messages in thread
From: William Kucharski @ 2019-01-23 14:09 UTC (permalink / raw)
  To: Yang Fan; +Cc: Andrew Morton, will.deacon, linux-mm, linux-kernel



> On Jan 20, 2019, at 1:13 AM, Yang Fan <nullptr.cpp@gmail.com> wrote:
> 
> The variable 'addr' is redundant in arch_get_unmapped_area_topdown(), 
> just use parameter 'addr0' directly. Then remove the const qualifier 
> of the parameter, and change its name to 'addr'.
> 
> Signed-off-by: Yang Fan <nullptr.cpp@gmail.com>

These seem similar enough I question whether they really need to be two
distinct patches, given both involve removing const keywords from the same
routine, and the shift to using the passed addr directly rather than
declaring and assigning addr from addr0 is a direct consequence of
removing the const.

I could be wrong though and easily persuaded otherwise.


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

* [PATCH v2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown()
  2019-01-20  8:12 [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Yang Fan
                   ` (2 preceding siblings ...)
  2019-01-20 17:09 ` [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Mike Rapoport
@ 2019-01-27  4:11 ` Yang Fan
  3 siblings, 0 replies; 6+ messages in thread
From: Yang Fan @ 2019-01-27  4:11 UTC (permalink / raw)
  To: rppt, william.kucharski, akpm, will.deacon
  Cc: Yang Fan, linux-mm, linux-kernel

The variable 'addr' is redundant in arch_get_unmapped_area_topdown(), 
just use parameter 'addr0' directly. Then remove the const qualifier 
of the parameter, and change its name to 'addr'.

And in according with other functions, remove the const qualifier of all 
other no-pointer parameters in function arch_get_unmapped_area_topdown().

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Yang Fan <nullptr.cpp@gmail.com>
---
Changes in v2:
  - Merge the two patches into one.

 mm/mmap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index f901065c4c64..84cdde125d4d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2126,13 +2126,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
  */
 #ifndef HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 unsigned long
-arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-			  const unsigned long len, const unsigned long pgoff,
-			  const unsigned long flags)
+arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
+			  unsigned long len, unsigned long pgoff,
+			  unsigned long flags)
 {
 	struct vm_area_struct *vma, *prev;
 	struct mm_struct *mm = current->mm;
-	unsigned long addr = addr0;
 	struct vm_unmapped_area_info info;
 	const unsigned long mmap_end = arch_get_mmap_end(addr);
 
-- 
2.17.1


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

end of thread, other threads:[~2019-01-27  4:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-20  8:12 [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Yang Fan
2019-01-20  8:13 ` [PATCH 1/2] mm/mmap.c: Remove redundant variable 'addr' " Yang Fan
2019-01-23 14:09   ` William Kucharski
2019-01-20  8:13 ` [PATCH 2/2] mm/mmap.c: Remove redundant const qualifier of the no-pointer parameters Yang Fan
2019-01-20 17:09 ` [PATCH 0/2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Mike Rapoport
2019-01-27  4:11 ` [PATCH v2] " Yang Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.