Skip to contentSkip to conversation

GPU-DRM-Etnaviv: Fine-tuning for two function implementations

PATCH New SF Markus Elfring 1 participant 3 messages May 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover GPU-DRM-Etnaviv: Fine-tuning for two function implementations

From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 13:16:15 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Use seq_putc() in etnaviv_buffer_dump()
Delete an error message for a failed memory allocation in etnaviv_bind()

 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
2.12.2
#1 lore raw

PATCH 1/2 drm/etnaviv: Use seq_putc() in etnaviv_buffer_dump()

From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 13:00:28 +0200

Two single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +2 -2
index 5255278dde56..b4deb26e1e40 100644
@@ -182,12 +182,12 @@ static void etnaviv_buffer_dump(struct etnaviv_gpu *gpu, struct seq_file *m)
 
 	for (i = 0; i < size / 4; i++) {
 		if (i && !(i % 4))
-			seq_puts(m, "\n");
+			seq_putc(m, '\n');
 		if (i % 4 = 0)
 			seq_printf(m, "\t0x%p: ", ptr + i);
 		seq_printf(m, "%08x ", *(ptr + i));
 	}
-	seq_puts(m, "\n");
+	seq_putc(m, '\n');
 }
 
 static int etnaviv_ring_show(struct etnaviv_gpu *gpu, struct seq_file *m)
Signature · 1 line
2.12.2
#2 lore raw

PATCH 2/2 drm/etnaviv: Delete an error message for a failed memory allocation in etnaviv_bind()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 8 May 2017 13:08:11 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a statement here.

---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +0 -1
index b4deb26e1e40..b121473622d0 100644
@@ -530,7 +530,6 @@ static int etnaviv_bind(struct device *dev)
 
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	if (!priv) {
-		dev_err(dev, "failed to allocate private data\n");
 		ret = -ENOMEM;
 		goto out_unref;
 	}
Signature · 1 line
2.12.2