2015-08-10 06:24:34

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 0/6] staging: android: allow building some drivers as a module

Hi,

These patches enable building of timed_gpio, sync* and ashmem as a module

Mike Rapoport (6):
staging: android: allow building timed_gpio as a module
staging: android: sync_debug.c: add include for linux/module.h
staging: android: combine sync.o and sync_debug.o into sync-core.o
staging: android: allow building sync and sw_sync as a module
mm: export shmem_zero_setup for modules
staging: android: allow building ashmem as a module

drivers/staging/android/Kconfig | 8 ++++----
drivers/staging/android/Makefile | 4 +++-
drivers/staging/android/sync_debug.c | 1 +
mm/shmem.c | 1 +
4 files changed, 9 insertions(+), 5 deletions(-)

--
1.8.3.1


2015-08-10 06:24:44

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 1/6] staging: android: allow building timed_gpio as a module

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 6830712..00f7894 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -15,7 +15,7 @@ config ASHMEM
because it can discard shared memory units when under memory pressure.

config ANDROID_TIMED_OUTPUT
- bool "Timed output class driver"
+ tristate "Timed output class driver"
default y

config ANDROID_TIMED_GPIO
--
1.8.3.1

2015-08-10 06:24:48

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 2/6] staging: android: sync_debug.c: add include for linux/module.h

Otherwise an apptempt to build sync_debug.o as modules results in
compiler errors:
CC [M] drivers/staging/android/sync_debug.o
drivers/staging/android/sync_debug.c:226:1: warning: data definition has no type or storage class [enabled by default] late_initcall(sync_debugfs_init);
drivers/staging/android/sync_debug.c:226:1: error: type defaults to ‘int’ in declaration of ‘late_initcall’ [-Werror=implicit-int]
drivers/staging/android/sync_debug.c:226:1: warning: parameter names (without types) in function declaration [enabled by default]
drivers/staging/android/sync_debug.c:221:19: warning: ‘sync_debugfs_init’ defined but not used [-Wunused-function] static __init int sync_debugfs_init(void)

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/sync_debug.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index 91ed2c4..a452975 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -26,6 +26,7 @@
#include <linux/uaccess.h>
#include <linux/anon_inodes.h>
#include <linux/time64.h>
+#include <linux/module.h>
#include "sync.h"

#ifdef CONFIG_DEBUG_FS
--
1.8.3.1

2015-08-10 06:24:52

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 3/6] staging: android: combine sync.o and sync_debug.o into sync-core.o

to avoid cross dependencies when building sync as module

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
index c7b6c99..d9ebca6 100644
--- a/drivers/staging/android/Makefile
+++ b/drivers/staging/android/Makefile
@@ -6,5 +6,7 @@ obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
-obj-$(CONFIG_SYNC) += sync.o sync_debug.o
+obj-$(CONFIG_SYNC) += sync-core.o
obj-$(CONFIG_SW_SYNC) += sw_sync.o
+
+sync-core-y := sync.o sync_debug.o
--
1.8.3.1

2015-08-10 06:25:46

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 4/6] staging: android: allow building sync and sw_sync as a module

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 00f7894..93b65bd 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -39,7 +39,7 @@ config ANDROID_LOW_MEMORY_KILLER
for each priority.

config SYNC
- bool "Synchronization framework"
+ tristate "Synchronization framework"
default n
select ANON_INODES
select DMA_SHARED_BUFFER
@@ -49,7 +49,7 @@ config SYNC
synchronization built into devices like GPUs.

config SW_SYNC
- bool "Software synchronization objects"
+ tristate "Software synchronization objects"
default n
depends on SYNC
---help---
--
1.8.3.1

2015-08-10 06:25:01

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 5/6] mm: export shmem_zero_setup for modules

to allow building Android ASHMEM as module

Signed-off-by: Mike Rapoport <[email protected]>
---
mm/shmem.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 4caf8ed..80b4098 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3411,6 +3411,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
vma->vm_ops = &shmem_vm_ops;
return 0;
}
+EXPORT_SYMBOL_GPL(shmem_zero_setup);

