Skip to contentSkip to conversation

ssb: driver_gige: use true and false for boolean values

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Aug 5, 2018 – Aug 9, 2018 Sonics silicon backplane driver (ssb)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ssb: driver_gige: use true and false for boolean values

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

---
 drivers/ssb/driver_gige.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ssb/driver_gige.c +1 -1
index e973405..ebee6b0 100644
@@ -242,7 +242,7 @@ static int ssb_gige_probe(struct ssb_device *sdev,
 bool pdev_is_ssb_gige_core(struct pci_dev *pdev)
 {
 	if (!pdev->resource[0].name)
-		return 0;
+		return false;
 	return (strcmp(pdev->resource[0].name, SSB_GIGE_MEM_RES_NAME) == 0);
 }
 EXPORT_SYMBOL(pdev_is_ssb_gige_core);
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Sat, 4 Aug 2018 19:04:53 -0500 "Gustavo A. R. Silva"…

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

---
 drivers/ssb/driver_gige.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ssb/driver_gige.c +0 -0
index e973405..ebee6b0 100644

drivers/ssb/driver_gige.c static int ssb_gige_probe(struct ssb_device *sdev, · line 248

Quoted 8 lines
drivers/ssb/driver_gige.c +1 -1
@@ -242,7 +242,7 @@ static int ssb_gige_probe(struct ssb_device *sdev,
 bool pdev_is_ssb_gige_core(struct pci_dev *pdev)
 {
 	if (!pdev->resource[0].name)
-		return 0;
+		return false;
 	return (strcmp(pdev->resource[0].name, SSB_GIGE_MEM_RES_NAME) == 0);
 }
 EXPORT_SYMBOL(pdev_is_ssb_gige_core);

Looks good. Thanks.

Signature · 1 line
Michael
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 7 lines · Gustavo A. R. Silva

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

Patch applied to wireless-drivers-next.git, thanks.

c7743c428111 ssb: driver_gige: use true and false for boolean values

Signature · 3 lines
https://patchwork.kernel.org/patch/10555985/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches