Skip to contentSkip to conversation

staging: android: Kconfig; Remove excessive hyphens

PATCH In review Nathan Chancellor 4 participants 11 messages May 7, 2018 – May 14, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 staging: android: Kconfig; Remove excessive hyphens

Fixes the following checkpatch.pl warning:
"prefer 'help' over '---help---' for new help texts"

---
 drivers/staging/android/Kconfig     | 4 ++--
 drivers/staging/android/ion/Kconfig | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/Kconfig +2 -2
index 29d891355f7a..17c5587805f5 100644
@@ -6,7 +6,7 @@ config ASHMEM
 	bool "Enable the Anonymous Shared Memory Subsystem"
 	default n
 	depends on SHMEM
-	---help---
+	help
 	  The ashmem subsystem is a new shared memory allocator, similar to
 	  POSIX SHM but with different behavior and sporting a simpler
 	  file-based API.
@@ -18,7 +18,7 @@ config ANDROID_VSOC
 	tristate "Android Virtual SoC support"
 	default n
 	depends on PCI_MSI
-	---help---
+	help
 	  This option adds support for the Virtual SoC driver needed to boot
 	  a 'cuttlefish' Android image inside QEmu. The driver interacts with
 	  a QEmu ivshmem device. If built as a module, it will be called vsoc.
drivers/staging/android/ion/Kconfig +1 -1
index 898e9a834ccc..c16dd16afe6a 100644
@@ -3,7 +3,7 @@ menuconfig ION
 	depends on HAVE_MEMBLOCK && HAS_DMA && MMU
 	select GENERIC_ALLOCATOR
 	select DMA_SHARED_BUFFER
-	---help---
+	help
 	  Choose this option to enable the ION Memory Manager,
 	  used by Android to efficiently allocate buffers
 	  from userspace that can be shared between drivers.
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw

PATCH 2/6 staging: android: Clean up license identifiers

Add the identifiers when missing and fix the ones already present according to checkpatch.pl.

---
 drivers/staging/android/ashmem.h        |  6 +-----
 drivers/staging/android/uapi/ashmem.h   |  6 +-----
 drivers/staging/android/uapi/vsoc_shm.h | 10 +---------
 drivers/staging/android/vsoc.c          | 11 +----------
 4 files changed, 4 insertions(+), 29 deletions(-)
drivers/staging/android/ashmem.h +1 -5
index 60d7208f110a..1a478173cd21 100644
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */
 /*
  * include/linux/ashmem.h
  *
  * Copyright 2008 Google Inc.
  * Author: Robert Love
- *
- * This file is dual licensed.  It may be redistributed and/or modified
- * under the terms of the Apache 2.0 License OR version 2 of the GNU
- * General Public License.
  */
 
 #ifndef _LINUX_ASHMEM_H
drivers/staging/android/uapi/ashmem.h +1 -5
index 5b531af6820e..5442e0019dcd 100644
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */
 /*
  * drivers/staging/android/uapi/ashmem.h
  *
  * Copyright 2008 Google Inc.
  * Author: Robert Love
- *
- * This file is dual licensed.  It may be redistributed and/or modified
- * under the terms of the Apache 2.0 License OR version 2 of the GNU
- * General Public License.
  */
 
 #ifndef _UAPI_LINUX_ASHMEM_H
drivers/staging/android/uapi/vsoc_shm.h +1 -9
index 741b1387c25b..6291fb24efb2 100644
@@ -1,15 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2017 Google, Inc.
  *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
  */
 
 #ifndef _UAPI_LINUX_VSOC_SHM_H
drivers/staging/android/vsoc.c +1 -10
index 954ed2c5d807..6ef7a011d789 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * drivers/android/staging/vsoc.c
  *
@@ -7,16 +8,6 @@
  *
  * Author: [email protected]
  *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- *
  * Based on drivers/char/kvm_ivshmem.c - driver for KVM Inter-VM shared memory
  *         Copyright 2009 Cam Macdonell <[email protected]>
  *
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#2 lore raw

Re: [PATCH 2/6] staging: android: Clean up license identifiers

Quoted 16 lines · Nathan Chancellor

Add the identifiers when missing and fix the ones already present according to checkpatch.pl.

---
 drivers/staging/android/ashmem.h        |  6 +-----
 drivers/staging/android/uapi/ashmem.h   |  6 +-----
 drivers/staging/android/uapi/vsoc_shm.h | 10 +---------
 drivers/staging/android/vsoc.c          | 11 +----------
 4 files changed, 4 insertions(+), 29 deletions(-)
drivers/staging/android/ashmem.h +0 -0
index 60d7208f110a..1a478173cd21 100644

