Re: about ENOSYS

2015-08-02 Thread Drokin, Oleg
subject have been missing, so I filled in something.

On Aug 3, 2015, at 2:18 AM, Shraddha Barke wrote:

> From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
> From: Shraddha Barke 
> Date: Mon, 3 Aug 2015 11:34:19 +0530
> Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS
> 
> ENOSYS means that a nonexistent system call was called. This should
> not be used for invalid operations on otherwise valid syscalls.
> 
> Use -EINVAL instead of -ENOSYS. This fixes checkpatch warning message:
> 
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Is this really true, though?
I know you are working off what the tool reports.
But in reality people have been using ENOSYS to indicate
"this thing that you want is not really available" 
Reading the define file we can see:
/usr/include/asm-generic/errno.h:#defineENOSYS  38  /* 
Function not implemented */

$ grep -r 'ENOSYS;' fs/ | wc -l
75

So it's extensively used in the fs tree by existing code.

Hmm…. Searching some more I arrived at commit e15f431f
that changes the in-kernel comment and claims the "system call only stuff".

So Greg, do you want Lustre to get rid of use of ENOSYS (all 16 users we have),
or is it ok to leave them in?

> 
> Signed-off-by: Shraddha Barke 
> ---
> drivers/staging/lustre/lustre/llite/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c 
> b/drivers/staging/lustre/lustre/llite/file.c
> index 2c467bf..93619a8 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -2786,7 +2786,7 @@ ll_file_flock(struct file *file, int cmd, struct 
> file_lock *file_lock)
> static int
> ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
> {
> - return -ENOSYS;
> + return -EINVAL;
> }
> 
> /**
> -- 
> 2.1.0
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[no subject]

2015-08-02 Thread Shraddha Barke
>From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
From: Shraddha Barke 
Date: Mon, 3 Aug 2015 11:34:19 +0530
Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS

ENOSYS means that a nonexistent system call was called. This should
not be used for invalid operations on otherwise valid syscalls.

Use -EINVAL instead of -ENOSYS. This fixes checkpatch warning message:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Signed-off-by: Shraddha Barke 
---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 2c467bf..93619a8 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2786,7 +2786,7 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
 static int
 ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
 {
-   return -ENOSYS;
+   return -EINVAL;
 }
 
 /**
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2] staging: android: lowmemorykiller: imporve lmk to avoid deadlock issue

2015-08-02 Thread Dan Carpenter
On Mon, Aug 03, 2015 at 05:53:22AM +, Wang, Biao wrote:
> Consider the following case:
> Task A trigger lmk with a lock held, while task B try to
> get this lock, but unfortunately B is the very culprit task lmk select to
> kill. Then B will never be killed, and A will forever select B to kill.
> Such dead lock will trigger softlock up issue.
> 
> This patch try to pick the next task to break this loop.
> 
> Signed-off-by: Wang Biao 
> Reviewed-by: Zhang Di 
> Reviewed-by: Dan Carpenter 

I don't really feel comfortable saying I reviewed this code.  I just
commented on a few process issues.  I don't know the subsystem well
enough to give it a seal of approval.

> Reviewed-by: Joe Perches 

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2] staging: android: lowmemorykiller: imporve lmk to avoid deadlock issue

2015-08-02 Thread Wang, Biao
Consider the following case:
Task A trigger lmk with a lock held, while task B try to
get this lock, but unfortunately B is the very culprit task lmk select to
kill. Then B will never be killed, and A will forever select B to kill.
Such dead lock will trigger softlock up issue.

This patch try to pick the next task to break this loop.

Signed-off-by: Wang Biao 
Reviewed-by: Zhang Di 
Reviewed-by: Dan Carpenter 
Reviewed-by: Joe Perches 
---
 drivers/staging/android/lowmemorykiller.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index feafa17..23d9832 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -127,9 +127,10 @@ static unsigned long lowmem_scan(struct shrinker *s, 
struct shrink_control *sc)
if (!p)
continue;
 
-   if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
-   time_before_eq(jiffies, lowmem_deathpending_timeout)) {
+   if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
task_unlock(p);
+   if (time_after(jiffies, lowmem_deathpending_timeout)) 
+   continue;
rcu_read_unlock();
return 0;
}
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging : lustre: Struct file_operations should be const

2015-08-02 Thread Shraddha Barke
Declare the file_operations structure ll_file_operations as const, as done
elsewhere in the kernel, as there are no modifications to its fields.

Problem found using checkpatch:

WARNING: struct file_operations should normally be const

Signed-off-by: Shraddha Barke 
---
 drivers/staging/lustre/lustre/llite/file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index dcd0c6d..2c467bf 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3116,7 +3116,7 @@ int ll_inode_permission(struct inode *inode, int mask)
 }
 
 /* -o localflock - only provides locally consistent flock locks */
