Skip to contentSkip to conversation

staging: android: fix checkpatch warnings in ashmem.c

PATCH New Fabian Holler 1 participant 4 messages Jan 7, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: android: fix checkpatch warnings in ashmem.c

Hello,

this patchset fixes the checkpatch.pl warnings in
drivers/staging/android/ashmem.c

regards

Fabian

Fabian Holler (3):
staging: android: fix indentation to match open parenthesis
staging: android: remove unnecessary blank lines after open brace
staging: android: remove unnecessary space after cast

 drivers/staging/android/ashmem.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.3
#1 lore raw

PATCH 1/3 staging: android: fix indentation to match open parenthesis

This patches fixes the following checkpatch.pl warning:
ashmem.c:450: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

---
 drivers/staging/android/ashmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/android/ashmem.c +2 -2
index 8c78527..181a71e 100644
@@ -447,8 +447,8 @@ ashmem_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 		loff_t end = (range->pgend + 1) * PAGE_SIZE;
 
 		vfs_fallocate(range->asma->file,
-				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
-				start, end - start);
+			      FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
+			      start, end - start);
 		range->purged = ASHMEM_WAS_PURGED;
 		lru_del(range);
 
Signature · 1 line
2.1.3
#2 lore raw

PATCH 2/3 staging: android: remove blank lines after open braces

In reply to Fabian Holler

This patch fixes the following checkpatch.pl warnings:
ashmem.c:552: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' ashmem.c:801: CHECK:BRACES: Blank lines aren't necessary after an open brace

---
 drivers/staging/android/ashmem.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/ashmem.c +0 -2
index 181a71e..6b228d9 100644
@@ -549,7 +549,6 @@ static int get_name(struct ashmem_area *asma, void __user *name)
 
 	mutex_lock(&ashmem_mutex);
 	if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0') {
-
 		/*
 		 * Copying only `len', instead of ASHMEM_NAME_LEN, bytes
 		 * prevents us from revealing one user's stack to another.
@@ -798,7 +797,6 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 static long compat_ashmem_ioctl(struct file *file, unsigned int cmd,
 				unsigned long arg)
 {
-
 	switch (cmd) {
 	case COMPAT_ASHMEM_SET_SIZE:
 		cmd = ASHMEM_SET_SIZE;
Signature · 1 line
2.1.3
#3 lore raw

PATCH 3/3 staging: android: remove space after casts

In reply to Fabian Holler

This patch fixes the following checkpatch.pl warnings:
ashmem.c:753: CHECK:SPACING: No space is necessary after a cast ashmem.c:756: CHECK:SPACING: No space is necessary after a cast ashmem.c:777: CHECK:SPACING: No space is necessary after a cast

---
 drivers/staging/android/ashmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/ashmem.c +3 -3
index 6b228d9..d140b733 100644
@@ -750,10 +750,10 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 	switch (cmd) {
 	case ASHMEM_SET_NAME:
-		ret = set_name(asma, (void __user *) arg);
+		ret = set_name(asma, (void __user *)arg);
 		break;
 	case ASHMEM_GET_NAME:
-		ret = get_name(asma, (void __user *) arg);
+		ret = get_name(asma, (void __user *)arg);
 		break;
 	case ASHMEM_SET_SIZE:
 		ret = -EINVAL;
@@ -774,7 +774,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case ASHMEM_PIN:
 	case ASHMEM_UNPIN:
 	case ASHMEM_GET_PIN_STATUS:
-		ret = ashmem_pin_unpin(asma, cmd, (void __user *) arg);
+		ret = ashmem_pin_unpin(asma, cmd, (void __user *)arg);
 		break;
 	case ASHMEM_PURGE_ALL_CACHES:
 		ret = -EPERM;
Signature · 1 line
2.1.3