drivers/staging/android/ashmem.h line 1

Quoted 2 lines
drivers/staging/android/ashmem.h +1 -1
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */

// was correct for SPDX headers.

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#3 lore raw

Re: [PATCH 2/6] staging: android: Clean up license identifiers

Quoted 12 lines · Dan Carpenter
Quoted 11 lines · Nathan Chancellor

Add the identifiers when missing and fix the ones already present according to checkpatch.pl.

---
 drivers/staging/android/ashmem.h        |  6 +-----
 drivers/staging/android/uapi/ashmem.h   |  6 +-----
 drivers/staging/android/uapi/vsoc_shm.h | 10 +---------
 drivers/staging/android/vsoc.c          | 11 +----------
 4 files changed, 4 insertions(+), 29 deletions(-)
Quoted 10 lines

drivers/staging/android/ashmem.h line 1

Quoted 7 lines
drivers/staging/android/ashmem.h +1 -1
index 60d7208f110a..1a478173cd21 100644
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */

// was correct for SPDX headers.

Not for .h files, as per the documentation. Sorry, I got this wrong the first time around.

greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#4 lore raw

Re: [PATCH 2/6] staging: android: Clean up license identifiers

In reply to Dan Carpenter
Quoted 16 lines · On 14 May 2018 at 14:29 Dan Carpenter <[email protected]> wrote:
Quoted 11 lines · Nathan Chancellor

Add the identifiers when missing and fix the ones already present according to checkpatch.pl.

---
 drivers/staging/android/ashmem.h        |  6 +-----
 drivers/staging/android/uapi/ashmem.h   |  6 +-----
 drivers/staging/android/uapi/vsoc_shm.h | 10 +---------
 drivers/staging/android/vsoc.c          | 11 +----------
 4 files changed, 4 insertions(+), 29 deletions(-)
Quoted 10 lines

drivers/staging/android/ashmem.h line 1

Quoted 7 lines
drivers/staging/android/ashmem.h +1 -1
index 60d7208f110a..1a478173cd21 100644
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */

// was correct for SPDX headers.

Sorry, header files use the /* ... */ format. :)

https://elixir.bootlin.com/linux/v4.17-rc5/source/Documentation/process/license-rules.rst

Justin.

#5 lore raw

Re: [PATCH 2/6] staging: android: Clean up license identifiers

Quoted 27 lines · Justin Skists
Quoted 16 lines · On 14 May 2018 at 14:29 Dan Carpenter <[email protected]> wrote:
Quoted 11 lines · Nathan Chancellor

Add the identifiers when missing and fix the ones already present according to checkpatch.pl.

---
 drivers/staging/android/ashmem.h        |  6 +-----
 drivers/staging/android/uapi/ashmem.h   |  6 +-----
 drivers/staging/android/uapi/vsoc_shm.h | 10 +---------
 drivers/staging/android/vsoc.c          | 11 +----------
 4 files changed, 4 insertions(+), 29 deletions(-)
Quoted 10 lines

drivers/staging/android/ashmem.h line 1

Quoted 7 lines
drivers/staging/android/ashmem.h +1 -1
index 60d7208f110a..1a478173cd21 100644
@@ -1,13 +1,9 @@
-// SPDX-License-Identifier: (GPL-2.0 OR Apache-2.0)
+/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */

// was correct for SPDX headers.

Quoted 4 lines

Sorry, header files use the /* ... */ format. :)

https://elixir.bootlin.com/linux/v4.17-rc5/source/Documentation/process/license-rules.rst

Oh. Huh... That's fine then. My bad.

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#6 lore raw

PATCH 3/6 staging: android: vsoc: Fix ending '(' warnings in function defintions

In reply to Nathan Chancellor

Fixes checkpatch.pl warnings about lines ending with parentheses.

---
 drivers/staging/android/vsoc.c | 42 +++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/staging/android/vsoc.c +21 -21
index 6ef7a011d789..b5307fa584d3 100644
@@ -148,13 +148,13 @@ static int vsoc_release(struct inode *, struct file *);
 static ssize_t vsoc_read(struct file *, char __user *, size_t, loff_t *);
 static ssize_t vsoc_write(struct file *, const char __user *, size_t, loff_t *);
 static loff_t vsoc_lseek(struct file *filp, loff_t offset, int origin);
