Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212740

[PATCH 1/6] fix android/ashmem.c several coding style issues

From Peng Sun <sironhide0null@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/6] fix android/ashmem.c several coding style issues
Date 2015-08-25 09:00 +0200
Message-ID <q1gn8-7jI-7@gated-at.bofh.it> (permalink)
References <q1gn8-7jI-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Corrections based on checkpatch.pl with --strict
1) spaces preferred around that '-'
2) No space is necessary after a case
3) Alignment should match open parenthesis

Signed-off-by: Peng Sun <sironhide0null@gmail.com>
---
 drivers/staging/android/ashmem.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 60200a3..d786ec1 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -618,7 +618,8 @@ static int ashmem_pin(struct ashmem_area *asma, size_t pgstart, size_t pgend)
 
 			/* Case #3: We overlap from the rear, so adjust it */
 			if (range->pgend <= pgend) {
-				range_shrink(range, range->pgstart, pgstart-1);
+				range_shrink(range, range->pgstart,
+					     pgstart - 1);
 				continue;
 			}
 
@@ -715,7 +716,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
 	if (unlikely((pin.offset | pin.len) & ~PAGE_MASK))
 		return -EINVAL;
 
-	if (unlikely(((__u32) -1) - pin.offset < pin.len))
+	if (unlikely(((__u32)-1) - pin.offset < pin.len))
 		return -EINVAL;
 
 	if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len))
@@ -759,7 +760,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		ret = -EINVAL;
 		if (!asma->file) {
 			ret = 0;
-			asma->size = (size_t) arg;
+			asma->size = (size_t)arg;
 		}
 		break;
 	case ASHMEM_GET_SIZE:
@@ -833,16 +834,16 @@ static int __init ashmem_init(void)
 	int ret;
 
 	ashmem_area_cachep = kmem_cache_create("ashmem_area_cache",
-					  sizeof(struct ashmem_area),
-					  0, 0, NULL);
+					       sizeof(struct ashmem_area),
+					       0, 0, NULL);
 	if (unlikely(!ashmem_area_cachep)) {
 		pr_err("failed to create slab cache\n");
 		return -ENOMEM;
 	}
 
 	ashmem_range_cachep = kmem_cache_create("ashmem_range_cache",
-					  sizeof(struct ashmem_range),
-					  0, 0, NULL);
+						sizeof(struct ashmem_range),
+						0, 0, NULL);
 	if (unlikely(!ashmem_range_cachep)) {
 		pr_err("failed to create slab cache\n");
 		return -ENOMEM;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] fix drivers/staging/android several coding issues Peng Sun <sironhide0null@gmail.com> - 2015-08-25 09:00 +0200
  [PATCH 4/6] fix android/sync.c several coding style issues Peng Sun <sironhide0null@gmail.com> - 2015-08-25 09:00 +0200
  [PATCH 1/6] fix android/ashmem.c several coding style issues Peng Sun <sironhide0null@gmail.com> - 2015-08-25 09:00 +0200
    [PATCH 3/6] fix android/sw_sync.c several coding style issues Peng Sun <sironhide0null@gmail.com> - 2015-08-25 09:00 +0200
    [PATCH 2/6] fix android/lowmemorykiller.c several coding style issues Peng Sun <sironhide0null@gmail.com> - 2015-08-25 09:00 +0200
  Re: [PATCH 0/6] fix drivers/staging/android several coding issues Joe Perches <joe@perches.com> - 2015-08-25 17:20 +0200

csiph-web