Skip to contentSkip to conversation

arch: x86: kvm: mmu.c: use true/false for bool type

PATCH In review Saurav Girepunje 3 participants 6 messages Oct 29, 2019 – Oct 31, 2019

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

PATCH 1/1 arch: x86: kvm: mmu.c: use true/false for bool type

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +1 -1
index 24c23c66b226..c0b1df69ce0f 100644
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;
 module_param(dbg, bool, 0644);
 
 #define pgprintk(x...) do { if (dbg) printk(x); } while (0)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 12 lines · Saurav Girepunje

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +0 -0
index 24c23c66b226..c0b1df69ce0f 100644

arch/x86/kvm/mmu.c enum { · line 71

Quoted 5 lines
arch/x86/kvm/mmu.c +1 -1
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;

You're actually changing the value from false to true. Please, if you don't know C, don't touch things.

#2 lore raw
Quoted 15 lines · Peter Zijlstra
Quoted 14 lines · Saurav Girepunje

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +0 -0
index 24c23c66b226..c0b1df69ce0f 100644
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
Quoted 6 lines

arch/x86/kvm/mmu.c enum { · line 71

Quoted 3 lines
arch/x86/kvm/mmu.c +1 -1
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;

You're actually changing the value from false to true. Please, if you don't know C, don't touch things.

Hi,

Thanks for your review.
I accept that I have given wrong value "true" to debug variable. It's my bad my typo mistake.
I will make sure that I will not touch your exclusive C code where we can assign 0/1 to a bool variable,
As you have given me a free advice, I also request you to please don't review such small patches from newbie to discourage them.

Regards,
Saurav

#3 lore raw
Quoted 22 lines · SAURAV GIREPUNJE
Quoted 15 lines · Peter Zijlstra
Quoted 14 lines · Saurav Girepunje

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +0 -0
index 24c23c66b226..c0b1df69ce0f 100644
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
Quoted 6 lines

arch/x86/kvm/mmu.c enum { · line 71

Quoted 3 lines
arch/x86/kvm/mmu.c +1 -1
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;

You're actually changing the value from false to true. Please, if you don't know C, don't touch things.

Quoted 6 lines

Hi,

Thanks for your review.
I accept that I have given wrong value "true" to debug variable. It's my bad my typo mistake.
I will make sure that I will not touch your exclusive C code where we can assign 0/1 to a bool variable,
As you have given me a free advice, I also request you to please don't review such small patches from newbie to discourage them.

I will most certainly review whatever I want, and clearly it is needed.

#4 lore raw
Quoted 23 lines · Peter Zijlstra
Quoted 22 lines · SAURAV GIREPUNJE
Quoted 21 lines · Peter Zijlstra
Quoted 12 lines · Saurav Girepunje

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +0 -0
index 24c23c66b226..c0b1df69ce0f 100644

arch/x86/kvm/mmu.c enum { · line 71

Quoted 5 lines
arch/x86/kvm/mmu.c +1 -1
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;

You're actually changing the value from false to true. Please, if you don't know C, don't touch things.

Quoted 8 lines
Quoted 6 lines

Hi,

Thanks for your review.
I accept that I have given wrong value "true" to debug variable. It's my bad my typo mistake.
I will make sure that I will not touch your exclusive C code where we can assign 0/1 to a bool variable,
As you have given me a free advice, I also request you to please don't review such small patches from newbie to discourage them.

I will most certainly review whatever I want, and clearly it is needed.

Do you want me to discard this patch or resend ?

maintainer
#5 lore raw
Quoted 26 lines · SAURAV GIREPUNJE
Quoted 25 lines · Peter Zijlstra
Quoted 24 lines · SAURAV GIREPUNJE
Quoted 15 lines · Peter Zijlstra
Quoted 14 lines · Saurav Girepunje

Use true/false for bool type "dbg" in mmu.c

---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu.c +0 -0
index 24c23c66b226..c0b1df69ce0f 100644
@@ -68,7 +68,7 @@ enum {
 #undef MMU_DEBUG
 
Quoted 6 lines

arch/x86/kvm/mmu.c enum { · line 71

Quoted 3 lines
arch/x86/kvm/mmu.c +1 -1
 #ifdef MMU_DEBUG
-static bool dbg = 0;
+static bool dbg = true;

You're actually changing the value from false to true. Please, if you don't know C, don't touch things.

Hi,

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Thanks for your review.
I accept that I have given wrong value "true" to debug variable. It's my bad my typo mistake.
I will make sure that I will not touch your exclusive C code where we can assign 0/1 to a bool variable,
As you have given me a free advice, I also request you to please don't review such small patches from newbie to discourage them.

I will most certainly review whatever I want, and clearly it is needed.

Do you want me to discard this patch or resend ?

Hi Saurav,

In general I would be happy with replacing 0/1 with false/true, but not in this particular case. Despite working on KVM for quite some time I have never found MMU_DEBUG particularly useful, therefore it is going to go away soon and will be replaced with kernel tracepoints; see for example commit 335e192a3fa4 ("KVM: x86: add tracepoints around __direct_map and FNAME(fetch)", 2019-07-05). Therefore, even such a simple change would be very short lived.

Regarding this patch, I for one am happy that Peter caught the problem in your patch. His message was perhaps blunt but also honest; contributing to the kernel requires a very good discipline. I don't want to discourage you from contributing, but I suggest that you look into how you developed the patch (from the idea down to sending it) and figure out how your mistake managed to slip.

Thanks,

Paolo