-static int do_create_fd_scoped_permission(
-	struct vsoc_device_region *region_p,
-	struct fd_scoped_permission_node *np,
-	struct fd_scoped_permission_arg __user *arg);
-static void do_destroy_fd_scoped_permission(
-	struct vsoc_device_region *owner_region_p,
-	struct fd_scoped_permission *perm);
+static int
+do_create_fd_scoped_permission(struct vsoc_device_region *region_p,
+			       struct fd_scoped_permission_node *np,
+			       struct fd_scoped_permission_arg __user *arg);
+static void
+do_destroy_fd_scoped_permission(struct vsoc_device_region *owner_region_p,
+				struct fd_scoped_permission *perm);
 static long do_vsoc_describe_region(struct file *,
 				    struct vsoc_device_region __user *);
 static ssize_t vsoc_get_area(struct file *filp, __u32 *perm_off);
@@ -203,14 +203,14 @@ static inline phys_addr_t shm_off_to_phys_addr(__u32 offset)
  * Convenience functions to obtain the region from the inode or file.
  * Dangerous to call before validating the inode/file.
  */
-static inline struct vsoc_device_region *vsoc_region_from_inode(
-	struct inode *inode)
+static
+inline struct vsoc_device_region *vsoc_region_from_inode(struct inode *inode)
 {
 	return &vsoc_dev.regions[iminor(inode)];
 }
 
-static inline struct vsoc_device_region *vsoc_region_from_filep(
-	struct file *inode)
+static
+inline struct vsoc_device_region *vsoc_region_from_filep(struct file *inode)
 {
 	return vsoc_region_from_inode(file_inode(inode));
 }
@@ -250,10 +250,10 @@ static struct pci_driver vsoc_pci_driver = {
 	.remove = vsoc_remove_device,
 };
 
