mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yannis Damigos <giannis.damigos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: arve@android.com, riandrews@android.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Yannis Damigos <giannis.damigos@gmail.com>
Subject: [PATCH] staging:android:io: Fix multiple styling issues
Date: Thu, 22 Sep 2016 20:55:21 +0300	[thread overview]
Message-ID: <20160922175521.21814-1-giannis.damigos@gmail.com> (raw)

This patch fixes 1 error, 1 warning and 14 checks found by
checkpatch.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
---
 drivers/staging/android/ion/ion_of.c | 49 ++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c
index de0899a..c930416 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -26,17 +26,17 @@
 #include "ion_of.h"
 
 int ion_parse_dt_heap_common(struct device_node *heap_node,
-			struct ion_platform_heap *heap,
-			struct ion_of_heap *compatible)
+			     struct ion_platform_heap *heap,
+			     struct ion_of_heap *compatible)
 {
 	int i;
 
-	for (i = 0; compatible[i].name != NULL; i++) {
+	for (i = 0; compatible[i].name; i++) {
 		if (of_device_is_compatible(heap_node, compatible[i].compat))
 			break;
 	}
 
-	if (compatible[i].name == NULL)
+	if (!compatible[i].name)
 		return -ENODEV;
 
 	heap->id = compatible[i].heap_id;
@@ -47,33 +47,33 @@ int ion_parse_dt_heap_common(struct device_node *heap_node,
 	/* Some kind of callback function pointer? */
 
 	pr_info("%s: id %d type %d name %s align %lx\n", __func__,
-			heap->id, heap->type, heap->name, heap->align);
+		heap->id, heap->type, heap->name, heap->align);
 	return 0;
 }
 
 int ion_setup_heap_common(struct platform_device *parent,
-			struct device_node *heap_node,
-			struct ion_platform_heap *heap)
+			  struct device_node *heap_node,
+			  struct ion_platform_heap *heap)
 {
 	int ret = 0;
 
 	switch (heap->type) {
-		case ION_HEAP_TYPE_CARVEOUT:
-		case ION_HEAP_TYPE_CHUNK:
-			if (heap->base && heap->size)
-				return 0;
-
-			ret = of_reserved_mem_device_init(heap->priv);
-			break;
-		default:
-			break;
+	case ION_HEAP_TYPE_CARVEOUT:
+	case ION_HEAP_TYPE_CHUNK:
+		if (heap->base && heap->size)
+			return 0;
+
+		ret = of_reserved_mem_device_init(heap->priv);
+		break;
+	default:
+		break;
 	}
 
 	return ret;
 }
 
 struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
-					struct ion_of_heap *compatible)
+				       struct ion_of_heap *compatible)
 {
 	int num_heaps, ret;
 	const struct device_node *dt_node = pdev->dev.of_node;
@@ -88,13 +88,13 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
 		return ERR_PTR(-EINVAL);
 
 	heaps = devm_kzalloc(&pdev->dev,
-				sizeof(struct ion_platform_heap)*num_heaps,
-				GFP_KERNEL);
+			     sizeof(struct ion_platform_heap) * num_heaps,
+			     GFP_KERNEL);
 	if (!heaps)
 		return ERR_PTR(-ENOMEM);
 
 	data = devm_kzalloc(&pdev->dev, sizeof(struct ion_platform_data),
-				GFP_KERNEL);
+			    GFP_KERNEL);
 	if (!data)
 		return ERR_PTR(-ENOMEM);
 
@@ -106,7 +106,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
 			return ERR_PTR(ret);
 
 		heap_pdev = of_platform_device_create(node, heaps[i].name,
-							&pdev->dev);
+						      &pdev->dev);
 		if (!pdev)
 			return ERR_PTR(-ENOMEM);
 		heap_pdev->dev.platform_data = &heaps[i];
@@ -119,7 +119,6 @@ struct ion_platform_data *ion_parse_dt(struct platform_device *pdev,
 		i++;
 	}
 
-
 	data->heaps = heaps;
 	data->nr = num_heaps;
 	return data;
@@ -155,14 +154,13 @@ static int rmem_ion_device_init(struct reserved_mem *rmem, struct device *dev)
 	heap->base = rmem->base;
 	heap->base = rmem->size;
 	pr_debug("%s: heap %s base %pa size %pa dev %p\n", __func__,
-			heap->name, &rmem->base, &rmem->size, dev);
+		 heap->name, &rmem->base, &rmem->size, dev);
 	return 0;
 }
 
 static void rmem_ion_device_release(struct reserved_mem *rmem,
-					struct device *dev)
+				    struct device *dev)
 {
-	return;
 }
 
 static const struct reserved_mem_ops rmem_dma_ops = {
@@ -181,5 +179,6 @@ static int __init rmem_ion_setup(struct reserved_mem *rmem)
 	rmem->ops = &rmem_dma_ops;
 	return 0;
 }
+
 RESERVEDMEM_OF_DECLARE(ion, "ion-region", rmem_ion_setup);
 #endif
-- 
2.10.0

             reply	other threads:[~2016-09-22 17:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 17:55 Yannis Damigos [this message]
2016-09-22 18:22 ` Markus Böhme
2016-09-23  8:05   ` [PATCHv2 1/5] staging:android:ion: Fix comparison with NULL giannis.damigos
2016-09-23  8:05     ` [PATCHv2 2/5] staging:android:ion: Fix whitespace issues giannis.damigos
2016-09-23 12:17       ` Greg KH
2016-09-23  8:05     ` [PATCHv2 3/5] staging:android:ion: Fix blank line issues giannis.damigos
2016-09-23 12:17       ` Greg KH
2016-09-23 13:26         ` Yannis Damigos
2016-09-23 15:06           ` Greg KH
2016-09-23  8:05     ` [PATCHv2 4/5] staging:android:ion: Fix switch case indentation giannis.damigos
2016-09-23  8:05     ` [PATCHv2 5/5] staging:android:ion: Fix void function return giannis.damigos
2016-09-23  8:44       ` Greg KH
2016-09-23  9:50         ` [PATCHv3 5/5] staging:android:ion: Remove empty release function Yannis Damigos
2016-09-23 12:06           ` Greg KH
2016-09-23 13:50             ` Yannis Damigos
2016-09-26 10:11             ` Yannis Damigos
2016-09-26 10:24               ` Greg KH
2016-09-26 10:30                 ` Yannis Damigos
2016-09-23 12:18           ` Greg KH
2016-09-27  7:38             ` [PATCHv4 1/4] staging:android:ion: Fix comparison with NULL Yannis Damigos
2016-09-27  7:38               ` [PATCHv4 2/4] staging:android:ion: Fix alignment issues Yannis Damigos
2016-09-27  7:38               ` [PATCHv4 3/4] staging:android:ion: Fix blank line issues Yannis Damigos
2016-09-27  7:38               ` [PATCHv4 4/4] staging:android:ion: Fix whitespace issue Yannis Damigos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922175521.21814-1-giannis.damigos@gmail.com \
    --to=giannis.damigos@gmail.com \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®