2018-05-07 01:15:05

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 1/6] staging: android: Kconfig; Remove excessive hyphens

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

Signed-off-by: Nathan Chancellor <[email protected]>
---
drivers/staging/android/Kconfig | 4 ++--
drivers/staging/android/ion/Kconfig | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 29d891355f7a..17c5587805f5 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -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.
diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig
index 898e9a834ccc..c16dd16afe6a 100644
--- a/drivers/staging/android/ion/Kconfig
+++ b/drivers/staging/android/ion/Kconfig
@@ -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.
--
2.17.0



2018-05-07 01:14:03

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 2/6] staging: android: Clean up license identifiers

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

Signed-off-by: Nathan Chancellor <[email protected]>
---
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(-)

diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
index 60d7208f110a..1a478173cd21 100644
--- a/drivers/staging/android/ashmem.h
+++ b/drivers/staging/android/ashmem.h
@@ -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
diff --git a/drivers/staging/android/uapi/ashmem.h b/drivers/staging/android/uapi/ashmem.h
index 5b531af6820e..5442e0019dcd 100644
--- a/drivers/staging/android/uapi/ashmem.h
+++ b/drivers/staging/android/uapi/ashmem.h
@@ -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
diff --git a/drivers/staging/android/uapi/vsoc_shm.h b/drivers/staging/android/uapi/vsoc_shm.h
index 741b1387c25b..6291fb24efb2 100644
--- a/drivers/staging/android/uapi/vsoc_shm.h
+++ b/drivers/staging/android/uapi/vsoc_shm.h
@@ -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
diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index 954ed2c5d807..6ef7a011d789 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -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]>
*
--
2.17.0


2018-05-07 01:14:14

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 6/6] staging: android: vsoc: Fix ending '(' warnings in vsoc_probe_device

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <[email protected]>
---
drivers/staging/android/vsoc.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index c460740f9561..806beda1040b 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -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",
--
2.17.0


2018-05-07 01:14:26

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 4/6] staging: android: vsoc: Fix ending '(' warnings in do_destroy_fd_scoped_permission

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <[email protected]>
---
drivers/staging/android/vsoc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index b5307fa584d3..7e9cf3e4fa04 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -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,
--
2.17.0


2018-05-07 01:14:58

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 5/6] staging: android: vsoc: Fix ending '(' warnings in vsoc_ioctl

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <[email protected]>
---
drivers/staging/android/vsoc.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index 7e9cf3e4fa04..c460740f9561 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -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);
--
2.17.0


2018-05-07 01:15:18

by Nathan Chancellor

[permalink] [raw]
Subject: [PATCH 3/6] staging: android: vsoc: Fix ending '(' warnings in function defintions

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <[email protected]>
---
drivers/staging/android/vsoc.c | 42 +++++++++++++++++-----------------
1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index 6ef7a011d789..b5307fa584d3 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -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;
--
2.17.0


2018-05-14 13:31:01

by Dan Carpenter

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

On Sun, May 06, 2018 at 06:13:24PM -0700, Nathan Chancellor wrote:
> Add the identifiers when missing and fix the ones already present
> according to checkpatch.pl.
>
> Signed-off-by: Nathan Chancellor <[email protected]>
> ---
> 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(-)
>
> diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
> index 60d7208f110a..1a478173cd21 100644
> --- a/drivers/staging/android/ashmem.h
> +++ b/drivers/staging/android/ashmem.h
> @@ -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


2018-05-14 13:32:37

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 3/6] staging: android: vsoc: Fix ending '(' warnings in function defintions

I hate this checkpatch warning... The original is often superior to the
modified versions we see.

regards,
dan carpenter


2018-05-14 13:52:22

by Greg Kroah-Hartman

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

On Mon, May 14, 2018 at 04:29:45PM +0300, Dan Carpenter wrote:
> On Sun, May 06, 2018 at 06:13:24PM -0700, Nathan Chancellor wrote:
> > Add the identifiers when missing and fix the ones already present
> > according to checkpatch.pl.
> >
> > Signed-off-by: Nathan Chancellor <[email protected]>
> > ---
> > 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(-)
> >
> > diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
> > index 60d7208f110a..1a478173cd21 100644
> > --- a/drivers/staging/android/ashmem.h
> > +++ b/drivers/staging/android/ashmem.h
> > @@ -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

2018-05-14 13:53:24

by Justin Skists

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


> On 14 May 2018 at 14:29 Dan Carpenter <[email protected]> wrote:
>
>
> On Sun, May 06, 2018 at 06:13:24PM -0700, Nathan Chancellor wrote:
> > Add the identifiers when missing and fix the ones already present
> > according to checkpatch.pl.
> >
> > Signed-off-by: Nathan Chancellor <[email protected]>
> > ---
> > 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(-)
> >
> > diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
> > index 60d7208f110a..1a478173cd21 100644
> > --- a/drivers/staging/android/ashmem.h
> > +++ b/drivers/staging/android/ashmem.h
> > @@ -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.

2018-05-14 14:08:35

by Dan Carpenter

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

On Mon, May 14, 2018 at 02:52:16PM +0100, Justin Skists wrote:
>
> > On 14 May 2018 at 14:29 Dan Carpenter <[email protected]> wrote:
> >
> >
> > On Sun, May 06, 2018 at 06:13:24PM -0700, Nathan Chancellor wrote:
> > > Add the identifiers when missing and fix the ones already present
> > > according to checkpatch.pl.
> > >
> > > Signed-off-by: Nathan Chancellor <[email protected]>
> > > ---
> > > 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(-)
> > >
> > > diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h
> > > index 60d7208f110a..1a478173cd21 100644
> > > --- a/drivers/staging/android/ashmem.h
> > > +++ b/drivers/staging/android/ashmem.h
> > > @@ -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
>

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

regards,
dan carpenter