-static int do_create_fd_scoped_permission(
-	struct vsoc_device_region *region_p,
-	struct fd_scoped_permission_node *np,
-	struct fd_scoped_permission_arg __user *arg)
+static int
+do_create_fd_scoped_permission(struct vsoc_device_region *region_p,
+			       struct fd_scoped_permission_node *np,
+			       struct fd_scoped_permission_arg __user *arg)
 {
 	struct file *managed_filp;
 	s32 managed_fd;
@@ -344,9 +344,9 @@ static int do_create_fd_scoped_permission(
 	return 0;
 }
 
-static void do_destroy_fd_scoped_permission_node(
-	struct vsoc_device_region *owner_region_p,
-	struct fd_scoped_permission_node *node)
+static void
+do_destroy_fd_scoped_permission_node(struct vsoc_device_region *owner_region_p,
+				     struct fd_scoped_permission_node *node)
 {
 	if (node) {
 		do_destroy_fd_scoped_permission(owner_region_p,
@@ -358,9 +358,9 @@ static void do_destroy_fd_scoped_permission_node(
 	}
 }
 
-static void do_destroy_fd_scoped_permission(
-		struct vsoc_device_region *owner_region_p,
-		struct fd_scoped_permission *perm)
+static void
+do_destroy_fd_scoped_permission(struct vsoc_device_region *owner_region_p,
+				struct fd_scoped_permission *perm)
 {
 	atomic_t *owner_ptr = NULL;
 	int prev = 0;
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#8 lore raw

PATCH 4/6 staging: android: vsoc: Fix ending '(' warnings in do_destroy_fd_scoped_permission

In reply to Nathan Chancellor

Fixes checkpatch.pl warnings about lines ending with parentheses.

---
 drivers/staging/android/vsoc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/android/vsoc.c +2 -2
index b5307fa584d3..7e9cf3e4fa04 100644
@@ -367,8 +367,8 @@ do_destroy_fd_scoped_permission(struct vsoc_device_region *owner_region_p,
 
 	if (!perm)
 		return;
-	owner_ptr = (atomic_t *)shm_off_to_virtual_addr(
-		owner_region_p->region_begin_offset + perm->owner_offset);
+	owner_ptr = (atomic_t *)shm_off_to_virtual_addr
+		(owner_region_p->region_begin_offset + perm->owner_offset);
 	prev = atomic_xchg(owner_ptr, VSOC_REGION_FREE);
 	if (prev != perm->owned_value)
 		dev_err(&vsoc_dev.dev->dev,
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#9 lore raw

PATCH 5/6 staging: android: vsoc: Fix ending '(' warnings in vsoc_ioctl

In reply to Nathan Chancellor

Fixes checkpatch.pl warnings about lines ending with parentheses.

---
 drivers/staging/android/vsoc.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/staging/android/vsoc.c +11 -14
index 7e9cf3e4fa04..c460740f9561 100644
@@ -552,10 +552,10 @@ static long vsoc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 			if (!node)
 				return -ENOMEM;
 			INIT_LIST_HEAD(&node->list);
-			rv = do_create_fd_scoped_permission(
-				region_p,
-				node,
-				(struct fd_scoped_permission_arg __user *)arg);
+			rv = do_create_fd_scoped_permission
+				(region_p,
+				 node,
+				 (struct fd_scoped_permission_arg __user *)arg);
 			if (!rv) {
 				mutex_lock(&vsoc_dev.mtx);
 				list_add(&node->list, &vsoc_dev.permissions);
@@ -582,9 +582,7 @@ static long vsoc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		break;
 
 	case VSOC_MAYBE_SEND_INTERRUPT_TO_HOST:
-		if (!atomic_xchg(
-			    reg_data->outgoing_signalled,
-			    1)) {
+		if (!atomic_xchg(reg_data->outgoing_signalled, 1)) {
 			writel(reg_num, vsoc_dev.regs + DOORBELL);
 			return 0;
 		} else {
@@ -595,17 +593,16 @@ static long vsoc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	case VSOC_SEND_INTERRUPT_TO_HOST:
 		writel(reg_num, vsoc_dev.regs + DOORBELL);
 		return 0;
-
 	case VSOC_WAIT_FOR_INCOMING_INTERRUPT:
-		wait_event_interruptible(
-			reg_data->interrupt_wait_queue,
-			(atomic_read(reg_data->incoming_signalled) != 0));
+		wait_event_interruptible
+			(reg_data->interrupt_wait_queue,
+			 (atomic_read(reg_data->incoming_signalled) != 0));
 		break;
 
 	case VSOC_DESCRIBE_REGION:
-		return do_vsoc_describe_region(
-			filp,
-			(struct vsoc_device_region __user *)arg);
+		return do_vsoc_describe_region
+			(filp,
+			 (struct vsoc_device_region __user *)arg);
 
 	case VSOC_SELF_INTERRUPT:
 		atomic_set(reg_data->incoming_signalled, 1);
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#10 lore raw

PATCH 6/6 staging: android: vsoc: Fix ending '(' warnings in vsoc_probe_device

In reply to Nathan Chancellor

Fixes checkpatch.pl warnings about lines ending with parentheses.

---
 drivers/staging/android/vsoc.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/staging/android/vsoc.c +10 -11
index c460740f9561..806beda1040b 100644
@@ -841,8 +841,8 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 	vsoc_dev.regions = (struct vsoc_device_region __force *)
 		((void *)vsoc_dev.layout +
 		 vsoc_dev.layout->vsoc_region_desc_offset);
-	vsoc_dev.msix_entries = kcalloc(
-			vsoc_dev.layout->region_count,
+	vsoc_dev.msix_entries =
+		kcalloc(vsoc_dev.layout->region_count,
 			sizeof(vsoc_dev.msix_entries[0]), GFP_KERNEL);
 	if (!vsoc_dev.msix_entries) {
 		dev_err(&vsoc_dev.dev->dev,
@@ -850,8 +850,8 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 		vsoc_remove_device(pdev);
 		return -ENOSPC;
 	}
-	vsoc_dev.regions_data = kcalloc(
-			vsoc_dev.layout->region_count,
+	vsoc_dev.regions_data =
+		kcalloc(vsoc_dev.layout->region_count,
 			sizeof(vsoc_dev.regions_data[0]), GFP_KERNEL);
 	if (!vsoc_dev.regions_data) {
 		dev_err(&vsoc_dev.dev->dev,
@@ -913,8 +913,8 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 		       name_sz);
 		dev_info(&pdev->dev, "region %d name=%s\n",
 			 i, vsoc_dev.regions_data[i].name);
-		init_waitqueue_head(
-				&vsoc_dev.regions_data[i].interrupt_wait_queue);
+		init_waitqueue_head
+			(&vsoc_dev.regions_data[i].interrupt_wait_queue);
 		init_waitqueue_head(&vsoc_dev.regions_data[i].futex_wait_queue);
 		vsoc_dev.regions_data[i].incoming_signalled =
 			shm_off_to_virtual_addr(region->region_begin_offset) +
@@ -922,11 +922,10 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 		vsoc_dev.regions_data[i].outgoing_signalled =
 			shm_off_to_virtual_addr(region->region_begin_offset) +
 			g_to_h_signal_table->interrupt_signalled_offset;
-		result = request_irq(
-				vsoc_dev.msix_entries[i].vector,
-				vsoc_interrupt, 0,
-				vsoc_dev.regions_data[i].name,
-				vsoc_dev.regions_data + i);
+		result = request_irq(vsoc_dev.msix_entries[i].vector,
+				     vsoc_interrupt, 0,
+				     vsoc_dev.regions_data[i].name,
+				     vsoc_dev.regions_data + i);
 		if (result) {
 			dev_info(&pdev->dev,
 				 "request_irq failed irq=%d vector=%d\n",
Signature · 6 lines
2.17.0

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel