public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: goldfish: Fix minor coding style
@ 2014-12-13 16:29 Loic Pefferkorn
  2014-12-13 17:55 ` Jeremiah Mahler
  2014-12-13 19:07 ` [PATCH] staging: goldfish: Fix minor coding style One Thousand Gnomes
  0 siblings, 2 replies; 14+ messages in thread
From: Loic Pefferkorn @ 2014-12-13 16:29 UTC (permalink / raw)
  To: gregkh, alan, jun.j.tian, octavian.purdila, nnk; +Cc: devel, linux-kernel

Hello,

The convention for checking for NULL pointers is !ptr and not ptr == NULL.
This patch fixes such occurences in goldfish driver, it applies against next-20141212


Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
---
 drivers/staging/goldfish/goldfish_audio.c |  8 ++++----
 drivers/staging/goldfish/goldfish_nand.c  | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index f200359..7ab034b 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -273,19 +273,19 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	dma_addr_t buf_addr;
 
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (data == NULL)
+	if (!data)
 		return -ENOMEM;
 	spin_lock_init(&data->lock);
 	init_waitqueue_head(&data->wait);
 	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;
 	}
diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c
index d68f216..8e8e594 100644
--- a/drivers/staging/goldfish/goldfish_nand.c
+++ b/drivers/staging/goldfish/goldfish_nand.c
@@ -48,7 +48,7 @@ static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd,
 	struct cmd_params *cps = nand->cmd_params;
 	unsigned char __iomem  *base = nand->base;
 
-	if (cps == NULL)
+	if (!cps)
 		return -1;
 
 	switch (cmd) {
@@ -330,7 +330,7 @@ static int goldfish_nand_init_device(struct platform_device *pdev,
 	mtd->priv = nand;
 
 	name = devm_kzalloc(&pdev->dev, name_len + 1, GFP_KERNEL);
-	if (name == NULL)
+	if (!name)
 		return -ENOMEM;
 	mtd->name = name;
 
@@ -379,11 +379,11 @@ static int goldfish_nand_probe(struct platform_device *pdev)
 	unsigned char __iomem  *base;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (r == NULL)
+	if (!r)
 		return -ENODEV;
 
 	base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
-	if (base == NULL)
+	if (!base)
 		return -ENOMEM;
 
 	version = readl(base + NAND_VERSION);
@@ -399,7 +399,7 @@ static int goldfish_nand_probe(struct platform_device *pdev)
 
 	nand = devm_kzalloc(&pdev->dev, sizeof(*nand) +
 				sizeof(struct mtd_info) * num_dev, GFP_KERNEL);
-	if (nand == NULL)
+	if (!nand)
 		return -ENOMEM;
 
 	mutex_init(&nand->lock);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-12-16  0:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-13 16:29 [PATCH] staging: goldfish: Fix minor coding style Loic Pefferkorn
2014-12-13 17:55 ` Jeremiah Mahler
2014-12-13 18:22   ` Loic Pefferkorn
2014-12-13 19:46     ` Jeremiah Mahler
2014-12-15 11:44       ` [PATCH] checkpatch giving bogus advice (was staging: goldfish: Fix minor coding style) One Thousand Gnomes
2014-12-15 11:59         ` Dan Carpenter
2014-12-16  0:50           ` Joe Perches
2014-12-15 13:03         ` Jeremiah Mahler
2014-12-15 13:43           ` Dan Carpenter
2014-12-15 14:08             ` Jeremiah Mahler
2014-12-13 19:07 ` [PATCH] staging: goldfish: Fix minor coding style One Thousand Gnomes
2014-12-13 21:20   ` Loic Pefferkorn
2014-12-15 11:51     ` One Thousand Gnomes
2014-12-15 12:26       ` Loic Pefferkorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox