Skip to contentSkip to conversation

Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

PATCH In review Benjamin Young 2 participants 3 messages Dec 9, 2015 – Dec 10, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

Quoted 1 line

From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001

From: Benjamin Young <[email protected]>
Date: Wed, 9 Dec 2015 13:45:00 -0800
Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
goldfish_audio.c

---
 drivers/staging/goldfish/goldfish_audio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/goldfish/goldfish_audio.c +4 -4
index b0927e4..364fdcd 100644
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr)		(readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x)	(writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)	\
-	(gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+	(gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
@@ -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
#1 lore raw
Quoted 5 lines · Benjamin Young

From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
From: Benjamin Young <[email protected]>
Date: Wed, 9 Dec 2015 13:45:00 -0800
Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
goldfish_audio.c

This should not be here.
You have not given in commit message and you are doing multiple changes in this patch. Please split them into separate patch, each patch doing only a single type of change.

regards
sudip

#2 lore raw
Quoted 7 lines · Sudip Mukherjee
Quoted 5 lines · Benjamin Young

From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
From: Benjamin Young <[email protected]>
Date: Wed, 9 Dec 2015 13:45:00 -0800
Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
goldfish_audio.c

Quoted 7 lines

This should not be here.
You have not given in commit message and you are doing multiple changes in this patch. Please split them into separate patch, each patch doing only a single type of change.

regards
sudip

Thanks Sudip I will fix this by creating two new patches.
One for the comparison to null checks and the other for space between operators.

Was there anything else which I could improve on for this commit?

Thanks,
Benjamin