Skip to contentSkip to conversation

staging: goldfish: Coding Style Fix Comparison to NULL could be written "!r"

PATCH In review Benjamin Young 2 participants 2 messages Dec 11, 2015 – Feb 8, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: goldfish: Coding Style Fix Comparison to NULL could be written "!r"

Fixed coding style for null comparisons in goldfish_audio.c to be more consistant with the rest of the kernel coding style

---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/goldfish/goldfish_audio.c +3 -3
index f1e1838..364fdcd 100644
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, data);
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (r == NULL) {
+	if (!r) {
 		dev_err(&pdev->dev, "platform_get_resource failed\n");
 		return -ENODEV;
 	}
 	data->reg_base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
-	if (data->reg_base == NULL)
+	if (!data->reg_base)
 		return -ENOMEM;
 
 	data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	}
 	data->buffer_virt = dmam_alloc_coherent(&pdev->dev,
 				COMBINED_BUFFER_SIZE, &buf_addr, GFP_KERNEL);
-	if (data->buffer_virt == NULL) {
+	if (!data->buffer_virt) {
 		dev_err(&pdev->dev, "allocate buffer failed\n");
 		return -ENOMEM;
 	}
Signature · 1 line
2.5.0
maintainer
#1 lore raw
Quoted 28 lines · Benjamin Young

Fixed coding style for null comparisons in goldfish_audio.c to be more consistant with the rest of the kernel coding style

---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/goldfish/goldfish_audio.c +2 -2
index f1e1838..364fdcd 100644
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, data);
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (r == NULL) {
+	if (!r) {
 		dev_err(&pdev->dev, "platform_get_resource failed\n");
 		return -ENODEV;
 	}
 	data->reg_base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
-	if (data->reg_base == NULL)
+	if (!data->reg_base)
 		return -ENOMEM;
 
 	data->irq = platform_get_irq(pdev, 0);

drivers/staging/goldfish/goldfish_audio.c static int goldfish_audio_probe(struct platform_device *pdev) · line 301

Quoted 8 lines
drivers/staging/goldfish/goldfish_audio.c +1 -1
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	}
 	data->buffer_virt = dmam_alloc_coherent(&pdev->dev,
 				COMBINED_BUFFER_SIZE, &buf_addr, GFP_KERNEL);
-	if (data->buffer_virt == NULL) {
+	if (!data->buffer_virt) {
 		dev_err(&pdev->dev, "allocate buffer failed\n");
 		return -ENOMEM;
 	}

Same here, someone beat you to it.