Skip to contentSkip to conversation

mm: memory: fixed a coding style issue

PATCH In review Robert Donald Rickett 2 participants 4 messages Jan 16, 2018 1 message not in the archive

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

PATCH 1/1 mm: memory: fixed a coding style issue

This is a patch to the memory.c file that fixes the "ERROR: code indent should use tabs where possible" found by the checkpatch.pl tool.

---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +0 -0
index ca5674cbaff2..e9f6e58aa77c 100644
@@ -1663,7 +1663,7 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,

unsigned long size)

 {
	if (address < vma->vm_start || address + size > vma->vm_end ||
-			!(vma->vm_flags & VM_PFNMAP))
+			!(vma->vm_flags & VM_PFNMAP))
		return -1;
	zap_page_range_single(vma, address, size, NULL);
	return 0;

--
2.14.1

#1 lore raw
Quoted 3 lines · Robert Donald Rickett

This is a patch to the memory.c file that fixes the "ERROR: code indent should use tabs where possible" found by the checkpatch.pl tool.

Is this really worth it? The code is not any better readable and it just adds a churn to the history and makes life of anybody using git blame slightly more harder. So what is the benefit?

Quoted 20 lines
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +1 -2
index ca5674cbaff2..e9f6e58aa77c 100644
@@ -1663,7 +1663,7 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
 		unsigned long size)
 {
 	if (address < vma->vm_start || address + size > vma->vm_end ||
-			!(vma->vm_flags & VM_PFNMAP))
+			!(vma->vm_flags & VM_PFNMAP))
 		return -1;
 	zap_page_range_single(vma, address, size, NULL);
 	return 0;
--

2.14.1

Signature · 2 lines
Michal Hocko
SUSE Labs

A message that is not in the archive (sent off-list or not yet received): CAE+eAWQEE4FArcspdbZXr=VwpSZ=23hBm7EXByKimPQiNiFKhQ@mail.gmail.com

#3 lore raw

[Please do not top post. I also think you didn't intend to drop the CC list - restored]

Quoted 51 lines · Robert Rickett

Michal,

Although tiny changes like this are minuscule, they are relevant to the
big picture. If developers create a tool that informs contributors of an
error in the code, but then says "I'm aware of the error, but it's not
worth fixing", what's the point of programming the tool to warn the end-user
in the first place? Why not just say "We want you to use tabs, but it's
okay not to if you don't feel like it"? Either way, Thank You for taking
the time to respond and have a great day!

Robert
Rickett

Quoted 35 lines · Michal Hocko
Quoted 3 lines · Robert Donald Rickett

This is a patch to the memory.c file that fixes the "ERROR: code indent should use tabs where possible" found by the checkpatch.pl tool.

Is this really worth it? The code is not any better readable and it just adds a churn to the history and makes life of anybody using git blame slightly more harder. So what is the benefit?

mm/memory.c int zap_vma_ptes(struct vm_area_struct *vma,

Quoted 10 lines
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +0 -0
index ca5674cbaff2..e9f6e58aa77c 100644
@@ -1663,7 +1663,7 @@ int zap_vma_ptes(struct vm_area_struct *vma,

unsigned long address,

Quoted 10 lines
mm/memory.c +1 -2
              unsigned long size)
 {
      if (address < vma->vm_start || address + size > vma->vm_end ||
-                     !(vma->vm_flags & VM_PFNMAP))
+                     !(vma->vm_flags & VM_PFNMAP))
              return -1;
      zap_page_range_single(vma, address, size, NULL);
      return 0;
--

2.14.1

--
Michal Hocko
SUSE Labs

Signature · 2 lines
Michal Hocko
SUSE Labs
#4 lore raw

And now with a response as a bonus...

Quoted 11 lines · Michal Hocko

[Please do not top post. I also think you didn't intend to drop the CC list - restored]

Quoted 7 lines · Robert Rickett

Michal,

Although tiny changes like this are minuscule, they are relevant to the
big picture. If developers create a tool that informs contributors of an
error in the code, but then says "I'm aware of the error, but it's not
worth fixing", what's the point of programming the tool to warn the end-user
in the first place?i

This tool is mostly to keep code consistent. And there is a certain value in that, no questions about that. And newly added code should use it as a guidance in many cases. But changing and already existing code without touching that area for other useful changes is mostly a code churn which increases chances of merge conflicts. People should also not underestimate git blame part. It is really tedious to jump over many commits just to skip over those that are mostly unrelated. Been there done that...

Quoted 3 lines
Quoted 3 lines

Why not just say "We want you to use tabs, but it's
okay not to if you don't feel like it"? Either way, Thank You for taking
the time to respond and have a great day!

This is not about tabs vs. spaces. It is more about checkpatch giving you hints which are good to follow but they are not _rules_ to follow blindly. Like for any change also checkpatch driven ones should have a reasonable justification. E.g. a better readability etc...

Quoted 45 lines
Quoted 41 lines

Robert
Rickett

Quoted 35 lines · Michal Hocko
Quoted 3 lines · Robert Donald Rickett

This is a patch to the memory.c file that fixes the "ERROR: code indent should use tabs where possible" found by the checkpatch.pl tool.

Is this really worth it? The code is not any better readable and it just adds a churn to the history and makes life of anybody using git blame slightly more harder. So what is the benefit?

mm/memory.c int zap_vma_ptes(struct vm_area_struct *vma,

Quoted 10 lines
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +0 -0
index ca5674cbaff2..e9f6e58aa77c 100644
@@ -1663,7 +1663,7 @@ int zap_vma_ptes(struct vm_area_struct *vma,

unsigned long address,

Quoted 10 lines
mm/memory.c +1 -2
              unsigned long size)
 {
      if (address < vma->vm_start || address + size > vma->vm_end ||
-                     !(vma->vm_flags & VM_PFNMAP))
+                     !(vma->vm_flags & VM_PFNMAP))
              return -1;
      zap_page_range_single(vma, address, size, NULL);
      return 0;
--

2.14.1

--
Michal Hocko
SUSE Labs

Signature · 2 lines
Michal Hocko
SUSE Labs
Signature · 2 lines
Michal Hocko
SUSE Labs