[PATCH] staging: vme: Fix a small coding style issue in vme_user.c

2014-04-02 Thread Bojan Prtvar
The checkpatch.pl complains about missing blank line after declaration.
This patch silence the warning.

Signed-off-by: Bojan Prtvar 
---
 This patch is for Eudyptula Challenge task 10

 drivers/staging/vme/devices/vme_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 7927927..481192a 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -791,6 +791,7 @@ static int vme_user_probe(struct vme_dev *vdev)
/* Add sysfs Entries */
for (i = 0; i < VME_DEVS; i++) {
int num;
+
switch (type[i]) {
case MASTER_MINOR:
sprintf(name, "bus/vme/m%%d");
-- 
1.9.1.286.g5172cb3

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


Re: [PATCH] staging: vme: Fix a small coding style issue in vme_user.c

2014-04-03 Thread bojan prtvar
On Thu, Apr 3, 2014 at 5:14 PM, walter harms  wrote:

> beside style:
> that sprint looks like as it could be replaced with a
>  name="bus/vme/m%%d"
>
> any takers ?
>
> re,
>  wh
>

Hi Walter,

I guess you mean something like this? Please review carefully if I got
right "%%d" intent.
Now a basic question. How to submit this properly? As a v2 patch with
both changes taken or as a two-patch serie?



diff --git a/drivers/staging/vme/devices/vme_user.c
b/drivers/staging/vme/devices/vme_user.c
index 481192a..5fa7f83 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -684,7 +684,7 @@ static int vme_user_match(struct vme_dev *vdev)
 static int vme_user_probe(struct vme_dev *vdev)
 {
int i, err;
-   char name[12];
+   char *name;

/* Save pointer to the bridge device */
if (vme_user_bridge != NULL) {
@@ -794,13 +794,13 @@ static int vme_user_probe(struct vme_dev *vdev)

switch (type[i]) {
case MASTER_MINOR:
-   sprintf(name, "bus/vme/m%%d");
+   name = "bus/vme/m%d";
break;
case CONTROL_MINOR:
-   sprintf(name, "bus/vme/ctl");
+   name = "bus/vme/ctl";
break;
case SLAVE_MINOR:
-   sprintf(name, "bus/vme/s%%d");
+   name = "bus/vme/s%d";
break;
default:
err = -EINVAL;



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


[PATCH] staging: vme: Simplfy string usage in vme_user_probe()

2014-04-03 Thread Bojan Prtvar
We can avoid usage of sprintf() and magic-sized array with simple pointer 
assignment.

Signed-off-by: Bojan Prtvar 
---
This parch should be applied on top of 
"staging: vme: Fix a small coding style issue in vme_user.c"

Compile tested only.

 drivers/staging/vme/devices/vme_user.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 481192a..5fa7f83 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -684,7 +684,7 @@ static int vme_user_match(struct vme_dev *vdev)
 static int vme_user_probe(struct vme_dev *vdev)
 {
int i, err;
-   char name[12];
+   char *name;
 
/* Save pointer to the bridge device */
if (vme_user_bridge != NULL) {
@@ -794,13 +794,13 @@ static int vme_user_probe(struct vme_dev *vdev)
 
switch (type[i]) {
case MASTER_MINOR:
-   sprintf(name, "bus/vme/m%%d");
+   name = "bus/vme/m%d";
break;
case CONTROL_MINOR:
-   sprintf(name, "bus/vme/ctl");
+   name = "bus/vme/ctl";
break;
case SLAVE_MINOR:
-   sprintf(name, "bus/vme/s%%d");
+   name = "bus/vme/s%d";
break;
default:
err = -EINVAL;
-- 
1.9.1.286.g5172cb3

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


[PATCH] Staging: crystalhd: Mark local functions as static

2014-04-18 Thread Bojan Prtvar
This fixes the following sparse warnings:
drivers/staging/crystalhd/crystalhd_lnx.c:631:5: warning: symbol 
'chd_dec_pci_suspend' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:665:5: warning: symbol 
'chd_dec_pci_resume' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning: symbol 
'chd_dec_alloc_iodata' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning: symbol 
'chd_dec_free_iodata' was not declared. Should it be static?

Signed-off-by: Bojan Prtvar 
---
 drivers/staging/crystalhd/crystalhd_lnx.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
b/drivers/staging/crystalhd/crystalhd_lnx.c
index c1f6163..590e0b8 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -75,8 +75,8 @@ static int chd_dec_disable_int(struct crystalhd_adp *adp)
return 0;
 }
 
-struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
-bool isr)
+static struct crystalhd_ioctl_data *
+chd_dec_alloc_iodata(struct crystalhd_adp *adp, bool isr)
 {
unsigned long flags = 0;
struct crystalhd_ioctl_data *temp;
@@ -96,7 +96,7 @@ struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct 
crystalhd_adp *adp,
return temp;
 }
 
-void chd_dec_free_iodata(struct crystalhd_adp *adp,
+static void chd_dec_free_iodata(struct crystalhd_adp *adp,
 struct crystalhd_ioctl_data *iodata, bool isr)
 {
unsigned long flags = 0;
@@ -628,7 +628,7 @@ err:
 }
 
 #ifdef CONFIG_PM
-int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+static int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
struct crystalhd_adp *adp;
struct crystalhd_ioctl_data *temp;
@@ -662,7 +662,7 @@ int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t 
state)
return 0;
 }
 
-int chd_dec_pci_resume(struct pci_dev *pdev)
+static int chd_dec_pci_resume(struct pci_dev *pdev)
 {
struct crystalhd_adp *adp;
enum BC_STATUS sts = BC_STS_SUCCESS;
-- 
1.7.9.5

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


Re: [PATCH] Staging: crystalhd: Mark local functions as static

2014-04-19 Thread bojan prtvar
On Sat, Apr 19, 2014 at 1:23 AM, Greg KH  wrote:
> On Fri, Apr 18, 2014 at 07:57:51PM +0200, Bojan Prtvar wrote:
>> This fixes the following sparse warnings:
>> drivers/staging/crystalhd/crystalhd_lnx.c:631:5: warning: symbol 
>> 'chd_dec_pci_suspend' was not declared. Should it be static?
>> drivers/staging/crystalhd/crystalhd_lnx.c:665:5: warning: symbol 
>> 'chd_dec_pci_resume' was not declared. Should it be static?
>> drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning: symbol 
>> 'chd_dec_alloc_iodata' was not declared. Should it be static?
>> drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning: symbol 
>> 'chd_dec_free_iodata' was not declared. Should it be static?
>>
>> Signed-off-by: Bojan Prtvar 
>> ---
>>  drivers/staging/crystalhd/crystalhd_lnx.c |   10 +-
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> This patch doesn't apply to my tree, can you redo it and resend?
>
> thanks,
>
> greg k-h

I cloned your tree
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
and on master branch I see work is already done in

commit 038d3f882926bf49562e5f119957fd81015a9390
Author: Valentina Manea 
Date:   Mon Oct 7 23:12:14 2013 +0300

Now what confuses me is the date of this patch. Why I didn't see it
linux-next and even in vanilla?
I know this question goes under 'basic workflow section'.

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


Re: [PATCH] Staging: crystalhd: Mark local functions as static

2014-04-19 Thread bojan prtvar
On Sat, Apr 19, 2014 at 9:58 AM, bojan prtvar  wrote:
> On Sat, Apr 19, 2014 at 1:23 AM, Greg KH  wrote:
>> On Fri, Apr 18, 2014 at 07:57:51PM +0200, Bojan Prtvar wrote:
>>> This fixes the following sparse warnings:
>>> drivers/staging/crystalhd/crystalhd_lnx.c:631:5: warning: symbol 
>>> 'chd_dec_pci_suspend' was not declared. Should it be static?
>>> drivers/staging/crystalhd/crystalhd_lnx.c:665:5: warning: symbol 
>>> 'chd_dec_pci_resume' was not declared. Should it be static?
>>> drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning: symbol 
>>> 'chd_dec_alloc_iodata' was not declared. Should it be static?
>>> drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning: symbol 
>>> 'chd_dec_free_iodata' was not declared. Should it be static?
>>>
>>> Signed-off-by: Bojan Prtvar 
>>> ---
>>>  drivers/staging/crystalhd/crystalhd_lnx.c |   10 +-
>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> This patch doesn't apply to my tree, can you redo it and resend?
>>
>> thanks,
>>
>> greg k-h
>
> I cloned your tree
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> and on master branch I see work is already done in
>
> commit 038d3f882926bf49562e5f119957fd81015a9390
> Author: Valentina Manea 
> Date:   Mon Oct 7 23:12:14 2013 +0300
>
> Now what confuses me is the date of this patch. Why I didn't see it
> linux-next and even in vanilla?
> I know this question goes under 'basic workflow section'.
>
> Regards,
> Bojan

I re-checked. Everything is OK with  038d3f8829. I made a mess in my
local branches.
Drop this one. And sorry for the noise.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: android: add __user annotation in binder.c

2013-09-01 Thread Bojan Prtvar
This fixes the following sparse error
drivers/staging/android/binder.c:1795:36: error: incompatible types in 
comparison expression (different address spaces)

Signed-off-by: Bojan Prtvar 
---
 drivers/staging/android/binder.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 98ac020..19e6ba6 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1773,7 +1773,7 @@ int binder_thread_write(struct binder_proc *proc, struct 
binder_thread *thread,
case BC_INCREFS_DONE:
case BC_ACQUIRE_DONE: {
void __user *node_ptr;
-   void *cookie;
+   void __user *cookie;
struct binder_node *node;
 
if (get_user(node_ptr, (void * __user *)ptr))
-- 
1.7.1

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


[PATCH] Staging: android: Mark local functions in binder.c as static

2013-09-01 Thread Bojan Prtvar
This fixes the following sparse warnings
drivers/staging/android/binder.c:1703:5: warning: symbol 'binder_thread_write' 
was not declared. Should it be static?
drivers/staging/android/binder.c:2058:6: warning: symbol 'binder_stat_br' was 
not declared. Should it be static?

Signed-off-by: Bojan Prtvar 
---
 drivers/staging/android/binder.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 98ac020..82b5861 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1700,7 +1700,8 @@ err_no_context_mgr_node:
thread->return_error = return_error;
 }
 
-int binder_thread_write(struct binder_proc *proc, struct binder_thread *thread,
+static int binder_thread_write(struct binder_proc *proc,
+   struct binder_thread *thread,
void __user *buffer, size_t size, size_t *consumed)
 {
uint32_t cmd;
@@ -2055,7 +2056,8 @@ int binder_thread_write(struct binder_proc *proc, struct 
binder_thread *thread,
return 0;
 }
 
-void binder_stat_br(struct binder_proc *proc, struct binder_thread *thread,
+static void binder_stat_br(struct binder_proc *proc,
+   struct binder_thread *thread,
uint32_t cmd)
 {
trace_binder_return(cmd);
-- 
1.7.1

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


[PATCH v2] Staging: android: Mark local functions in binder.c as static

2013-09-01 Thread Bojan Prtvar
This fixes the following sparse warnings
drivers/staging/android/binder.c:1703:5: warning: symbol 'binder_thread_write' 
was not declared. Should it be static?
drivers/staging/android/binder.c:2058:6: warning: symbol 'binder_stat_br' was 
not declared. Should it be static?

Signed-off-by: Bojan Prtvar 
---
 v2: Fixed indentig as suggested by Dan Carpenter.

 drivers/staging/android/binder.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 98ac020..bb7c816 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -1700,7 +1700,8 @@ err_no_context_mgr_node:
thread->return_error = return_error;
 }
 
-int binder_thread_write(struct binder_proc *proc, struct binder_thread *thread,
+static int binder_thread_write(struct binder_proc *proc,
+   struct binder_thread *thread,
void __user *buffer, size_t size, size_t *consumed)
 {
uint32_t cmd;
@@ -2055,8 +2056,8 @@ int binder_thread_write(struct binder_proc *proc, struct 
binder_thread *thread,
return 0;
 }
 
-void binder_stat_br(struct binder_proc *proc, struct binder_thread *thread,
-   uint32_t cmd)
+static void binder_stat_br(struct binder_proc *proc,
+  struct binder_thread *thread, uint32_t cmd)
 {
trace_binder_return(cmd);
if (_IOC_NR(cmd) < ARRAY_SIZE(binder_stats.br)) {
-- 
1.7.1

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


[PATCH] Staging: android: Remove extern from function prototypes in .h files

2013-09-02 Thread Bojan Prtvar
checkpatch.pl complains that extern prototypes should be avoided in .h files

Signed-off-by: Bojan Prtvar 
---
 drivers/staging/android/timed_output.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/timed_output.h 
b/drivers/staging/android/timed_output.h
index ec907ab..905c7cc 100644
--- a/drivers/staging/android/timed_output.h
+++ b/drivers/staging/android/timed_output.h
@@ -31,7 +31,7 @@ struct timed_output_dev {
int state;
 };
 
-extern int timed_output_dev_register(struct timed_output_dev *dev);
-extern void timed_output_dev_unregister(struct timed_output_dev *dev);
+int timed_output_dev_register(struct timed_output_dev *dev);
+void timed_output_dev_unregister(struct timed_output_dev *dev);
 
 #endif
-- 
1.7.1

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