Skip to contentSkip to conversation

Fix checkpatch.pl warnings

PATCH New bnvandana at gmail.com (Vandana BN) 5 participants 13 messages Apr 26, 2019 – Apr 29, 2019 Staging

lore
Share & tools
lore

bnvandana at gmail.com (Vandana BN)

#0 lore raw

PATCH 1/1 Fix checkpatch.pl warnings

Signed-off-by Vandana BN <bnvandana at gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 Fix checkpatch.pl warnings

Quoted 11 lines · Vandana BN
Signed-off-by Vandana BN <bnvandana at gmail.com>
---
  drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +0 -0
index 0de1e12a676e..3fb09ad45a67 100644

drivers/staging/rtl8723bs/core/rtw_debug.c int proc_get_btcoex_info(struct seq_file *m, void *v) · line 1432

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
  	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
  	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
  		return -ENOMEM;
-	}
 
  	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 

Hi Vandana,

Thanks for the patch. A few things to note:

The commit summary line should include the area and driver.

Instead of "Fix checkpatch.pl warnings", it should say:

"staging: rtl8723bs: Fix checkpatch.pl warnings"

Please include the checkpatch warning in the commit message to tell us more about the reason for this fix.

Please look at a few patches that get posted to Linux kernel mailing lists - you can find them on https://lkml.org/lkml/last100/
for what kind if details should be included in the commit log.

thanks,
-- Shuah

#2 lore raw

PATCH 1/1 Fix checkpatch.pl warnings

Quoted 34 lines · Shuah Khan
Quoted 17 lines · Vandana BN
Signed-off-by Vandana BN <bnvandana at gmail.com>

---
? drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +-- ? 1 file changed, 1 insertion(+), 2 deletions(-)

drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 ????? padapter = (struct adapter *)rtw_netdev_priv(dev);
 ? ????? pbuf = rtw_zmalloc(bufsize);
-??? if (NULL == pbuf) {
+??? if (pbuf == NULL)
 ????????? return -ENOMEM;
-??? }
 ? ????? rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
Quoted 1 line

?

Hi Vandana,

Thanks for the patch. A few things to note:

The commit summary line should include the area and driver.

Instead of "Fix checkpatch.pl warnings", it should say:

"staging: rtl8723bs: Fix checkpatch.pl warnings"

Please include the checkpatch warning in the commit message to tell us more about the reason for this fix.

Quoted 6 lines

Please look at a few patches that get posted to Linux kernel mailing lists - you can find them on https://lkml.org/lkml/last100/
for what kind if details should be included in the commit log.

thanks,
-- Shuah

Thank you.

I have sent another patch adding commit message and changing the subject.

regards,

Vandana.

#3 lore raw

PATCH v2 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

In reply to bnvandana at gmail.com (Vandana BN)

fixed below warnings,
Comparisons should place the constant on the right side of the test braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

------
v2- Edited commit message and subject
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1
#4 lore raw

PATCH v2 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

Quoted 31 lines · Vandana BN

fixed below warnings,
Comparisons should place the constant on the right side of the test braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

------
v2- Edited commit message and subject
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1

Hey!

Your patch subject should briefly describe the changes you are making. It should not be very generic like "fix checkpatch.pl warnings" or "fix sparse warnings".

A good subject would be:
"Place constant on the right"

In your changelog, you can mention the fact that this is a checkpatch.pl warning. Something like:
"This patch fixes the checkpatch.pl warning:
<Whatever the warning was>
"

Read this before submitting your patch:
https://kernelnewbies.org/PatchPhilosophy

This is a great place to begin your patches journey!:
https://kernelnewbies.org/Outreachyfirstpatch

And also did you send this to the appropriate mailing lists?

Use ./scripts/get_maintainer.pl to get the maintainer and mailing list to send this patch to. You ll be sending your patch to Greg again :p as he maintains the staging branch.

Bharath

Quoted 4 lines

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees at lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#5 lore raw

PATCH v2 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

Quoted 47 lines · Bharath Vedartham
Quoted 31 lines · Vandana BN

fixed below warnings,
Comparisons should place the constant on the right side of the test braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

------
v2- Edited commit message and subject
------

---
  drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
  	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
  	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
  		return -ENOMEM;
-	}
 
  	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1

Hey!

Your patch subject should briefly describe the changes you are making. It should not be very generic like "fix checkpatch.pl warnings" or "fix sparse warnings".

A good subject would be:
"Place constant on the right"

In your changelog, you can mention the fact that this is a checkpatch.pl warning. Something like:
"This patch fixes the checkpatch.pl warning:
<Whatever the warning was>
"

Quoted 5 lines

Read this before submitting your patch:
https://kernelnewbies.org/PatchPhilosophy

This is a great place to begin your patches journey!:
https://kernelnewbies.org/Outreachyfirstpatch

Please don't follow Outreachyfirstpatch instructions - even if you do, don't send the patch to OutReachy mailing list and this will be very confusing!!

You should follow the instructions on

https://wiki.linuxfoundation.org/lkmp to send patches.

Quoted 2 lines