-struct file_operations ll_file_operations = {
+const struct file_operations ll_file_operations = {
.read_iter = ll_file_read_iter,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
@@ -3129,7 +3129,7 @@ struct file_operations ll_file_operations = {
.flush= ll_flush
 };
 
-struct file_operations ll_file_operations_flock = {
+const struct file_operations ll_file_operations_flock = {
.read_iter= ll_file_read_iter,
.write_iter   = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
@@ -3145,7 +3145,7 @@ struct file_operations ll_file_operations_flock = {
 };
 
 /* These are for -o noflock - to return ENOSYS on flock calls */
-struct file_operations ll_file_operations_noflock = {
+const struct file_operations ll_file_operations_noflock = {
.read_iter= ll_file_read_iter,
.write_iter   = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Revert "Staging : lustre: Struct file_operations should be const"

2015-08-02 Thread Sudip Mukherjee
On Sun, Aug 02, 2015 at 11:04:22PM +0530, Shraddha Barke wrote:

Your subject says 'Revert "Staging : lustre: Struct file_operations
should be const"'. This patch reverts which commit?

> Declare the file_operations structure ll_file_operations as const, as done
> elsewhere in the kernel, as there are no modifications to its fields.
> 
> Problem found using checkpatch.
> 
> Signed-off-by: Shraddha Barke 
> ---
> Changes in v2:
>   - Make the commit message more clearer.
> 
>  drivers/staging/lustre/lustre/llite/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c 
> b/drivers/staging/lustre/lustre/llite/file.c
> index 369a722..dcd0c6d 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -3116,7 +3116,7 @@ int ll_inode_permission(struct inode *inode, int mask)
>  }
>  
>  /* -o localflock - only provides locally consistent flock locks */
> -const struct file_operations ll_file_operations = {
> +struct file_operations ll_file_operations = {
Your commit message says "Declare the file_operations structure
ll_file_operations as const" but your patch is removing the const.

regards
sudip

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 0/6] Staging: most: several warnings fix reported by sparse

2015-08-02 Thread Greg KH
On Sun, Aug 02, 2015 at 10:02:22PM +0200, Adrian Remonda wrote:
> This patch series fix several warnings reported by the Sparse tool
> 
> Adrian Remonda (6):
>   Staging: most: static keyword missing
>   Staging: most: Fix sparse warning "Using plain integer as NULL
> pointer"
>   Staging: most: static keyword missing
>   Staging: most: Fix sparse warning "Using plain integer as NULL
> pointer"
>   Staging: most: static keyword missing
>   Staging: most: Fix sparse warning "Using plain integer as NULL
> pointer"

You used the same subject for half of these, please be more "unique".
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: lustre: service.c: make local functions static

2015-08-02 Thread Zoltán Lajos Kis
Makes functions that are not used outside the file in which they are defined
static, as reported by sparse:

drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
'ptlrpc_alloc_rqbd' was not declared. Should it be static?
1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
static?

Signed-off-by: Zoltán Lajos Kis "
---
v2: Made commit message and subject line more descriptive

 drivers/staging/lustre/lustre/ptlrpc/service.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index cf9477d..d3265a8 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -69,7 +69,7 @@ LIST_HEAD(ptlrpc_all_services);
 /** Used to protect the \e ptlrpc_all_services list */
 struct mutex ptlrpc_all_services_mutex;
 
-struct ptlrpc_request_buffer_desc *
+static struct ptlrpc_request_buffer_desc *
 ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
 {
struct ptlrpc_service *svc = svcpt->scp_service;
@@ -101,7 +101,7 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
return rqbd;
 }
 
-void
+static void
 ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
 {
struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt;
@@ -118,7 +118,7 @@ ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
kfree(rqbd);
 }
 
-int
+static int
 ptlrpc_grow_req_bufs(struct ptlrpc_service_part *svcpt, int post)
 {
struct ptlrpc_service *svc = svcpt->scp_service;
@@ -3052,7 +3052,7 @@ EXPORT_SYMBOL(ptlrpc_unregister_service);
  * Right now, it just checks to make sure that requests aren't languishing
  * in the queue.  We'll use this health check to govern whether a node needs
  * to be shot, so it's intentionally non-aggressive. */
-int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
+static int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
 {
struct ptlrpc_request *request = NULL;
struct timeval right_now;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] Staging: fbtft: Use a struct to describe each LCD controller

2015-08-02 Thread Fabio Falzoi
Use a struct flexfb_lcd_controller to holds chip properties, instead of
relying on a long 'if - else if' chain.
This allows to:
- use a simple linear search to verify if a certain LCD controller
model is supported or not.
- add support for a new LCD chip controller simply defining a new
flexfb_lcd_controller struct.

Signed-off-by: Fabio Falzoi 
Acked-by: Noralf Trønnes 
---
 drivers/staging/fbtft/flexfb.c | 232 -
 1 file changed, 136 insertions(+), 96 deletions(-)

diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index ce6e3ae..b3a68c9 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -126,6 +126,109 @@ static int ssd1351_init[] = { -1, 0xfd, 0x12, -1, 0xfd, 
0xb1, -1, 0xae, -1, 0xb3
  -1, 0xab, 0x01, -1, 0xb1, 0x32, -1, 0xb4, 0xa0, 
0xb5, 0x55, -1, 0xbb, 0x17, -1, 0xbe, 0x05,
  -1, 0xc1, 0xc8, 0x80, 0xc8, -1, 0xc7, 0x0f, -1, 
0xb6, 0x01, -1, 0xa6, -1, 0xaf, -3 };
 
+/**
+ * struct flexfb_lcd_controller - Describes the LCD controller properties
+ * @name: Model name of the chip
+ * @width: Width of display in pixels
+ * @height: Height of display in pixels
+ * @setaddrwin: Which set_addr_win() implementation to use
+ * @regwidth: LCD Controller Register width in bits
+ * @init_seq: LCD initialization sequence
+ * @init_seq_sz: Size of LCD initialization sequence
+ */
+struct flexfb_lcd_controller {
+   const char *name;
+   unsigned int width;
+   unsigned int height;
+   unsigned int setaddrwin;
+   unsigned int regwidth;
+   int *init_seq;
+   int init_seq_sz;
+};
+
+static const struct flexfb_lcd_controller flexfb_chip_table[] = {
+   {
+   .name = "st7735r",
+   .width = 120,
+   .height = 160,
+   .init_seq = st7735r_init,
+   .init_seq_sz = ARRAY_SIZE(st7735r_init),
+   },
+   {
+   .name = "hx8340bn",
+   .width = 176,
+   .height = 220,
+   .init_seq = hx8340bn_init,
+   .init_seq_sz = ARRAY_SIZE(hx8340bn_init),
+   },
+   {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   },
+   {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   },
+   {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   },
+   {
+   .name = "ili9320",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 1,
+   .regwidth = 16,
+   .init_seq = ili9320_init,
+   .init_seq_sz = ARRAY_SIZE(ili9320_init),
+   },
+   {
+   .name = "ili9325",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 1,
+   .regwidth = 16,
+   .init_seq = ili9325_init,
+   .init_seq_sz = ARRAY_SIZE(ili9325_init),
+   },
+   {
+   .name = "ili9341",
+   .width = 240,
+   .height = 320,
+   .init_seq = ili9341_init,
+   .init_seq_sz = ARRAY_SIZE(ili9341_init),
+   },
+   {
+   .name = "ssd1289",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 2,
+   .regwidth = 16,
+   .init_seq = ssd1289_init,
+   .init_seq_sz = ARRAY_SIZE(ssd1289_init),
+   },
+   {
+   .name = "ssd1351",
+   .width = 128,
+   .height = 128,
+   .setaddrwin = 3,
+   .init_seq = ssd1351_init,
+   .init_seq_sz = ARRAY_SIZE(ssd1351_init),
+   },
+};
+
 /* ili9320, ili9325 */
 static void flexfb_set_addr_win_1(struct fbtft_par *par,
  int xs, int ys, int xe, int ye)
@@ -247,8 +350,38 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par)
return 0;
 }
 
+static void flexfb_chip_load_param(const struct flexfb_lcd_controller *chip)
+{
+   if (!width)
+   width = chip->width;
+   if (!height)
+   height = chip->height;
+   setaddrwin = chip->setaddrwin;
+   if (chip->regwidth)
+   regwidth = chip->regwidth;
+   if (!init_num) {
+   initp = chip->init_seq;
+   initp_num = chip->init_seq_sz;
+   }
+}
+
 static struct fbtft_display flex_display = { };
 
+static int flexfb_chip_

Re: [PATCH v2] Staging: fbtft: Use a struct to describe each LCD controller

2015-08-02 Thread Fabio Falzoi
On Sun, Aug 02, 2015 at 07:54:48PM +0200, Noralf Trønnes wrote:
> 
> Seems I wasn't clear enough, you could use my ack if you put
> struct flexfb_lcd_controller inside the driver and not in
> fbtft.h
> 
> 
> Noralf.
> 
>

Sorry Noralf, I misunderstood your review.
I will modify the patch and send an updated version.

Thank you,
Fabio
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings

2015-08-02 Thread Julia Lawall
On Sun, 2 Aug 2015, Zoltán Lajos Kis wrote:

> Fixes the following sparse warnings:
> 
> drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
> 'ptlrpc_alloc_rqbd' was not declared. Should it be static?
> 1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
> symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
> 1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
> symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
> 1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
> symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
> static?

Try to come up with a commit message that says something more than "fix".  
Something like "Make static some functions that are not used outside the 
file in which they are defined" would make clear what is done and why.  It 
would be nice to say that sparse helped you find the problem, but goal 
of the change should not be to silence sparse.

julia

> Signed-off-by: Zoltán Lajos Kis "
> ---
>  drivers/staging/lustre/lustre/ptlrpc/service.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
> b/drivers/staging/lustre/lustre/ptlrpc/service.c
> index cf9477d..d3265a8 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/service.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
> @@ -69,7 +69,7 @@ LIST_HEAD(ptlrpc_all_services);
>  /** Used to protect the \e ptlrpc_all_services list */
>  struct mutex ptlrpc_all_services_mutex;
>  
> -struct ptlrpc_request_buffer_desc *
> +static struct ptlrpc_request_buffer_desc *
>  ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
>  {
>   struct ptlrpc_service *svc = svcpt->scp_service;
> @@ -101,7 +101,7 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
>   return rqbd;
>  }
>  
> -void
> +static void
>  ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
>  {
>   struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt;
> @@ -118,7 +118,7 @@ ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
>   kfree(rqbd);
>  }
>  
> -int
> +static int
>  ptlrpc_grow_req_bufs(struct ptlrpc_service_part *svcpt, int post)
>  {
>   struct ptlrpc_service *svc = svcpt->scp_service;
> @@ -3052,7 +3052,7 @@ EXPORT_SYMBOL(ptlrpc_unregister_service);
>   * Right now, it just checks to make sure that requests aren't languishing
>   * in the queue.  We'll use this health check to govern whether a node needs
>   * to be shot, so it's intentionally non-aggressive. */
> -int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
> +static int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
>  {
>   struct ptlrpc_request *request = NULL;
>   struct timeval right_now;
> -- 
> 1.9.1
> 
> ___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 5/6] Staging: most: static keyword missing

2015-08-02 Thread Adrian Remonda
This is a patch to the most/aim_cdev.c file. It makes several
local functions and structures static to prevent global visibility.

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/aim-cdev/cdev.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/aim-cdev/cdev.c 
b/drivers/staging/most/aim-cdev/cdev.c
index d5fb4a0e0818..047acfbef793 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -49,7 +49,7 @@ static struct list_head channel_list;
 static spinlock_t ch_list_lock;
 
 
-struct aim_channel *get_channel(struct most_interface *iface, int id)
+static struct aim_channel *get_channel(struct most_interface *iface, int id)
 {
struct aim_channel *channel, *tmp;
unsigned long flags;
@@ -288,7 +288,7 @@ static const struct file_operations channel_fops = {
  * This frees allocated memory and removes the cdev that represents this
  * channel in user space.
  */
-int aim_disconnect_channel(struct most_interface *iface, int channel_id)
+static int aim_disconnect_channel(struct most_interface *iface, int channel_id)
 {
struct aim_channel *channel;
unsigned long flags;
@@ -328,7 +328,7 @@ int aim_disconnect_channel(struct most_interface *iface, 
int channel_id)
  * This searches for the channel linked to this MBO and stores it in the local
  * fifo buffer.
  */
-int aim_rx_completion(struct mbo *mbo)
+static int aim_rx_completion(struct mbo *mbo)
 {
struct aim_channel *channel;
 
@@ -355,7 +355,7 @@ int aim_rx_completion(struct mbo *mbo)
  *
  * This wakes sleeping processes in the wait-queue.
  */
-int aim_tx_completion(struct most_interface *iface, int channel_id)
+static int aim_tx_completion(struct most_interface *iface, int channel_id)
 {
struct aim_channel *channel;
 
@@ -375,7 +375,7 @@ int aim_tx_completion(struct most_interface *iface, int 
channel_id)
return 0;
 }
 
-struct most_aim cdev_aim;
+static struct most_aim cdev_aim;
 
 /**
  * aim_probe - probe function of the driver module
@@ -389,7 +389,7 @@ struct most_aim cdev_aim;
  *
  * Returns 0 on success or error code otherwise.
  */
-int aim_probe(struct most_interface *iface, int channel_id,
+static int aim_probe(struct most_interface *iface, int channel_id,
  struct most_channel_config *cfg,
  struct kobject *parent, char *name)
 {
@@ -462,7 +462,7 @@ error_alloc_channel:
return retval;
 }
 
-struct most_aim cdev_aim = {
+static struct most_aim cdev_aim = {
.name = "cdev",
.probe_channel = aim_probe,
.disconnect_channel = aim_disconnect_channel,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 6/6] Staging: most: Fix sparse warning "Using plain integer as NULL pointer"

2015-08-02 Thread Adrian Remonda
This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the offending 0 with NULL.

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/aim-network/networking.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 4639c49240f1..a1e1bce16296 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -295,7 +295,7 @@ static void most_net_rm_netdev_safe(struct net_dev_context 
*nd)
 
unregister_netdev(nd->dev);
free_netdev(nd->dev);
-   nd->dev = 0;
+   nd->dev = NULL;
 }
 
 static struct net_dev_context *get_net_dev_context(
@@ -311,7 +311,7 @@ static struct net_dev_context *get_net_dev_context(
}
}
spin_unlock(&list_lock);
-   return 0;
+   return NULL;
 }
 
 static int aim_probe_channel(struct most_interface *iface, int channel_idx,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 3/6] Staging: most: static keyword missing

2015-08-02 Thread Adrian Remonda
This is a patch to the most/hdm-usb/hdm_usb.c file. It
makes several local functions and structures static to prevent global 
visibility.

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index a4a3e266b3ef..f4de88403177 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -280,7 +280,7 @@ static unsigned int get_stream_frame_size(struct 
most_channel_config *cfg)
  *
  * Returns 0 on success or error code otherwise.
  */
-int hdm_poison_channel(struct most_interface *iface, int channel)
+static int hdm_poison_channel(struct most_interface *iface, int channel)
 {
struct most_dev *mdev;
 
@@ -318,7 +318,7 @@ int hdm_poison_channel(struct most_interface *iface, int 
channel)
  * This inserts the INIC hardware specific padding bytes into a streaming
  * channel's buffer
  */
-int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
+static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
 {
struct most_channel_config *conf = &mdev->conf[channel];
unsigned int j, num_frames, frame_size;
@@ -354,7 +354,7 @@ int hdm_add_padding(struct most_dev *mdev, int channel, 
struct mbo *mbo)
  * This takes the INIC hardware specific padding bytes off a streaming
  * channel's buffer.
  */
-int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
+static int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo 
*mbo)
 {
unsigned int j, num_frames, frame_size;
struct most_channel_config *const conf = &mdev->conf[channel];
@@ -629,7 +629,7 @@ static void hdm_read_completion(struct urb *urb)
  *
  * Context: Could in _some_ cases be interrupt!
  */
-int hdm_enqueue(struct most_interface *iface, int channel, struct mbo *mbo)
+static int hdm_enqueue(struct most_interface *iface, int channel, struct mbo 
*mbo)
 {
struct most_dev *mdev;
struct buf_anchor *anchor;
@@ -730,7 +730,7 @@ _error:
  * @channel: channel ID
  * @conf: structure that holds the configuration information
  */
-int hdm_configure_channel(struct most_interface *iface, int channel,
+static int hdm_configure_channel(struct most_interface *iface, int channel,
  struct most_channel_config *conf)
 {
unsigned int num_frames;
@@ -808,7 +808,7 @@ exit:
  * This triggers the USB vendor requests to read the hardware address and
  * the current link status of the attached device.
  */
-int hdm_update_netinfo(struct most_dev *mdev)
+static int hdm_update_netinfo(struct most_dev *mdev)
 {
int i;
u16 link;
@@ -856,7 +856,7 @@ int hdm_update_netinfo(struct most_dev *mdev)
  * polls for the NI state of the INIC every 2 seconds.
  *
  */
-void hdm_request_netinfo(struct most_interface *iface, int channel)
+static void hdm_request_netinfo(struct most_interface *iface, int channel)
 {
struct most_dev *mdev;
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 4/6] Staging: most: Fix sparse warning "Using plain integer as NULL pointer"

2015-08-02 Thread Adrian Remonda
This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the offending 0 with NULL.


Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/hdm-dim2/dim2_hal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c 
b/drivers/staging/most/hdm-dim2/dim2_hal.c
index 01b748944ee4..a54cf2cedac3 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hal.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
@@ -889,7 +889,7 @@ struct dim_ch_state_t *DIM_GetChannelState(struct 
dim_channel *ch,
struct dim_ch_state_t *state_ptr)
 {
if (!ch || !state_ptr)
-   return 0;
+   return NULL;
 
state_ptr->ready = ch->state.level < 2;
state_ptr->done_buffers = ch->done_sw_buffers_number;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 2/6] Staging: most: Fix sparse warning "Using plain integer as NULL pointer"

2015-08-02 Thread Adrian Remonda
This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the offending 0 with NULL.


Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/mostcore/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index 8d1b68dbeaf8..7e338217779c 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -982,7 +982,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
if (ret)
return ret;
 
-   if (mdev_devnod == 0 || *mdev_devnod == 0) {
+   if (mdev_devnod == NULL || *mdev_devnod == 0) {
snprintf(devnod_buf, PAGE_SIZE, "%s-%s", mdev, mdev_ch);
mdev_devnod = devnod_buf;
}
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 1/6] Staging: most: static keyword missing

2015-08-02 Thread Adrian Remonda
This is a patch to the mostcore/core.c file. It makes
several local functions and structures static to prevent global visibility.

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/mostcore/core.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index f4f903404f1b..8d1b68dbeaf8 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -178,7 +178,7 @@ static void most_free_mbo_coherent(struct mbo *mbo)
  * flush_channel_fifos - clear the channel fifos
  * @c: pointer to channel object
  */
-void flush_channel_fifos(struct most_c_obj *c)
+static void flush_channel_fifos(struct most_c_obj *c)
 {
unsigned long flags, hf_flags;
struct mbo *mbo, *tmp;
@@ -888,7 +888,7 @@ static ssize_t show_add_link(struct most_aim_obj *aim_obj,
  * Input: "mdev0:ch0@ep_81"
  * Output: *a -> "mdev0", *b -> "ch0@ep_81", *c == NULL
  */
-int split_string(char *buf, char **a, char **b, char **c)
+static int split_string(char *buf, char **a, char **b, char **c)
 {
*a = strsep(&buf, ":");
if (!*a)
@@ -1006,7 +1006,7 @@ static ssize_t store_add_link(struct most_aim_obj 
*aim_obj,
return len;
 }
 
-struct most_aim_attribute most_aim_attr_add_link =
+static struct most_aim_attribute most_aim_attr_add_link =
__ATTR(add_link, S_IRUGO | S_IWUSR, show_add_link, store_add_link);
 
 static ssize_t show_remove_link(struct most_aim_obj *aim_obj,
@@ -1057,7 +1057,7 @@ static ssize_t store_remove_link(struct most_aim_obj 
*aim_obj,
return len;
 }
 
-struct most_aim_attribute most_aim_attr_remove_link =
+static struct most_aim_attribute most_aim_attr_remove_link =
__ATTR(remove_link, S_IRUGO | S_IWUSR, show_remove_link, 
store_remove_link);
 
 static struct attribute *most_aim_def_attrs[] = {
@@ -1121,14 +1121,14 @@ static void destroy_most_aim_obj(struct most_aim_obj *p)
 /**
  * Instantiation of the MOST bus
  */
-struct bus_type most_bus = {
+static struct bus_type most_bus = {
.name = "most",
 };
 
 /**
  * Instantiation of the core driver
  */
-struct device_driver mostcore = {
+static struct device_driver mostcore = {
.name = "mostcore",
.bus = &most_bus,
 };
@@ -1255,7 +1255,7 @@ static void arm_mbo(struct mbo *mbo)
  *
  * Returns the number of allocated and enqueued MBOs.
  */
-int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct mbo *))
+static int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct 
mbo *))
 {
unsigned int i;
int retval;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2 0/6] Staging: most: several warnings fix reported by sparse

2015-08-02 Thread Adrian Remonda
This patch series fix several warnings reported by the Sparse tool

Adrian Remonda (6):
  Staging: most: static keyword missing
  Staging: most: Fix sparse warning "Using plain integer as NULL
pointer"
  Staging: most: static keyword missing
  Staging: most: Fix sparse warning "Using plain integer as NULL
pointer"
  Staging: most: static keyword missing
  Staging: most: Fix sparse warning "Using plain integer as NULL
pointer"

 drivers/staging/most/aim-cdev/cdev.c  | 14 +++---
 drivers/staging/most/aim-network/networking.c |  4 ++--
 drivers/staging/most/hdm-dim2/dim2_hal.c  |  2 +-
 drivers/staging/most/hdm-usb/hdm_usb.c| 14 +++---
 drivers/staging/most/mostcore/core.c  | 16 
 5 files changed, 25 insertions(+), 25 deletions(-)

-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings

2015-08-02 Thread Zoltán Lajos Kis
Fixes the following sparse warnings:

drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
'ptlrpc_alloc_rqbd' was not declared. Should it be static?
1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
static?

Signed-off-by: Zoltán Lajos Kis "
---
 drivers/staging/lustre/lustre/ptlrpc/service.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index cf9477d..d3265a8 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -69,7 +69,7 @@ LIST_HEAD(ptlrpc_all_services);
 /** Used to protect the \e ptlrpc_all_services list */
 struct mutex ptlrpc_all_services_mutex;
 
-struct ptlrpc_request_buffer_desc *
+static struct ptlrpc_request_buffer_desc *
 ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
 {
struct ptlrpc_service *svc = svcpt->scp_service;
@@ -101,7 +101,7 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
return rqbd;
 }
 
-void
+static void
 ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
 {
struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt;
@@ -118,7 +118,7 @@ ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
kfree(rqbd);
 }
 
-int
+static int
 ptlrpc_grow_req_bufs(struct ptlrpc_service_part *svcpt, int post)
 {
struct ptlrpc_service *svc = svcpt->scp_service;
@@ -3052,7 +3052,7 @@ EXPORT_SYMBOL(ptlrpc_unregister_service);
  * Right now, it just checks to make sure that requests aren't languishing
  * in the queue.  We'll use this health check to govern whether a node needs
  * to be shot, so it's intentionally non-aggressive. */
-int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
+static int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt)
 {
struct ptlrpc_request *request = NULL;
struct timeval right_now;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] vt6655-Changed C99 comment to C89 style.

2015-08-02 Thread Greg KH
On Sun, Aug 02, 2015 at 09:00:03PM +0300, Lior Pugatch wrote:
> ---
>  drivers/staging/vt6655/rxtx.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
> index b9bd163..54694df 100644
> --- a/drivers/staging/vt6655/rxtx.h
> +++ b/drivers/staging/vt6655/rxtx.h
> @@ -197,4 +197,4 @@ int vnt_beacon_make(struct vnt_private *, struct 
> ieee80211_vif *);
>  int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
> struct ieee80211_bss_conf *);
>  
> -#endif // __RXTX_H__
> +#endif /* __RXTX_H__ */
> -- 
> 1.9.1

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] Staging: most: static keyword missing

2015-08-02 Thread Greg KH
On Sun, Aug 02, 2015 at 07:57:19PM +0200, Adrian Remonda wrote:
> This is a patch to the mostcore/core.c file. It makes
> several local functions static to prevent global visibility.

You also change structure's visibility, please mention that when you
resend this patch.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/4] Plain integer instead of NULL pointer fix

2015-08-02 Thread Greg KH
On Sun, Aug 02, 2015 at 07:57:20PM +0200, Adrian Remonda wrote:
> This patch fix the using plain integer as NULL pointer

That sentance doesn't make much sense, why are you changing this?

> 
> Signed-off-by: Adrian Remonda 
> ---
>  drivers/staging/most/mostcore/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

this patch, and patch 4/4 were the exact same subject, and you don't
have the "staging: most" prefix on them, so I can't take them.

Please fix up and resend.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] vt6655-Changed C99 comment to C89 style.

2015-08-02 Thread Lior Pugatch
---
 drivers/staging/vt6655/rxtx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
index b9bd163..54694df 100644
--- a/drivers/staging/vt6655/rxtx.h
+++ b/drivers/staging/vt6655/rxtx.h
@@ -197,4 +197,4 @@ int vnt_beacon_make(struct vnt_private *, struct 
ieee80211_vif *);
 int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
  struct ieee80211_bss_conf *);
 
-#endif // __RXTX_H__
+#endif /* __RXTX_H__ */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Plain integer instead of NULL pointer fix

2015-08-02 Thread Adrian Remonda
This patch fix the using plain integer as NULL pointer

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/hdm-dim2/dim2_hal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c 
b/drivers/staging/most/hdm-dim2/dim2_hal.c
index 01b748944ee4..a54cf2cedac3 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hal.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
@@ -889,7 +889,7 @@ struct dim_ch_state_t *DIM_GetChannelState(struct 
dim_channel *ch,
struct dim_ch_state_t *state_ptr)
 {
if (!ch || !state_ptr)
-   return 0;
+   return NULL;
 
state_ptr->ready = ch->state.level < 2;
state_ptr->done_buffers = ch->done_sw_buffers_number;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] Staging: most: static keyword missing

2015-08-02 Thread Adrian Remonda
This is a patch to the most/hdm-usb/hdm_usb.c file. It
makes several local functions static to prevent global visibility.


Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index a4a3e266b3ef..f4de88403177 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -280,7 +280,7 @@ static unsigned int get_stream_frame_size(struct 
most_channel_config *cfg)
  *
  * Returns 0 on success or error code otherwise.
  */
-int hdm_poison_channel(struct most_interface *iface, int channel)
+static int hdm_poison_channel(struct most_interface *iface, int channel)
 {
struct most_dev *mdev;
 
@@ -318,7 +318,7 @@ int hdm_poison_channel(struct most_interface *iface, int 
channel)
  * This inserts the INIC hardware specific padding bytes into a streaming
  * channel's buffer
  */
-int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
+static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
 {
struct most_channel_config *conf = &mdev->conf[channel];
unsigned int j, num_frames, frame_size;
@@ -354,7 +354,7 @@ int hdm_add_padding(struct most_dev *mdev, int channel, 
struct mbo *mbo)
  * This takes the INIC hardware specific padding bytes off a streaming
  * channel's buffer.
  */
-int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
+static int hdm_remove_padding(struct most_dev *mdev, int channel, struct mbo 
*mbo)
 {
unsigned int j, num_frames, frame_size;
struct most_channel_config *const conf = &mdev->conf[channel];
@@ -629,7 +629,7 @@ static void hdm_read_completion(struct urb *urb)
  *
  * Context: Could in _some_ cases be interrupt!
  */
-int hdm_enqueue(struct most_interface *iface, int channel, struct mbo *mbo)
+static int hdm_enqueue(struct most_interface *iface, int channel, struct mbo 
*mbo)
 {
struct most_dev *mdev;
struct buf_anchor *anchor;
@@ -730,7 +730,7 @@ _error:
  * @channel: channel ID
  * @conf: structure that holds the configuration information
  */
-int hdm_configure_channel(struct most_interface *iface, int channel,
+static int hdm_configure_channel(struct most_interface *iface, int channel,
  struct most_channel_config *conf)
 {
unsigned int num_frames;
@@ -808,7 +808,7 @@ exit:
  * This triggers the USB vendor requests to read the hardware address and
  * the current link status of the attached device.
  */
-int hdm_update_netinfo(struct most_dev *mdev)
+static int hdm_update_netinfo(struct most_dev *mdev)
 {
int i;
u16 link;
@@ -856,7 +856,7 @@ int hdm_update_netinfo(struct most_dev *mdev)
  * polls for the NI state of the INIC every 2 seconds.
  *
  */
-void hdm_request_netinfo(struct most_interface *iface, int channel)
+static void hdm_request_netinfo(struct most_interface *iface, int channel)
 {
struct most_dev *mdev;
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] Staging: most: static keyword missing

2015-08-02 Thread Adrian Remonda
This is a patch to the mostcore/core.c file. It makes
several local functions static to prevent global visibility.

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/mostcore/core.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index f4f903404f1b..8d1b68dbeaf8 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -178,7 +178,7 @@ static void most_free_mbo_coherent(struct mbo *mbo)
  * flush_channel_fifos - clear the channel fifos
  * @c: pointer to channel object
  */
-void flush_channel_fifos(struct most_c_obj *c)
+static void flush_channel_fifos(struct most_c_obj *c)
 {
unsigned long flags, hf_flags;
struct mbo *mbo, *tmp;
@@ -888,7 +888,7 @@ static ssize_t show_add_link(struct most_aim_obj *aim_obj,
  * Input: "mdev0:ch0@ep_81"
  * Output: *a -> "mdev0", *b -> "ch0@ep_81", *c == NULL
  */
-int split_string(char *buf, char **a, char **b, char **c)
+static int split_string(char *buf, char **a, char **b, char **c)
 {
*a = strsep(&buf, ":");
if (!*a)
@@ -1006,7 +1006,7 @@ static ssize_t store_add_link(struct most_aim_obj 
*aim_obj,
return len;
 }
 
-struct most_aim_attribute most_aim_attr_add_link =
+static struct most_aim_attribute most_aim_attr_add_link =
__ATTR(add_link, S_IRUGO | S_IWUSR, show_add_link, store_add_link);
 
 static ssize_t show_remove_link(struct most_aim_obj *aim_obj,
@@ -1057,7 +1057,7 @@ static ssize_t store_remove_link(struct most_aim_obj 
*aim_obj,
return len;
 }
 
-struct most_aim_attribute most_aim_attr_remove_link =
+static struct most_aim_attribute most_aim_attr_remove_link =
__ATTR(remove_link, S_IRUGO | S_IWUSR, show_remove_link, 
store_remove_link);
 
 static struct attribute *most_aim_def_attrs[] = {
@@ -1121,14 +1121,14 @@ static void destroy_most_aim_obj(struct most_aim_obj *p)
 /**
  * Instantiation of the MOST bus
  */
-struct bus_type most_bus = {
+static struct bus_type most_bus = {
.name = "most",
 };
 
 /**
  * Instantiation of the core driver
  */
-struct device_driver mostcore = {
+static struct device_driver mostcore = {
.name = "mostcore",
.bus = &most_bus,
 };
@@ -1255,7 +1255,7 @@ static void arm_mbo(struct mbo *mbo)
  *
  * Returns the number of allocated and enqueued MBOs.
  */
-int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct mbo *))
+static int arm_mbo_chain(struct most_c_obj *c, int dir, void (*compl)(struct 
mbo *))
 {
unsigned int i;
int retval;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Plain integer instead of NULL pointer fix

2015-08-02 Thread Adrian Remonda
This patch fix the using plain integer as NULL pointer

Signed-off-by: Adrian Remonda 
---
 drivers/staging/most/mostcore/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index 8d1b68dbeaf8..7e338217779c 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -982,7 +982,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
if (ret)
return ret;
 
-   if (mdev_devnod == 0 || *mdev_devnod == 0) {
+   if (mdev_devnod == NULL || *mdev_devnod == 0) {
snprintf(devnod_buf, PAGE_SIZE, "%s-%s", mdev, mdev_ch);
mdev_devnod = devnod_buf;
}
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/4] Staging: most: several warnings fix reported by sparse

2015-08-02 Thread Adrian Remonda
This patch series fix several warnings reported by the Sparse tool

Adrian Remonda (4):
  This is a patch to the mostcore/core.c file. It makes several local   
 functions static to prevent global visibility.
  This patch fix the using plain integer as NULL pointer
  This is a patch to the most/hdm-usb/hdm_usb.c file. It makes several  
  local functions static to prevent global visibility.
  This patch fix the using plain integer as NULL pointer

 drivers/staging/most/hdm-dim2/dim2_hal.c |  2 +-
 drivers/staging/most/hdm-usb/hdm_usb.c   | 14 +++---
 drivers/staging/most/mostcore/core.c | 16 
 3 files changed, 16 insertions(+), 16 deletions(-)

-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Staging: fbtft: Use a struct to describe each LCD controller

2015-08-02 Thread Noralf Trønnes


Den 02.08.2015 16:57, skrev Fabio Falzoi:

Use a struct flexfb_lcd_controller to holds chip properties, instead of
relying on a long 'if - else if' chain.
This allows to:
- use a simple linear search to verify if a certain LCD controller
model is supported or not.
- add support for a new LCD chip controller simply defining a new
flexfb_lcd_controller struct.

Signed-off-by: Fabio Falzoi 
Acked-by: Noralf Trønnes 
---


Seems I wasn't clear enough, you could use my ack if you put
struct flexfb_lcd_controller inside the driver and not in
fbtft.h


Noralf.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] Revert "Staging : lustre: Struct file_operations should be const"

2015-08-02 Thread Shraddha Barke
Declare the file_operations structure ll_file_operations as const, as done
elsewhere in the kernel, as there are no modifications to its fields.

Problem found using checkpatch.

Signed-off-by: Shraddha Barke 
---
Changes in v2:
  - Make the commit message more clearer.

 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 369a722..dcd0c6d 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3116,7 +3116,7 @@ int ll_inode_permission(struct inode *inode, int mask)
 }
 
 /* -o localflock - only provides locally consistent flock locks */
-const struct file_operations ll_file_operations = {
+struct file_operations ll_file_operations = {
.read_iter = ll_file_read_iter,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: echo_client: fix sparse declaration warnings

2015-08-02 Thread Zoltán Lajos Kis
Fixes the following sparse warnings:

drivers/staging/lustre/lustre/obdecho/echo_client.c:2142:5: warning:
symbol 'echo_client_init' was not declared. Should it be static?
drivers/staging/lustre/lustre/obdecho/echo_client.c:2157:6: warning:
symbol 'echo_client_exit' was not declared. Should it be static?

Signed-off-by: Zoltán Lajos Kis "
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index de6f795..27bd170 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -2139,7 +2139,7 @@ static struct obd_ops echo_client_obd_ops = {
.o_disconnect  = echo_client_disconnect
 };
 
-int echo_client_init(void)
+static int echo_client_init(void)
 {
int rc;
 
@@ -2154,7 +2154,7 @@ int echo_client_init(void)
return rc;
 }
 
-void echo_client_exit(void)
+static void echo_client_exit(void)
 {
class_unregister_type(LUSTRE_ECHO_CLIENT_NAME);
lu_kmem_fini(echo_caches);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] drivers: staging: wilc1000: remove space after '('

2015-08-02 Thread Chandra S Gorentla
The character ' ' is removed after the character '('.  This fixes the
checkpatch.pl error - "space prohibited after that open
parenthesis '('".

Signed-off-by: Chandra S Gorentla 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b995056..c3be9ed 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1675,7 +1675,7 @@ static int WILC_WFI_get_station(struct wiphy *wiphy, 
struct net_device *dev,
 * kernel version 3.0.0
 */
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) |
-   BIT( 
NL80211_STA_INFO_RX_PACKETS) |
+   
BIT(NL80211_STA_INFO_RX_PACKETS) |

BIT(NL80211_STA_INFO_TX_PACKETS) |
BIT(NL80211_STA_INFO_TX_FAILED) 
|

BIT(NL80211_STA_INFO_TX_BITRATE);
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] drivers: staging: wilc1000: move { to previous line

2015-08-02 Thread Chandra S Gorentla
Moved the opening brace of code blocks to the previous lines.  This
fixes the checkpatch.pl error - "that open brace { should be on the
previous line".

Signed-off-by: Chandra S Gorentla 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1d0b7f8..b995056 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1205,8 +1205,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 k
 
 
 
-   if (!pairwise)
-   {
+   if (!pairwise) {
if (params->cipher == WLAN_CIPHER_SUITE_TKIP)
u8gmode = ENCRYPT_ENABLED | WPA | TKIP;
else
@@ -1304,8 +1303,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 k
 
{
u8mode = 0;
-   if (!pairwise)
-   {
+   if (!pairwise) {
if (params->key_len > 16 && params->cipher == 
WLAN_CIPHER_SUITE_TKIP) {
/* swap the tx mic by rx mic */
pu8RxMic = params->key + 24;
@@ -1531,8 +1529,7 @@ static int WILC_WFI_get_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 k
priv = wiphy_priv(wiphy);
 
 
-   if (!pairwise)
-   {
+   if (!pairwise) {
PRINT_D(CFG80211_DBG, "Getting group key idx: %x\n", key_index);
 
key_params.key = priv->wilc_gtk[key_index]->key;
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] drivers: staging: wilc1000: use 'void' for no arguments functions

2015-08-02 Thread Chandra S Gorentla
Added 'void' keyword in the paranthesis of function definitions, when
there are no arguments to the functions.  This fixes the checkpatch.pl
error - "Bad function definition 'function()' should probably be
function(void)".

Signed-off-by: Chandra S Gorentla 
---
 drivers/staging/wilc1000/linux_mon.c  | 2 +-
 drivers/staging/wilc1000/linux_wlan.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index d812a3b..65d60af 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -567,7 +567,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char 
*name, struct net_devi
  *  @date  12 JUL 2012
  *  @version   1.0
  */
-int WILC_WFI_deinit_mon_interface()
+int WILC_WFI_deinit_mon_interface(void)
 {
bool rollback_lock = false;
 
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 5a794df..443be4e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -215,7 +215,7 @@ void printk_later(const char *format, ...)
 }
 
 
-void dump_logs()
+void dump_logs(void)
 {
if (DebugBuffer[0]) {
DebugBuffer[DEGUG_BUFFER_LENGTH] = 0;
@@ -229,7 +229,7 @@ void dump_logs()
}
 }
 
-void Reset_WatchDogdebugger()
+void Reset_WatchDogdebugger(void)
 {
WatchDogdebuggerCounter = 0;
 }
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


drivers: staging: wilc1000: Fix a few style erros

2015-08-02 Thread Chandra S Gorentla
These patches fixes a few style errors reported by checkpatch.pl.
PATCH 3/3 should be applied after PATCH 2/3.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] Staging: fbtft: Use a struct to describe each LCD controller

2015-08-02 Thread Fabio Falzoi
Use a struct flexfb_lcd_controller to holds chip properties, instead of
relying on a long 'if - else if' chain.
This allows to:
- use a simple linear search to verify if a certain LCD controller
model is supported or not.
- add support for a new LCD chip controller simply defining a new
flexfb_lcd_controller struct.

Signed-off-by: Fabio Falzoi 
Acked-by: Noralf Trønnes 
---
 drivers/staging/fbtft/fbtft.h  |  20 
 drivers/staging/fbtft/flexfb.c | 203 ++---
 2 files changed, 127 insertions(+), 96 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 7d817eb..c96c06b 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -256,6 +256,26 @@ struct fbtft_par {
void *extra;
 };
 
+/**
+ * struct flexfb_lcd_controller - Describes the LCD controller properties
+ * @name: Model name of the chip
+ * @width: Width of display in pixels
+ * @height: Height of display in pixels
+ * @setaddrwin: Which set_addr_win() implementation to use
+ * @regwidth: LCD Controller Register width in bits
+ * @init_seq: LCD initialization sequence
+ * @init_seq_sz: Size of LCD initialization sequence
+ */
+struct flexfb_lcd_controller {
+   const char *name;
+   unsigned int width;
+   unsigned int height;
+   unsigned int setaddrwin;
+   unsigned int regwidth;
+   int *init_seq;
+   int init_seq_sz;
+};
+
 #define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__})/sizeof(int))
 
 #define write_reg(par, ...)  \
diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index ce6e3ae..e70678f 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -126,6 +126,80 @@ static int ssd1351_init[] = { -1, 0xfd, 0x12, -1, 0xfd, 
0xb1, -1, 0xae, -1, 0xb3
  -1, 0xab, 0x01, -1, 0xb1, 0x32, -1, 0xb4, 0xa0, 
0xb5, 0x55, -1, 0xbb, 0x17, -1, 0xbe, 0x05,
  -1, 0xc1, 0xc8, 0x80, 0xc8, -1, 0xc7, 0x0f, -1, 
0xb6, 0x01, -1, 0xa6, -1, 0xaf, -3 };
 
+static const struct flexfb_lcd_controller flexfb_chip_table[] = {
+   {
+   .name = "st7735r",
+   .width = 120,
+   .height = 160,
+   .init_seq = st7735r_init,
+   .init_seq_sz = ARRAY_SIZE(st7735r_init),
+   }, {
+   .name = "hx8340bn",
+   .width = 176,
+   .height = 220,
+   .init_seq = hx8340bn_init,
+   .init_seq_sz = ARRAY_SIZE(hx8340bn_init),
+   }, {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   }, {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   }, {
+   .name = "ili9225",
+   .width = 176,
+   .height = 220,
+   .regwidth = 16,
+   .init_seq = ili9225_init,
+   .init_seq_sz = ARRAY_SIZE(ili9225_init),
+   }, {
+   .name = "ili9320",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 1,
+   .regwidth = 16,
+   .init_seq = ili9320_init,
+   .init_seq_sz = ARRAY_SIZE(ili9320_init),
+   }, {
+   .name = "ili9325",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 1,
+   .regwidth = 16,
+   .init_seq = ili9325_init,
+   .init_seq_sz = ARRAY_SIZE(ili9325_init),
+   }, {
+   .name = "ili9341",
+   .width = 240,
+   .height = 320,
+   .init_seq = ili9341_init,
+   .init_seq_sz = ARRAY_SIZE(ili9341_init),
+   }, {
+   .name = "ssd1289",
+   .width = 240,
+   .height = 320,
+   .setaddrwin = 2,
+   .regwidth = 16,
+   .init_seq = ssd1289_init,
+   .init_seq_sz = ARRAY_SIZE(ssd1289_init),
+   }, {
+   .name = "ssd1351",
+   .width = 128,
+   .height = 128,
+   .setaddrwin = 3,
+   .init_seq = ssd1351_init,
+   .init_seq_sz = ARRAY_SIZE(ssd1351_init),
+   },
+};
+
 /* ili9320, ili9325 */
 static void flexfb_set_addr_win_1(struct fbtft_par *par,
  int xs, int ys, int xe, int ye)
@@ -247,8 +321,38 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par)
return 0;
 }
 
+static void flexfb_chip_load_param(const struct flexfb_lcd_controller *chip)
+{
+   if (!width)
+   width = chip->width;
+   if (!

Re: [PATCH 4/6] drivers, staging, unisys Add visorbus module autoloading code

2015-08-02 Thread Prarit Bhargava


On 07/31/2015 07:07 PM, Greg KH wrote:
> On Fri, Jul 24, 2015 at 12:06:54PM -0400, Benjamin Romer wrote:
>> From: Prarit Bhargava 
>>
>> This patch adds an module alias and a MODULE_DEVICE_TABLE to autoload the
>> visorhba driver when an appropriate device is created by the visorbus.
>>
>> Signed-off-by: Prarit Bhargava 
>> ---
>>  drivers/staging/unisys/visorhba/visorhba_main.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
>> b/drivers/staging/unisys/visorhba/visorhba_main.c
>> index 031c6fa..50ecdf2 100644
>> --- a/drivers/staging/unisys/visorhba/visorhba_main.c
>> +++ b/drivers/staging/unisys/visorhba/visorhba_main.c
>> @@ -80,6 +80,8 @@ static struct visor_driver visorhba_driver = {
>>  .resume = visorhba_resume,
>>  .channel_interrupt = NULL,
>>  };
>> +MODULE_DEVICE_TABLE(visorbus, visorhba_channel_types);
>> +MODULE_ALIAS("visorbus:" SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR);
> 
> You shouldn't have to write MODULE_ALIAS lines "by hand", they should be
> generated for you automagically from the MODULE_DEVICE_TABLE() define,
> if you do it right.
> 
> You all didn't do it right :)
> 
> Please fix up.
> 

Whups.  Will fix up.

P.

> thanks,
> 
> greg k-h
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging : lustre : Insert blank line after declaration

2015-08-02 Thread Shraddha Barke
This patch fixes the following checkpatch.pl warning:

WARNING: Missing a blank line after declarations

Signed-off-by: Shraddha Barke 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index f097d4d..19f6d2e 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -1001,6 +1001,7 @@ static inline struct obd_export *ll_s2mdexp(struct 
super_block *sb)
 static inline struct client_obd *sbi2mdc(struct ll_sb_info *sbi)
 {
struct obd_device *obd = sbi->ll_md_exp->exp_obd;
+
if (obd == NULL)
LBUG();
return &obd->u.cli;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging : lustre: Struct file_operations should be const

2015-08-02 Thread Julia Lawall


On Sun, 2 Aug 2015, Shraddha Barke wrote:

> This patch fixes the following checkpatch.pl warning:
> 
> WARNING: struct file_operations should normally be const

This is not the good way to write the message.  The information it conveys 
is "checkpatch generated this warning, so I have made some change 
(unspecified) that make checkpatch not complain".

A better approach would be to say:

Declare the file_operations structure ll_file_operations as const, as done 
elsewhere in the kernel, as there are no modifications to its fields.

Problem found using checkpatch.

This way the reader knows what was done, and what issues were taken into 
account when making the change.  At the same time, you still credit 
checkpatch for helping you find the problem

julia

> 
> Signed-off-by: Shraddha Barke 
> ---
>  drivers/staging/lustre/lustre/llite/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c 
> b/drivers/staging/lustre/lustre/llite/file.c
> index dcd0c6d..369a722 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -3116,7 +3116,7 @@ int ll_inode_permission(struct inode *inode, int mask)
>  }
>  
>  /* -o localflock - only provides locally consistent flock locks */
> -struct file_operations ll_file_operations = {
> +const struct file_operations ll_file_operations = {
>   .read_iter = ll_file_read_iter,
>   .write_iter = ll_file_write_iter,
>   .unlocked_ioctl = ll_file_ioctl,
> -- 
> 2.1.0
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging : lustre: Struct file_operations should be const

2015-08-02 Thread Shraddha Barke
This patch fixes the following checkpatch.pl warning:

WARNING: struct file_operations should normally be const

Signed-off-by: Shraddha Barke 
---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index dcd0c6d..369a722 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3116,7 +3116,7 @@ int ll_inode_permission(struct inode *inode, int mask)
 }
 
 /* -o localflock - only provides locally consistent flock locks */
-struct file_operations ll_file_operations = {
+const struct file_operations ll_file_operations = {
.read_iter = ll_file_read_iter,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: wilc1000 :Insert blank line after declaration

2015-08-02 Thread Shraddha Barke
This patch fixes the following checkpatch.pl warning:

WARNING: Missing a blank line after declarations

Signed-off-by: Shraddha Barke 
---
 drivers/staging/wilc1000/coreconfigurator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 9cb46bb..a6d809f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -1152,6 +1152,7 @@ void ProcessShortWid(char *pcPacket, s32 *ps32PktLen,
u16 *pu16val = (u16 *)ps8WidVal;
u16 u16val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set SHORT val 0x%x ,NULL 
structure\n", u16val);
return;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 06/11] staging: android: Allow compile test of GPIO consumers if !GPIOLIB

2015-08-02 Thread Geert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven 
Acked-by: Linus Walleij 
---
v2:
  - Add Acked-by.
---
 drivers/staging/android/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 24d657b3ab9946d0..68307121c9c18830 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -20,7 +20,8 @@ config ANDROID_TIMED_OUTPUT
 
 config ANDROID_TIMED_GPIO
tristate "Android timed gpio driver"
-   depends on GPIOLIB && ANDROID_TIMED_OUTPUT
+   depends on GPIOLIB || COMPILE_TEST
+   depends on ANDROID_TIMED_OUTPUT
default n
 ---help---
  Unlike generic gpio is to allow programs to access and manipulate gpio
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 07/11] staging: fbtft: Allow compile test of GPIO consumers if !GPIOLIB

2015-08-02 Thread Geert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven 
Acked-by: Linus Walleij 
---
v2:
  - Add Acked-by.
---
 drivers/staging/fbtft/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
index f7e68fdd99047927..d473010fa4748409 100644
--- a/drivers/staging/fbtft/Kconfig
+++ b/drivers/staging/fbtft/Kconfig
@@ -1,6 +1,7 @@
 menuconfig FB_TFT
tristate "Support for small TFT LCD display modules"
-   depends on FB && SPI && GPIOLIB
+   depends on FB && SPI
+   depends on GPIOLIB || COMPILE_TEST
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs

2015-08-02 Thread Thomas Gleixner
On Sun, 2 Aug 2015, ja...@microsoft.com wrote:
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

I seriously doubt, that you need all of these includes.

> +/* Interrupt management hooks */
> +
> +/**
> + * hv_msi_free() - Free the MSI.
> + * @domain:  The interrupt domain pointer
> + * @info:Extra MSI-related context
> + * @virq:Identifies the IRQ.
> + *
> + * The Hyper-V parent partition and hypervisor are tracking the
> + * messages that are in use, keeping the interrupt redirection
> + * table up to date.  This callback sends a message that frees
> + * the the IRT entry and related tracking nonsense.
> + */
> +void hv_msi_free(struct irq_domain *domain, struct msi_domain_info *info,
> +  unsigned int virq)

static?

> +{
> + struct pci_delete_interrupt *int_pkt;
> + struct {
> + struct pci_packet pkt;
> + u8 buffer[sizeof(struct pci_delete_interrupt) -
> +   sizeof(struct pci_message)];
> + } ctxt;
> + struct hv_pcibus_device *hbus;
> + struct hv_pci_dev *hpdev;
> + struct irq_desc *desc;
> + struct msi_desc *msi;
> + struct tran_int_desc *int_desc;
> + struct irq_desc *irq_desc;
> +
> + desc = irq_to_desc(virq);
> + msi = irq_desc_get_msi_desc(desc);

Why do you need to lookup the irq descriptor if you want the msi descriptor?

> + hbus = info->data;
> + hpdev = lookup_hv_dev(hbus, devfn_to_wslot(msi->dev->devfn));
> + if (!hpdev)
> + return;
> +
> + int_desc = irq_get_handler_data(virq);

I don't think this is a proper storage point. The data is domain/chip
specific, right? So, what's wrong with storing it in irq_data::chip_data?

> + if (int_desc) {
> + memset(&ctxt, 0, sizeof(ctxt));
> + int_pkt = (struct pci_delete_interrupt *)&ctxt.pkt.message;
> + int_pkt->message_type.message_type =
> + PCI_DELETE_INTERRUPT_MESSAGE;
> + int_pkt->wslot.slot = hpdev->desc.win_slot.slot;
> + int_pkt->int_desc = *int_desc;
> + vmbus_sendpacket(hbus->hdev->channel, int_pkt, sizeof(*int_pkt),
> +  (unsigned long)&ctxt.pkt, VM_PKT_DATA_INBAND,
> +  0);
> + kfree(int_desc);

Free before clearing the reference?

> + irq_desc = irq_to_desc(virq);

Do you expect the descriptor to change between the lookup above and
this one?

> + irq_desc->irq_data.handler_data = NULL;

You are not supposed to fiddle in irq_desc or irq_data internals. We
have helper functions for that.

> + }
> +
> + hv_pcichild_dec(hpdev, hv_pcidev_ref_by_slot);
> +}
> +
> +int hv_set_affinity(struct irq_data *data, const struct cpumask *dest,
> + bool force)

static, if at all.

> +{
> + struct irq_data *parent = data->parent_data;
> +
> + return parent->chip->irq_set_affinity(parent, dest, force);
> +}

irq_chip_set_affinity_parent ???

> +/**
> + * hv_compose_msi_msg() - Supplies a valid MSI address/data
> + * @data:Everything about this MSI
> + * @msg: Buffer that is filled in by this function
> + *
> + * This function unpacks the IRQ looking for target CPU set, IDT
> + * vector and mode and sends a message to the parent partition
> + * asking for a mapping for that tuple in this partition.  The
> + * response supplies a data value and address to which that data
> + * should be written to trigger that interrupt.
> + */
> +void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)

static ?

> +{
> + struct irq_cfg *cfg = irqd_cfg(data);
> + struct hv_pcibus_device *hbus;
> + struct hv_pci_dev *hpdev;
> + struct pci_bus *pbus;
> + struct pci_create_interrupt *int_pkt;
> + struct compose_comp_ctxt comp;
> + struct tran_int_desc *int_desc;
> + struct irq_desc *irq_desc;
> + struct {
> + struct pci_packet pkt;
> + u8 buffer[sizeof(struct pci_create_interrupt) -
> +   sizeof(struct pci_message)];
> + } ctxt;
> + int cpu;
> + int ret;
> +
> + pbus = data->msi_desc->dev->bus;
> + hbus = container_of(pbus->sysdata, struct hv_pcibus_device, sysdata);
> + hpdev = lookup_hv_dev(hbus, devfn_to_wslot(data->msi_desc->dev->devfn));
> +
> + if (!hpdev)
> + goto return_null_message;
> +
> + int_desc = kzalloc(sizeof(*int_desc), GFP_KERNEL);
> + if (!int_desc)
> + goto return_null_message;
> +
> + memset(&ctxt, 0, sizeof(ctxt));
> + init_completion(&comp.comp_pkt.host_event);
> + ctxt.pkt.completion_func = hv_pci_compose_compl;
> + ctxt.pkt.compl_ctxt = ∁
> + int_pkt = (struct pci_create_interrupt *)&ctxt.pkt.message;
> + int_pkt->message_type.message_type = PCI_CREATE_INT