First patch

2018-08-02 Thread Arkadiusz Lis
Hi guys,
I created my first patch. Could you please take a look
and check for mistakes? It's a small clean up removing checkpatch.pl
warnings. It was generated using 'git format-patch master..'.  
See below:

>From 231fa77d595536cdaacf364b02dd64fd45a6adc4 Mon Sep 17 00:00:00 2001
From: Arkadiusz Lis 
Date: Thu, 2 Aug 2018 23:38:17 +0200
Subject: [PATCH] Staging: One Laptop Per Child: fix coding style and license
 issues

Add argument names to the function pointers in struct
dcon_platform_data.
Add SPDX-License-Identifiers to the source files.

Signed-off-by: Arkadiusz Lis 
---
 drivers/staging/olpc_dcon/olpc_dcon.c| 1 +
 drivers/staging/olpc_dcon/olpc_dcon.h| 6 +++---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   | 1 +
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 2744c9f..318adc4 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
  *
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.h 
b/drivers/staging/olpc_dcon/olpc_dcon.h
index fa89bb9..0ce1a7a 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.h
+++ b/drivers/staging/olpc_dcon/olpc_dcon.h
@@ -91,10 +91,10 @@ struct dcon_priv {
 };

 struct dcon_platform_data {
-   int (*init)(struct dcon_priv *);
+   int (*init)(struct dcon_priv *dcon);
void (*bus_stabilize_wiggle)(void);
-   void (*set_dconload)(int);
-   int (*read_status)(u8 *);
+   void (*set_dconload)(int val);
+   int (*read_status)(u8 *status);
 };

 #include 
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c 
b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
index 633c58c..c72f492 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
  *
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c 
b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
index 6458442..07b70eb 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2009,2010   One Laptop per Child
  *
--
1.9.1

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Sharing memory between two kernel module - Better approach

2018-08-02 Thread valdis . kletnieks
On Thu, 02 Aug 2018 23:12:23 +0530, Abhinav Misra said:

> I want to know is there any alternative for sharing the memory between two
> modules.

Why are two modules trying to share memory?  In general, each module should
be managing its own data objects.  If two modules need to share, maybe it really
should be one merged module

(And note that there's a number of kernel APIs for memory allocation and
management, optimized for various use cases - so "what are you trying to share"
and "why are you trying to share it" actually matter to get the code correct


pgp5LOFCzi8gA.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Sharing memory between two kernel module - Better approach

2018-08-02 Thread Abhinav Misra
Hi,

I want to know is there any alternative for sharing the memory between two
modules.

The approach which I can think of is taking a global pointer, using kmalloc
and assigning
start of memory to the global pointer and then in 2nd module use extern for
using the same
pointer.

Is there any better way of doing the same ?

BR, Abhinav
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[no subject]

2018-08-02 Thread TU PHUNG VAN
S.ư
www
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies