Skip to contentSkip to conversation

mm/gup.c: Remove unused write variable

PATCH In review [email protected] 3 participants 5 messages Feb 9, 2019 – Feb 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/gup.c: Remove unused write variable

From: Ira Weiny <[email protected]>

write is unused in gup_fast_permitted so remove it.

---
 arch/x86/include/asm/pgtable_64.h | 3 +--
 mm/gup.c                          | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/include/asm/pgtable_64.h +1 -2
index 9c85b54bf03c..0bb566315621 100644
@@ -259,8 +259,7 @@ extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
 extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
 
 #define gup_fast_permitted gup_fast_permitted
-static inline bool gup_fast_permitted(unsigned long start, int nr_pages,
-		int write)
+static inline bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
mm/gup.c +3 -3
index 05acd7e2eb22..b63e88eca31b 100644
@@ -1786,7 +1786,7 @@ static void gup_pgd_range(unsigned long addr, unsigned long end,
  * Check if it's allowed to use __get_user_pages_fast() for the range, or
  * we need to fall back to the slow version:
  */
-bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
+bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
@@ -1828,7 +1828,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	 * block IPIs that come from THPs splitting.
 	 */
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_save(flags);
 		gup_pgd_range(start, end, write, pages, &nr);
 		local_irq_restore(flags);
@@ -1870,7 +1870,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	if (unlikely(!access_ok((void __user *)start, len)))
 		return -EFAULT;
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_disable();
 		gup_pgd_range(addr, end, write, pages, &nr);
 		local_irq_enable();
Signature · 1 line
2.20.1
#1 lore raw

Ira,

On Sat, 9 Feb 2019, [email protected] wrote:

nice patch. Just a few nitpicks vs. the subject and the change log.

Quoted 1 line

Subject: [PATCH] mm/gup.c: Remove unused write variable

We usually avoid filenames in the subsystem prefix. mm/gup: is sufficient.

But what's a bit more confusing is 'write variable'. You are not removing a variable, you are removing a unused function argument. That's two different things.

Quoted 1 line

write is unused in gup_fast_permitted so remove it.

When referencing functions please use brackets so it's clear that you talk about a function, i.e. gup_fast_permitted().

So the correct subject line would be:

Subject: [PATCH] mm/gup: Remove write argument from gup_fast_permitted()

Thanks,

tglx

author
#2 lore raw
Quoted 9 lines · Thomas Gleixner

Ira,

On Sat, 9 Feb 2019, [email protected] wrote:

nice patch. Just a few nitpicks vs. the subject and the change log.

Quoted 1 line

Subject: [PATCH] mm/gup.c: Remove unused write variable

We usually avoid filenames in the subsystem prefix. mm/gup: is sufficient.

Thanks.

Quoted 4 lines

But what's a bit more confusing is 'write variable'. You are not removing a variable, you are removing a unused function argument. That's two different things.

Indeed my mistake.

Quoted 9 lines
Quoted 2 lines

write is unused in gup_fast_permitted so remove it.

When referencing functions please use brackets so it's clear that you talk about a function, i.e. gup_fast_permitted().

So the correct subject line would be:

Subject: [PATCH] mm/gup: Remove write argument from gup_fast_permitted()

NP, V2 on its way,
Ira

Quoted 4 lines

Thanks,

tglx

#3 lore raw

PATCH v2 1/1 mm/gup: Remove write argument in gup_fast_permitted()

In reply to [email protected]

From: Ira Weiny <[email protected]>

The write argument is unused in gup_fast_permitted() so remove it.

---
Changes since V1
Clean up commit message

 arch/x86/include/asm/pgtable_64.h | 3 +--
 mm/gup.c                          | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/include/asm/pgtable_64.h +1 -2
index 9c85b54bf03c..0bb566315621 100644
@@ -259,8 +259,7 @@ extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
 extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
 
 #define gup_fast_permitted gup_fast_permitted
-static inline bool gup_fast_permitted(unsigned long start, int nr_pages,
-		int write)
+static inline bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
mm/gup.c +3 -3
index 05acd7e2eb22..b63e88eca31b 100644
@@ -1786,7 +1786,7 @@ static void gup_pgd_range(unsigned long addr, unsigned long end,
  * Check if it's allowed to use __get_user_pages_fast() for the range, or
  * we need to fall back to the slow version:
  */
-bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
+bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
@@ -1828,7 +1828,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	 * block IPIs that come from THPs splitting.
 	 */
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_save(flags);
 		gup_pgd_range(start, end, write, pages, &nr);
 		local_irq_restore(flags);
@@ -1870,7 +1870,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	if (unlikely(!access_ok((void __user *)start, len)))
 		return -EFAULT;
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_disable();
 		gup_pgd_range(addr, end, write, pages, &nr);
 		local_irq_enable();
Signature · 1 line
2.20.1
#4 lore raw

[tip:x86/mm] mm/gup: Remove the 'write' parameter from gup_fast_permitted()

mm/gup: Remove the 'write' parameter from gup_fast_permitted()
Commit-ID:  ad8cfb9c42ef83ecf4079bc7d77e6557648e952b
Gitweb:     https://git.kernel.org/tip/ad8cfb9c42ef83ecf4079bc7d77e6557648e952b
Author:     Ira Weiny <[email protected]>
AuthorDate: Sun, 10 Feb 2019 14:34:24 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 11 Feb 2019 08:20:40 +0100

mm/gup: Remove the 'write' parameter from gup_fast_permitted()

The 'write' parameter is unused in gup_fast_permitted() so remove it.

---
 arch/x86/include/asm/pgtable_64.h | 3 +--
 mm/gup.c                          | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/include/asm/pgtable_64.h +1 -2
index 9c85b54bf03c..0bb566315621 100644
@@ -259,8 +259,7 @@ extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
 extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
 
 #define gup_fast_permitted gup_fast_permitted
-static inline bool gup_fast_permitted(unsigned long start, int nr_pages,
-		int write)
+static inline bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
mm/gup.c +3 -3
index 05acd7e2eb22..b63e88eca31b 100644
@@ -1786,7 +1786,7 @@ static void gup_pgd_range(unsigned long addr, unsigned long end,
  * Check if it's allowed to use __get_user_pages_fast() for the range, or
  * we need to fall back to the slow version:
  */
-bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
+bool gup_fast_permitted(unsigned long start, int nr_pages)
 {
 	unsigned long len, end;
 
@@ -1828,7 +1828,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	 * block IPIs that come from THPs splitting.
 	 */
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_save(flags);
 		gup_pgd_range(start, end, write, pages, &nr);
 		local_irq_restore(flags);
@@ -1870,7 +1870,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	if (unlikely(!access_ok((void __user *)start, len)))
 		return -EFAULT;
 
-	if (gup_fast_permitted(start, nr_pages, write)) {
+	if (gup_fast_permitted(start, nr_pages)) {
 		local_irq_disable();
 		gup_pgd_range(addr, end, write, pages, &nr);
 		local_irq_enable();