* [PATCH] mm/gup.c: Remove unused write variable
@ 2019-02-09 17:31 ira.weiny
2019-02-10 19:39 ` Thomas Gleixner
2019-02-10 22:34 ` [PATCH V2] mm/gup: Remove write argument in gup_fast_permitted() ira.weiny
0 siblings, 2 replies; 4+ messages in thread
From: ira.weiny @ 2019-02-09 17:31 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, linux-kernel,
linux-mm
Cc: Kirill A. Shutemov, Dave Hansen, Andrew Morton, Dan Williams,
Ira Weiny
From: Ira Weiny <ira.weiny@intel.com>
write is unused in gup_fast_permitted so remove it.
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
arch/x86/include/asm/pgtable_64.h | 3 +--
mm/gup.c | 6 +++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 9c85b54bf03c..0bb566315621 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -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;
diff --git a/mm/gup.c b/mm/gup.c
index 05acd7e2eb22..b63e88eca31b 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -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();
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/gup.c: Remove unused write variable
2019-02-09 17:31 [PATCH] mm/gup.c: Remove unused write variable ira.weiny
@ 2019-02-10 19:39 ` Thomas Gleixner
2019-02-10 22:29 ` Ira Weiny
2019-02-10 22:34 ` [PATCH V2] mm/gup: Remove write argument in gup_fast_permitted() ira.weiny
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2019-02-10 19:39 UTC (permalink / raw)
To: Ira Weiny
Cc: Ingo Molnar, Borislav Petkov, x86, linux-kernel, linux-mm,
Kirill A. Shutemov, Dave Hansen, Andrew Morton, Dan Williams
Ira,
On Sat, 9 Feb 2019, ira.weiny@intel.com wrote:
nice patch. Just a few nitpicks vs. the subject and the change log.
> 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.
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/gup.c: Remove unused write variable
2019-02-10 19:39 ` Thomas Gleixner
@ 2019-02-10 22:29 ` Ira Weiny
0 siblings, 0 replies; 4+ messages in thread
From: Ira Weiny @ 2019-02-10 22:29 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Ingo Molnar, Borislav Petkov, x86, linux-kernel, linux-mm,
Kirill A. Shutemov, Dave Hansen, Andrew Morton, Dan Williams
On Sun, Feb 10, 2019 at 08:39:44PM +0100, Thomas Gleixner wrote:
> Ira,
>
> On Sat, 9 Feb 2019, ira.weiny@intel.com wrote:
>
> nice patch. Just a few nitpicks vs. the subject and the change log.
>
> > Subject: [PATCH] mm/gup.c: Remove unused write variable
>
> We usually avoid filenames in the subsystem prefix. mm/gup: is sufficient.
Thanks.
>
> 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.
>
> > 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
>
> Thanks,
>
> tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH V2] mm/gup: Remove write argument in gup_fast_permitted()
2019-02-09 17:31 [PATCH] mm/gup.c: Remove unused write variable ira.weiny
2019-02-10 19:39 ` Thomas Gleixner
@ 2019-02-10 22:34 ` ira.weiny
1 sibling, 0 replies; 4+ messages in thread
From: ira.weiny @ 2019-02-10 22:34 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, linux-kernel,
linux-mm
Cc: Kirill A. Shutemov, Dave Hansen, Andrew Morton, Dan Williams,
Ira Weiny
From: Ira Weiny <ira.weiny@intel.com>
The write argument is unused in gup_fast_permitted() so remove it.
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
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(-)
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 9c85b54bf03c..0bb566315621 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -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;
diff --git a/mm/gup.c b/mm/gup.c
index 05acd7e2eb22..b63e88eca31b 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -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();
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-10 22:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-09 17:31 [PATCH] mm/gup.c: Remove unused write variable ira.weiny
2019-02-10 19:39 ` Thomas Gleixner
2019-02-10 22:29 ` Ira Weiny
2019-02-10 22:34 ` [PATCH V2] mm/gup: Remove write argument in gup_fast_permitted() ira.weiny
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).