And also did you send this to the appropriate mailing lists?

This is fine - the first patch can come just to

linux-kernel-mentees at lists.linuxfoundation.org

Quoted 5 lines

Use ./scripts/get_maintainer.pl to get the maintainer and mailing list to send this patch to. You ll be sending your patch to Greg again :p as he maintains the staging branch.

Greg is on the cc.

thanks,
-- Shuah

#6 lore raw

PATCH v2 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

In reply to Vandana BN
Quoted 19 lines · Vandana BN

fixed below warnings,
Comparisons should place the constant on the right side of the test braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

------
v2- Edited commit message and subject
------

---
  drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +0 -0
index 0de1e12a676e..3fb09ad45a67 100644

drivers/staging/rtl8723bs/core/rtw_debug.c int proc_get_btcoex_info(struct seq_file *m, void *v) · line 1432

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
  	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
  	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
  		return -ENOMEM;
-	}
 
  	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 

Please make the changes to improve the commit log. State what you are changing.

Please go ahead and the patch to the everybody getmaintainers.pl suggests and cc me and linux-kernel-mentees at list.linuxfoundation.org

The same as above for your future patches.

thanks,
-- Shuah

#7 lore raw

PATCH v3 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

In reply to bnvandana at gmail.com (Vandana BN)

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Vandana BN <bnvandana at gmail.com>
------
v2- Edited commit message and subject
v3- Edited commit message
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..3fb09ad45a67 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1
#8 lore raw

PATCH v3 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

Quoted 5 lines · Vandana BN

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

I need a "real name" here, and in the From: line. Unless I am mistaken and your last name is just "BN" and that is how you sign legal documents? If so, please let me know.

Quoted 13 lines

------
v2- Edited commit message and subject
v3- Edited commit message
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +0 -0
index 0de1e12a676e..3fb09ad45a67 100644

drivers/staging/rtl8723bs/core/rtw_debug.c int proc_get_btcoex_info(struct seq_file *m, void *v) · line 1428

Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -1
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)

checkpatch.pl was ok with this? It didn't say to write this line differently after you ran this patch through it?

thanks,

greg k-h

#9 lore raw

PATCH v3 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

Quoted 9 lines · Greg KH
Quoted 5 lines · Vandana BN

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by Vandana BN <bnvandana at gmail.com>

I need a "real name" here, and in the From: line. Unless I am mistaken and your last name is just "BN" and that is how you sign legal documents? If so, please let me know.

Vandana BN is my real and legal name :)

Quoted 23 lines
Quoted 15 lines

------
v2- Edited commit message and subject
v3- Edited commit message
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +0 -0
index 0de1e12a676e..3fb09ad45a67 100644

drivers/staging/rtl8723bs/core/rtw_debug.c int proc_get_btcoex_info(struct seq_file *m, void *v) · line 1428

Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -1
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (pbuf == NULL)

checkpatch.pl was ok with this? It didn't say to write this line differently after you ran this patch through it?

Quoted 3 lines

thanks,

greg k-h

Thanks I had missed looking at CHECK .will resolve and send a new patch.

Regards,

Vandana.

maintainer
#10 lore raw

PATCH v3 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

Quoted 7 lines · Vandana BN
Quoted 5 lines · Greg KH
Quoted 4 lines · Vandana BN

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks

Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Vandana BN <bnvandana at gmail.com>

I need a "real name" here, and in the From: line. Unless I am mistaken and your last name is just "BN" and that is how you sign legal documents? If so, please let me know.

Vandana BN is my real and legal name :)

Ok, thanks, I had to ask :)

greg k-h

#11 lore raw

PATCH v4 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

In reply to bnvandana at gmail.com (Vandana BN)

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks
CHECK: Comparison to NULL could be written "!pbuf"

Signed-off-by: Vandana BN <bnvandana at gmail.com>
------
v2- Edited commit message and subject
v3- Edited commit message
v4- changed NULL check to use !pbuf
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..9f8446ccf771 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (!pbuf)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1
#12 lore raw

PATCH v4 1/1 staging: rtl8723bs: Fix checkpatch.pl warnings

In reply to bnvandana at gmail.com (Vandana BN)

This patch resolves coding style brace warning and constant on right warning.
WARNING: Comparisons should place the constant on the right side of the test
WARNING: braces {} are not necessary for single statement blocks
CHECK: Comparison to NULL could be written "!pbuf"

Signed-off-by: Vandana BN <bnvandana at gmail.com>
------
v2- Edited commit message and subject
v3- Edited commit message
v4- changed NULL check to use !pbuf
------

---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +1 -2
index 0de1e12a676e..9f8446ccf771 100644
@@ -1425,9 +1425,8 @@ int proc_get_btcoex_info(struct seq_file *m, void *v)
 	padapter = (struct adapter *)rtw_netdev_priv(dev);
 
 	pbuf = rtw_zmalloc(bufsize);
-	if (NULL == pbuf) {
+	if (!pbuf)
 		return -ENOMEM;
-	}
 
 	rtw_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
 
Signature · 1 line
2.17.1