/**
* shmem_read_mapping_page_gfp - read into page cache, using specified page allocation flags.
--
1.8.3.1

2015-08-10 06:25:05

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH 6/6] staging: android: allow building ashmem as a module

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 93b65bd..5907e07 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -3,7 +3,7 @@ menu "Android"
if ANDROID

config ASHMEM
- bool "Enable the Anonymous Shared Memory Subsystem"
+ tristate "Enable the Anonymous Shared Memory Subsystem"
default n
depends on SHMEM
---help---
--
1.8.3.1

2015-08-10 07:47:13

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 5/6] mm: export shmem_zero_setup for modules

On Mon, Aug 10, 2015 at 09:24:20AM +0300, Mike Rapoport wrote:
> to allow building Android ASHMEM as module

NAK. This is not functionality that should be used by a module to
start, and even if it was exporting functionality is only acceptable
for proper mainline modules, not code in the staging tree.

2015-08-10 15:38:39

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: android: allow building some drivers as a module

On Mon, Aug 10, 2015 at 09:24:15AM +0300, Mike Rapoport wrote:
> Hi,
>
> These patches enable building of timed_gpio, sync* and ashmem as a module

Why do you want to do this? Does it ever make sense to do this type of
thing for your kernel? What does changing these to modules enable you
to do differently?

As it is, I think the code should stay non-modular.

thanks,

greg k-h

2015-08-10 20:10:41

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: android: allow building some drivers as a module

On Mon, Aug 10, 2015 at 6:38 PM, Greg Kroah-Hartman <[email protected]> wrote:
> On Mon, Aug 10, 2015 at 09:24:15AM +0300, Mike Rapoport wrote:
>> Hi,
>>
>> These patches enable building of timed_gpio, sync* and ashmem as a module
>
> Why do you want to do this?

Apparently I've misread "- make sure things build as modules properly"
line in drivers/staging/android/TODO...
My bad.

> Does it ever make sense to do this type of
> thing for your kernel? What does changing these to modules enable you
> to do differently?
>
> As it is, I think the code should stay non-modular.
>
> thanks,
>
> greg k-h



--
Sincerely yours,
Mike.

2015-08-10 21:03:21

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: android: allow building some drivers as a module

On Mon, Aug 10, 2015 at 11:10:37PM +0300, Mike Rapoport wrote:
> On Mon, Aug 10, 2015 at 6:38 PM, Greg Kroah-Hartman <[email protected]> wrote:
> > On Mon, Aug 10, 2015 at 09:24:15AM +0300, Mike Rapoport wrote:
> >> Hi,
> >>
> >> These patches enable building of timed_gpio, sync* and ashmem as a module
> >
> > Why do you want to do this?
>
> Apparently I've misread "- make sure things build as modules properly"
> line in drivers/staging/android/TODO...
> My bad.

Nope, not your fault, I forgot about that. We should remove that TODO
item, as it doesn't make sense for these "non-discoverable" modules to
be built as a module.

Care to make a patch for that?

thanks,

greg k-h

2015-08-11 13:09:31

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: android: allow building some drivers as a module

On Tue, Aug 11, 2015 at 12:03 AM, Greg Kroah-Hartman <[email protected]> wrote:
> On Mon, Aug 10, 2015 at 11:10:37PM +0300, Mike Rapoport wrote:
>> On Mon, Aug 10, 2015 at 6:38 PM, Greg Kroah-Hartman <[email protected]> wrote:
>> > On Mon, Aug 10, 2015 at 09:24:15AM +0300, Mike Rapoport wrote:
>> >> Hi,
>> >>
>> >> These patches enable building of timed_gpio, sync* and ashmem as a module
>> >
>> > Why do you want to do this?
>>
>> Apparently I've misread "- make sure things build as modules properly"
>> line in drivers/staging/android/TODO...
>> My bad.
>
> Nope, not your fault, I forgot about that. We should remove that TODO
> item, as it doesn't make sense for these "non-discoverable" modules to
> be built as a module.
>
> Care to make a patch for that?

I'll make, no problem.
What about other irrelevant parts of that TODO, like, e.g., dead
Brian Sweetland address? Remove them as well?
> thanks,
>
> greg k-h



--
Sincerely yours,
Mike.

2015-08-11 18:10:26

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: android: allow building some drivers as a module

On Tue, Aug 11, 2015 at 04:09:28PM +0300, Mike Rapoport wrote:
> On Tue, Aug 11, 2015 at 12:03 AM, Greg Kroah-Hartman <[email protected]> wrote:
> > On Mon, Aug 10, 2015 at 11:10:37PM +0300, Mike Rapoport wrote:
> >> On Mon, Aug 10, 2015 at 6:38 PM, Greg Kroah-Hartman <[email protected]> wrote:
> >> > On Mon, Aug 10, 2015 at 09:24:15AM +0300, Mike Rapoport wrote:
> >> >> Hi,
> >> >>
> >> >> These patches enable building of timed_gpio, sync* and ashmem as a module
> >> >
> >> > Why do you want to do this?
> >>
> >> Apparently I've misread "- make sure things build as modules properly"
> >> line in drivers/staging/android/TODO...
> >> My bad.
> >
> > Nope, not your fault, I forgot about that. We should remove that TODO
> > item, as it doesn't make sense for these "non-discoverable" modules to
> > be built as a module.
> >
> > Care to make a patch for that?
>
> I'll make, no problem.
> What about other irrelevant parts of that TODO, like, e.g., dead
> Brian Sweetland address? Remove them as well?

Yes, please remove that as well, good catch.

greg k-h

2015-08-11 19:08:45

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH] staging: android: TODO: remove irrelevant parts

- remove "make sure things build as modules properly"
- remove kuid_t related remarks, they were relevant for logger, but it
is gone half year ago
- remove dead e-mail address of Brian Swetland

Signed-off-by: Mike Rapoport <[email protected]>
---
drivers/staging/android/TODO | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO
index 06954cd..37c90aa 100644
--- a/drivers/staging/android/TODO
+++ b/drivers/staging/android/TODO
@@ -2,16 +2,7 @@ TODO:
- checkpatch.pl cleanups
- sparse fixes
- rename files to be not so "generic"
- - make sure things build as modules properly
- add proper arch dependencies as needed
- audit userspace interfaces to make sure they are sane
- - kuid_t should never be exposed to user space as it is
- kernel internal type. Data structure for this kuid_t is:
- typedef struct {
- uid_t val;
- } kuid_t;
- - This bug is introduced by Xiong Zhou in the patch bd471258f2e09
- - ("staging: android: logger: use kuid_t instead of uid_t")

-Please send patches to Greg Kroah-Hartman <[email protected]> and Cc:
-Brian Swetland <[email protected]>
+Please send patches to Greg Kroah-Hartman <[email protected]>
--
1.8.3.1

2015-08-11 23:39:24

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] staging: android: TODO: remove irrelevant parts

On Tue, 2015-08-11 at 22:08 +0300, Mike Rapoport wrote:
> - remove dead e-mail address of Brian Swetland
[]
> diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO
[]
> @@ -2,16 +2,7 @@ TODO:
[]
> -Please send patches to Greg Kroah-Hartman <[email protected]> and Cc:
> -Brian Swetland <[email protected]>
> +Please send patches to Greg Kroah-Hartman <[email protected]>

What about adding these two?

MAINTAINERS:M: Arve Hj?nnev?g <[email protected]>
MAINTAINERS:M: Riley Andrews <[email protected]>

2015-08-12 18:08:59

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v2] staging: android: update TODO

- remove "make sure things build as modules properly"
- remove kuid_t related remarks, they were relevant for logger, but it
is gone half year ago
- remove dead e-mail address of Brian Swetland
- add e-mail addresses of Arve Hjønnevåg and Riley Andrews

Signed-off-by: Mike Rapoport <[email protected]>
---
v2 changes:
* added e-mail addresses of Arve Hjønnevåg and Riley Andrews

drivers/staging/android/TODO | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO
index 06954cd..20288fc 100644
--- a/drivers/staging/android/TODO
+++ b/drivers/staging/android/TODO
@@ -2,16 +2,8 @@ TODO:
- checkpatch.pl cleanups
- sparse fixes
- rename files to be not so "generic"
- - make sure things build as modules properly
- add proper arch dependencies as needed
- audit userspace interfaces to make sure they are sane
- - kuid_t should never be exposed to user space as it is
- kernel internal type. Data structure for this kuid_t is:
- typedef struct {
- uid_t val;
- } kuid_t;
- - This bug is introduced by Xiong Zhou in the patch bd471258f2e09
- - ("staging: android: logger: use kuid_t instead of uid_t")

Please send patches to Greg Kroah-Hartman <[email protected]> and Cc:
-Brian Swetland <[email protected]>
+Arve Hjønnevåg <[email protected]> and Riley Andrews <[email protected]>
--
1.8.3.1