Re: [PATCH v2] staging: greybus: Use gpio_is_valid()

2018-05-02 Thread Arvind Yadav



On Wednesday 02 May 2018 03:27 PM, Johan Hovold wrote:

On Wed, May 02, 2018 at 03:15:05PM +0530, Arvind Yadav wrote:


On Wednesday 02 May 2018 02:13 PM, Johan Hovold wrote:

On Sat, Apr 28, 2018 at 10:05:39AM +0530, Arvind Yadav wrote:

Replace the manual validity checks for the GPIO with the
gpio_is_valid().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
chnage in v2 :
   Returning invalid gpio as error instead of -ENODEV.

   drivers/staging/greybus/arche-platform.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 83254a7..c3a7da5 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -448,7 +448,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
"svc,reset-gpio",
0);
-   if (arche_pdata->svc_reset_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
dev_err(dev, "failed to get reset-gpio\n");
return arche_pdata->svc_reset_gpio;

I'm sorry, but I don't this change is desirable. of_get_named_gpio()
returns a valid gpio number or a negative errno, so there's no need to
use the legacy gpio_is_valid() helper here.

If you grep for of_get_named_gpio() you'll find that some drivers indeed
use that helper this way, but they are in a clear minority.

And ultimately, we want to move to using gpio descriptors anyway.

We need to check gpio validity. If we are using of_get_named_gpio() or
not.  of_get_name_gpio() will read a device node and fetch the value.
But it'll not check that gpio is valid or not valid.

No, I believe you're mistaken here. of_get_named_gpio() does not return
an arbitrary gpio number, unlike what you could possibly find in
legacy board files and for which the gpio_is_valid() helper made sense.

Johan

Yes, You are coorect. It'll read gpio form gpio device node. Which means
it'll read from device tree node. without finding a valid entry. It'll 
return

an error.

~arvind

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


Re: [PATCH v2] staging: greybus: Use gpio_is_valid()

2018-05-02 Thread Arvind Yadav



On Wednesday 02 May 2018 02:13 PM, Johan Hovold wrote:

On Sat, Apr 28, 2018 at 10:05:39AM +0530, Arvind Yadav wrote:

Replace the manual validity checks for the GPIO with the
gpio_is_valid().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
chnage in v2 :
  Returning invalid gpio as error instead of -ENODEV.

  drivers/staging/greybus/arche-platform.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 83254a7..c3a7da5 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -448,7 +448,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
"svc,reset-gpio",
0);
-   if (arche_pdata->svc_reset_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
dev_err(dev, "failed to get reset-gpio\n");
return arche_pdata->svc_reset_gpio;

I'm sorry, but I don't this change is desirable. of_get_named_gpio()
returns a valid gpio number or a negative errno, so there's no need to
use the legacy gpio_is_valid() helper here.

If you grep for of_get_named_gpio() you'll find that some drivers indeed
use that helper this way, but they are in a clear minority.

And ultimately, we want to move to using gpio descriptors anyway.


We need to check gpio validity. If we are using of_get_named_gpio() or not.
of_get_name_gpio() will read a device node and fetch the value. But 
it'll not

check that gpio is valid or not valid.



}
@@ -468,7 +468,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
  "svc,sysboot-gpio",
  0);
-   if (arche_pdata->svc_sysboot_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_sysboot_gpio)) {
dev_err(dev, "failed to get sysboot gpio\n");
return arche_pdata->svc_sysboot_gpio;
}
@@ -487,7 +487,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_refclk_req = of_get_named_gpio(np,
"svc,refclk-req-gpio",
0);
-   if (arche_pdata->svc_refclk_req < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_refclk_req)) {
dev_err(dev, "failed to get svc clock-req gpio\n");
return arche_pdata->svc_refclk_req;
}

But if this were to be changed, you'd need to update also the fourth
call to of_get_named_gpio() in this function.


Sorry, I missed it. Thanks for point out. I will add check for this.

~arvind


Thanks,
Johan


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


Re: [greybus-dev] [PATCH] staging: greybus: Use gpio_is_valid()

2018-04-27 Thread Arvind Yadav



On Friday 27 April 2018 05:47 PM, Alex Elder wrote:

On 04/27/2018 05:52 AM, Arvind Yadav wrote:

Replace the manual validity checks for the GPIO with the
gpio_is_valid().

I haven't looked through the code paths very closely, but I
think that get_named_gpio() might return -EPROBE_DEFER, which
would be something we want to pass to the caller.

Yes of_get_name_gpio() can return other error value apart from
-EPROBE_DEFER.

So rather than returning -ENODEV and hiding the reason the
call to of_get_named_gpio() failed, you should continue
returning the errno it supplies (if not a valid gpio number).

-Alex

I have return -ENODEV because invalid gpio pin can be positive.
static inline bool gpio_is_valid(int number)
{
return number >= 0 && number < ARCH_NR_GPIOS;
}
Here if number > ARCH_NR_GPIOS then it's invalid but return value
will be positive.

We can return like this
" return (gpio > 0) ? -ENODEV: gpio;"

But not sure this is worth to handle this.

~arvind



Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/greybus/arche-platform.c | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 83254a7..fc6bf60 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -448,9 +448,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
"svc,reset-gpio",
0);
-   if (arche_pdata->svc_reset_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
dev_err(dev, "failed to get reset-gpio\n");
-   return arche_pdata->svc_reset_gpio;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_reset_gpio, "svc-reset");
if (ret) {
@@ -468,9 +468,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
  "svc,sysboot-gpio",
  0);
-   if (arche_pdata->svc_sysboot_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_sysboot_gpio)) {
dev_err(dev, "failed to get sysboot gpio\n");
-   return arche_pdata->svc_sysboot_gpio;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_sysboot_gpio, "sysboot0");
if (ret) {
@@ -487,9 +487,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_refclk_req = of_get_named_gpio(np,
"svc,refclk-req-gpio",
0);
-   if (arche_pdata->svc_refclk_req < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_refclk_req)) {
dev_err(dev, "failed to get svc clock-req gpio\n");
-   return arche_pdata->svc_refclk_req;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_refclk_req,
"svc-clk-req");



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


[PATCH] staging: greybus: Use gpio_is_valid()

2018-04-27 Thread Arvind Yadav
Replace the manual validity checks for the GPIO with the
gpio_is_valid().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/greybus/arche-platform.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 83254a7..fc6bf60 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -448,9 +448,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
"svc,reset-gpio",
0);
-   if (arche_pdata->svc_reset_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
dev_err(dev, "failed to get reset-gpio\n");
-   return arche_pdata->svc_reset_gpio;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_reset_gpio, "svc-reset");
if (ret) {
@@ -468,9 +468,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
  "svc,sysboot-gpio",
  0);
-   if (arche_pdata->svc_sysboot_gpio < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_sysboot_gpio)) {
dev_err(dev, "failed to get sysboot gpio\n");
-   return arche_pdata->svc_sysboot_gpio;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_sysboot_gpio, "sysboot0");
if (ret) {
@@ -487,9 +487,9 @@ static int arche_platform_probe(struct platform_device 
*pdev)
arche_pdata->svc_refclk_req = of_get_named_gpio(np,
"svc,refclk-req-gpio",
0);
-   if (arche_pdata->svc_refclk_req < 0) {
+   if (!gpio_is_valid(arche_pdata->svc_refclk_req)) {
dev_err(dev, "failed to get svc clock-req gpio\n");
-   return arche_pdata->svc_refclk_req;
+   return -ENODEV;
}
ret = devm_gpio_request(dev, arche_pdata->svc_refclk_req,
"svc-clk-req");
-- 
1.9.1

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


[PATCH] vmbus: use put_device() if device_register fail

2018-03-18 Thread Arvind Yadav
if device_register() returned an error. Always use put_device()
to give up the reference initialized.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/hv/vmbus_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index bc65c4d..25da2f3 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1358,6 +1358,7 @@ int vmbus_device_register(struct hv_device 
*child_device_obj)
ret = device_register(_device_obj->device);
if (ret) {
pr_err("Unable to register child device\n");
+   put_device(_device_obj->device);
return ret;
}
 
-- 
2.7.4

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


[PATCH 0/3] Handle return value of platform_get_irq

2017-11-30 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Remove unnecessary 'err' initialization for irda driver.

Arvind Yadav (3):
  [PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking
  [PATCH 2/3] staging: irda: Handle return value of platform_get_irq
  [PATCH 3/3] staging: irda: Remove unnecessary 'err' initialization.

 drivers/staging/iio/trigger/iio-trig-bfin-timer.c |  4 ++--
 drivers/staging/irda/drivers/pxaficp_ir.c | 11 ++-
 2 files changed, 12 insertions(+), 3 deletions(-)

-- 
2.7.4

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


[PATCH 3/3] staging: irda: Remove unnecessary 'err' initialization.

2017-11-30 Thread Arvind Yadav
Here, variable 'err' is already initialised. So no need to reinitialize.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/irda/drivers/pxaficp_ir.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/irda/drivers/pxaficp_ir.c 
b/drivers/staging/irda/drivers/pxaficp_ir.c
index a97ce04..6c77370 100644
--- a/drivers/staging/irda/drivers/pxaficp_ir.c
+++ b/drivers/staging/irda/drivers/pxaficp_ir.c
@@ -807,7 +807,6 @@ static int pxa_irda_start(struct net_device *dev)
 * Open a new IrLAP layer instance.
 */
si->irlap = irlap_open(dev, >qos, "pxa");
-   err = -ENOMEM;
if (!si->irlap)
goto err_irlap;
 
-- 
2.7.4

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


[PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking

2017-11-30 Thread Arvind Yadav
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c 
b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
index d80dcf8..f389f5c 100644
--- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
+++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
@@ -187,9 +187,9 @@ static int iio_bfin_tmr_trigger_probe(struct 
platform_device *pdev)
return -ENOMEM;
 
st->irq = platform_get_irq(pdev, 0);
-   if (!st->irq) {
+   if (st->irq < 0) {
dev_err(>dev, "No IRQs specified");
-   return -ENODEV;
+   return st->irq;
}
 
ret = iio_bfin_tmr_get_number(st->irq);
-- 
2.7.4

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


[PATCH 2/3] staging: irda: Handle return value of platform_get_irq

2017-11-30 Thread Arvind Yadav
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/irda/drivers/pxaficp_ir.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/irda/drivers/pxaficp_ir.c 
b/drivers/staging/irda/drivers/pxaficp_ir.c
index 1dba16b..a97ce04 100644
--- a/drivers/staging/irda/drivers/pxaficp_ir.c
+++ b/drivers/staging/irda/drivers/pxaficp_ir.c
@@ -960,7 +960,17 @@ static int pxa_irda_probe(struct platform_device *pdev)
si->irda_base = ficp;
si->stuart_base = stuart;
si->uart_irq = platform_get_irq(pdev, 0);
+   if (si->uart_irq < 0) {
+   err =  si->uart_irq;
+   goto err_mem_1;
+   }
+
si->icp_irq = platform_get_irq(pdev, 1);
+   if (si->icp_irq < 0) {
+   err =  si->icp_irq;
+   goto err_mem_1;
+   }
+
 
si->sir_clk = devm_clk_get(>dev, "UARTCLK");
si->fir_clk = devm_clk_get(>dev, "FICPCLK");
-- 
2.7.4

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


[PATCH 1/4] staging: ccree: Remove a attribute group from a kobject

2017-11-24 Thread Arvind Yadav
All attribute group created during sys_init_dir() should be removed
in sys_free_dir()

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/ccree/ssi_sysfs.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_sysfs.c 
b/drivers/staging/ccree/ssi_sysfs.c
index 5d39f15..14a3f32 100644
--- a/drivers/staging/ccree/ssi_sysfs.c
+++ b/drivers/staging/ccree/ssi_sysfs.c
@@ -145,8 +145,11 @@ static void sys_free_dir(struct sys_dir *sys_dir)
 
kfree(sys_dir->sys_dir_attr_list);
 
-   if (sys_dir->sys_dir_kobj)
+   if (sys_dir->sys_dir_kobj) {
+   sysfs_remove_group(sys_dir->sys_dir_kobj,
+  _dir->sys_dir_attr_group);
kobject_put(sys_dir->sys_dir_kobj);
+   }
 }
 
 int ssi_sysfs_init(struct kobject *sys_dev_obj, struct ssi_drvdata *drvdata)
-- 
2.7.4

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


[PATCH 4/4] staging: most: Remove a attribute group from a kobject

2017-11-24 Thread Arvind Yadav
All attribute group created during dim2_sysfs_probe() should be removed
in dim2_sysfs_destroy().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/most/hdm-dim2/dim2_sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/most/hdm-dim2/dim2_sysfs.c 
b/drivers/staging/most/hdm-dim2/dim2_sysfs.c
index d8b22f9..c038ff5 100644
--- a/drivers/staging/most/hdm-dim2/dim2_sysfs.c
+++ b/drivers/staging/most/hdm-dim2/dim2_sysfs.c
@@ -111,5 +111,6 @@ int dim2_sysfs_probe(struct medialb_bus *bus, struct 
kobject *parent_kobj)
 
 void dim2_sysfs_destroy(struct medialb_bus *bus)
 {
+   sysfs_remove_group(>kobj_group, _attr_group);
kobject_put(>kobj_group);
 }
-- 
2.7.4

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


[PATCH 2/4] staging: lustre: ldlm: Remove a attribute group from a kobject

2017-11-24 Thread Arvind Yadav
All attribute group created during ldlm_setup() should be removed
in ldlm_cleanup().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index 2d5a2c9..ada50b6 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -1093,8 +1093,10 @@ static int ldlm_cleanup(void)
kset_unregister(ldlm_ns_kset);
if (ldlm_svc_kset)
kset_unregister(ldlm_svc_kset);
-   if (ldlm_kobj)
+   if (ldlm_kobj) {
+   sysfs_remove_group(ldlm_kobj, _attr_group);
kobject_put(ldlm_kobj);
+   }
 
ldlm_debugfs_cleanup();
 
-- 
2.7.4

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


[PATCH 0/4] Remove a attribute group from a kobject

2017-11-24 Thread Arvind Yadav
Arvind Yadav (4):
  [PATCH 1/4] staging: ccree: Remove a attribute group from a kobject
  [PATCH 2/4] staging: lustre: ldlm: Remove a attribute group from a kobject
  [PATCH 3/4] staging: lustre: obdclass: Remove a attribute group from a kobject
  [PATCH 4/4] staging: most: Remove a attribute group from a kobject

 drivers/staging/ccree/ssi_sysfs.c   | 5 -
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 4 +++-
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 3 +++
 drivers/staging/most/hdm-dim2/dim2_sysfs.c  | 1 +
 4 files changed, 11 insertions(+), 2 deletions(-)

-- 
2.7.4

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


[PATCH 3/4] staging: lustre: obdclass: Remove a attribute group from a kobject

2017-11-24 Thread Arvind Yadav
All attribute group created during class_procfs_init() should be
removed.
if class_procfs_init() will fail and also in class_procfs_clean().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index fc59f29..5795123 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -501,6 +501,7 @@ int class_procfs_init(void)
rc = debugfs_lustre_root ? PTR_ERR(debugfs_lustre_root)
 : -ENOMEM;
debugfs_lustre_root = NULL;
+   sysfs_remove_group(lustre_kobj, _attr_group);
kobject_put(lustre_kobj);
goto out;
}
@@ -509,6 +510,7 @@ int class_procfs_init(void)
   _device_list_fops);
if (IS_ERR_OR_NULL(file)) {
rc = file ? PTR_ERR(file) : -ENOMEM;
+   sysfs_remove_group(lustre_kobj, _attr_group);
kobject_put(lustre_kobj);
goto out;
}
@@ -522,6 +524,7 @@ int class_procfs_clean(void)
 
debugfs_lustre_root = NULL;
 
+   sysfs_remove_group(lustre_kobj, _attr_group);
kobject_put(lustre_kobj);
 
return 0;
-- 
2.7.4

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


[PATCH] staging: comedi: ni_atmio: Handle return value of pnp_*

2017-11-15 Thread Arvind Yadav
pnp_irq() and pnp_port_start() can fail here and we must check
its return value.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/comedi/drivers/ni_atmio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/comedi/drivers/ni_atmio.c 
b/drivers/staging/comedi/drivers/ni_atmio.c
index 2d62a8c..dead159 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -308,6 +308,9 @@ static int ni_atmio_attach(struct comedi_device *dev,
 
iobase = pnp_port_start(isapnp_dev, 0);
irq = pnp_irq(isapnp_dev, 0);
+   if (irq == -1 || !iobase)
+   return -ENOMEM;
+
comedi_set_hw_dev(dev, _dev->dev);
}
 
-- 
1.9.1

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


[PATCH] staging: rtl8192e: set priv->irq as 0 after the irq is freed

2017-10-28 Thread Arvind Yadav
_rtl92e_init can fail here, we must set priv->irq as 0 after free_irq.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index aca5265..1ea1142 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1095,6 +1095,7 @@ static short _rtl92e_init(struct net_device *dev)
if (_rtl92e_pci_initdescring(dev) != 0) {
netdev_err(dev, "Endopoints initialization failed");
free_irq(dev->irq, dev);
+   priv->irq = 0;
return -1;
}
 
-- 
2.7.4

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


[PATCH] staging: rtl8723bs: Fix space before '[' error.

2017-10-25 Thread Arvind Yadav
Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c 
b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index 9227745..3f18cb1 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -87,7 +87,7 @@ static ssize_t proc_set_log_level(struct file *file, const 
char __user *buffer,
 * rtw_drv_proc:
 * init/deinit when register/unregister driver
 */
-static const struct rtw_proc_hdl drv_proc_hdls [] = {
+static const struct rtw_proc_hdl drv_proc_hdls[] = {
{"ver_info", proc_get_drv_version, NULL},
{"log_level", proc_get_log_level, proc_set_log_level},
 };
@@ -363,7 +363,7 @@ static int proc_get_cam_cache(struct seq_file *m, void *v)
 * rtw_adapter_proc:
 * init/deinit when register/unregister net_device
 */
-static const struct rtw_proc_hdl adapter_proc_hdls [] = {
+static const struct rtw_proc_hdl adapter_proc_hdls[] = {
{"write_reg", proc_get_dummy, proc_set_write_reg},
{"read_reg", proc_get_read_reg, proc_set_read_reg},
{"fwstate", proc_get_fwstate, NULL},
@@ -598,7 +598,7 @@ ssize_t proc_set_odm_adaptivity(struct file *file, const 
char __user *buffer, si
 * rtw_odm_proc:
 * init/deinit when register/unregister net_device, along with rtw_adapter_proc
 */
-static const struct rtw_proc_hdl odm_proc_hdls [] = {
+static const struct rtw_proc_hdl odm_proc_hdls[] = {
{"dbg_comp", proc_get_odm_dbg_comp, proc_set_odm_dbg_comp},
{"dbg_level", proc_get_odm_dbg_level, proc_set_odm_dbg_level},
{"ability", proc_get_odm_ability, proc_set_odm_ability},
-- 
2.7.4

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


[PATCH v2] staging: comedi: dt282x: fix IRQ assignment for dev->irq.

2017-10-06 Thread Arvind Yadav
Here, dev->irq is not assigned with irq. comedi_legacy_detach()
is using dev->irq for release irq and dt282x_attach() is using dev->irq
for initialize comedi_subdevice.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
changes in v2:
comedi_isadma_alloc() can fail. adding dev->irq assignment after
successful return of comedi_isadma_alloc().

 drivers/staging/comedi/drivers/dt282x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index d5295bb..217a4b8 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1062,6 +1062,8 @@ static void dt282x_alloc_dma(struct comedi_device *dev,
   PAGE_SIZE, 0);
if (!devpriv->dma)
free_irq(irq_num, dev);
+   else
+   dev->irq = irq_num;
 }
 
 static void dt282x_free_dma(struct comedi_device *dev)
-- 
2.7.4

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


[PATCH] staging: comedi: dt282x: fix IRQ assignment for dev->irq.

2017-10-06 Thread Arvind Yadav
Here, dev->irq is not assigned with irq(irq_num). comedi_legacy_detach()
is using dev->irq for release irq and dt282x_attach() is using dev->irq
for initialize comedi_subdevice.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/comedi/drivers/dt282x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index d5295bb..afb7ac2 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1057,6 +1057,8 @@ static void dt282x_alloc_dma(struct comedi_device *dev,
if (request_irq(irq_num, dt282x_interrupt, 0, dev->board_name, dev))
return;
 
+   dev->irq = irq_num;
+
/* DMA uses two 4K buffers with separate DMA channels */
devpriv->dma = comedi_isadma_alloc(dev, 2, dma_chan[0], dma_chan[1],
   PAGE_SIZE, 0);
-- 
2.7.4

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


[PATCH] staging: comedi: dt282x: release irq on dt282x detach

2017-10-06 Thread Arvind Yadav
free_irq() should be called on driver 'dt282x' detach.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/comedi/drivers/dt282x.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index d5295bb..a132f60 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1057,6 +1057,8 @@ static void dt282x_alloc_dma(struct comedi_device *dev,
if (request_irq(irq_num, dt282x_interrupt, 0, dev->board_name, dev))
return;
 
+   dev->irq = irq_num;
+
/* DMA uses two 4K buffers with separate DMA channels */
devpriv->dma = comedi_isadma_alloc(dev, 2, dma_chan[0], dma_chan[1],
   PAGE_SIZE, 0);
@@ -1070,6 +1072,9 @@ static void dt282x_free_dma(struct comedi_device *dev)
 
if (devpriv)
comedi_isadma_free(devpriv->dma);
+
+   if (dev->irq)
+   free_irq(dev->irq, dev);
 }
 
 static int dt282x_initialize(struct comedi_device *dev)
-- 
2.7.4

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


[PATCH 4/4] staging: rtlwifi: pr_err() strings should end with newlines

2017-10-03 Thread Arvind Yadav
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 6 +++---
 drivers/staging/rtlwifi/rtl8822be/phy.c   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c 
b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
index f33024e..eeef8b6 100644
--- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
+++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c
@@ -1036,7 +1036,7 @@ enum halmac_ret_status
if (halmac_send_fwpkt_88xx(
halmac_adapter, code_ptr + mem_offset,
send_pkt_size) != HALMAC_RET_SUCCESS) {
-   pr_err("halmac_send_fwpkt_88xx fail!!");
+   pr_err("halmac_send_fwpkt_88xx fail!!\n");
return HALMAC_RET_DLFW_FAIL;
}
 
@@ -1046,7 +1046,7 @@ enum halmac_ret_status
halmac_adapter->hw_config_info.txdesc_size,
dest + mem_offset, send_pkt_size,
first_part) != HALMAC_RET_SUCCESS) {
-   pr_err("halmac_iddma_dlfw_88xx fail!!");
+   pr_err("halmac_iddma_dlfw_88xx fail!!\n");
return HALMAC_RET_DLFW_FAIL;
}
 
@@ -1057,7 +1057,7 @@ enum halmac_ret_status
 
if (halmac_check_fw_chksum_88xx(halmac_adapter, dest) !=
HALMAC_RET_SUCCESS) {
-   pr_err("halmac_check_fw_chksum_88xx fail!!");
+   pr_err("halmac_check_fw_chksum_88xx fail!!\n");
return HALMAC_RET_DLFW_FAIL;
}
 
diff --git a/drivers/staging/rtlwifi/rtl8822be/phy.c 
b/drivers/staging/rtlwifi/rtl8822be/phy.c
index 4cba2ad..921226b 100644
--- a/drivers/staging/rtlwifi/rtl8822be/phy.c
+++ b/drivers/staging/rtlwifi/rtl8822be/phy.c
@@ -890,7 +890,7 @@ bool rtl8822be_load_txpower_by_rate(struct ieee80211_hw *hw)
rtstatus = rtlpriv->phydm.ops->phydm_load_txpower_by_rate(rtlpriv);
 
if (!rtstatus) {
-   pr_err("BB_PG Reg Fail!!");
+   pr_err("BB_PG Reg Fail!!\n");
return false;
}
 
@@ -915,7 +915,7 @@ bool rtl8822be_load_txpower_limit(struct ieee80211_hw *hw)
rtstatus = rtlpriv->phydm.ops->phydm_load_txpower_limit(rtlpriv);
 
if (!rtstatus) {
-   pr_err("RF TxPwr Limit Fail!!");
+   pr_err("RF TxPwr Limit Fail!!\n");
return false;
}
 
-- 
1.9.1

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


[PATCH 3/4] staging: bcm2835-camera: pr_err() strings should end with newlines

2017-10-03 Thread Arvind Yadav
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c 
b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
index 4360db6..6ea7fb0 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -1963,7 +1963,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance 
*instance)
 
status = vchi_service_close(instance->handle);
if (status != 0)
-   pr_err("mmal-vchiq: VCHIQ close failed");
+   pr_err("mmal-vchiq: VCHIQ close failed\n");
 
mutex_unlock(>vchiq_mutex);
 
-- 
1.9.1

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


[PATCH 0/4] staging: rtlwifi: pr_err() strings should end with newlines

2017-10-03 Thread Arvind Yadav
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Arvind Yadav (4):
  [PATCH 1/4] staging: gs_fpgaboot: pr_err() strings should end with newlines
  [PATCH 2/4] staging: media: davinci_vpfe: pr_err() strings should end with
newlines
  [PATCH 3/4] staging: bcm2835-camera: pr_err() strings should end with newlines
  [PATCH 4/4] staging: rtlwifi: pr_err() strings should end with newlines

 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +-
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c   | 2 +-
 drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 6 +++---
 drivers/staging/rtlwifi/rtl8822be/phy.c   | 4 ++--
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.9.1

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


[PATCH 2/4] staging: media: davinci_vpfe: pr_err() strings should end with newlines

2017-10-03 Thread Arvind Yadav
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
index a893072..8cfe873 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c
@@ -268,7 +268,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
 
ipipe_mode = get_ipipe_mode(ipipe);
if (ipipe_mode < 0) {
-   pr_err("Failed to get ipipe mode");
+   pr_err("Failed to get ipipe mode\n");
return -EINVAL;
}
regw_ip(ipipe_base, ipipe_mode, IPIPE_SRC_MODE);
-- 
1.9.1

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


[PATCH 1/4] staging: gs_fpgaboot: pr_err() strings should end with newlines

2017-10-03 Thread Arvind Yadav
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index bcbdc73..fa8b27e 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -106,7 +106,7 @@ static int readmagic_bitstream(u8 *bitdata, int *offset)
read_bitstream(bitdata, buf, offset, 13);
r = memcmp(buf, bits_magic, 13);
if (r) {
-   pr_err("error: corrupted header");
+   pr_err("error: corrupted header\n");
return -EINVAL;
}
pr_info("bitstream file magic number Ok\n");
-- 
1.9.1

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


[PATCH] HID: hyperv: pr_err() strings should end with newlines

2017-09-25 Thread Arvind Yadav
pr_err() messages should terminated with a new-line to avoid
other messages being concatenated onto the end.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/hid/hid-hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index 6039f07..3aa2bb9 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -313,7 +313,7 @@ static void mousevsc_on_receive(struct hv_device *device,
 
break;
default:
-   pr_err("unsupported hid msg type - type %d len %d",
+   pr_err("unsupported hid msg type - type %d len %d\n",
   hid_msg->header.type, hid_msg->header.size);
break;
}
-- 
1.9.1

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


Re: [PATCH] ANDROID: binder: pr_err() strings should end with newlines

2017-09-25 Thread Arvind Yadav



On Monday 25 September 2017 12:31 PM, Greg KH wrote:

On Mon, Sep 25, 2017 at 12:21:47PM +0530, Arvind Yadav wrote:

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---

I can't take patches without any changelog text, sorry.

As per your concern, I will update.


greg k-h

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


[PATCH] ANDROID: binder: pr_err() strings should end with newlines

2017-09-25 Thread Arvind Yadav
Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index d055b3f..044b1c2 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2192,7 +2192,7 @@ static void binder_transaction_buffer_release(struct 
binder_proc *proc,
 off_start,
 offp - off_start);
if (!parent) {
-   pr_err("transaction release %d bad parent 
offset",
+   pr_err("transaction release %d bad parent 
offset\n",
   debug_id);
continue;
}
-- 
1.9.1

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


[PATCH] staging: greybus: light: remove unnecessary error check

2017-09-23 Thread Arvind Yadav
It is not necessary to check return value of gb_lights_channel_flash_config.
gb_lights_channel_config returns both successful and error value.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/greybus/light.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 0f538b8..d7da475 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -1000,11 +1000,7 @@ static int gb_lights_channel_config(struct gb_light 
*light,
 
light->has_flash = true;
 
-   ret = gb_lights_channel_flash_config(channel);
-   if (ret < 0)
-   return ret;
-
-   return ret;
+   return gb_lights_channel_flash_config(channel);
 }
 
 static int gb_lights_light_config(struct gb_lights *glights, u8 id)
-- 
2.7.4

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


[PATCH v3] staging: greybus: light: Release memory obtained by kasprintf

2017-09-23 Thread Arvind Yadav
Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
changes in v2:
- Subject line changed.
- add kfree in __gb_lights_led_unregister().
- No need to check return value of gb_lights_channel_flash_config().

changes ib v3:
- separate patch for "No need to check return value of
  gb_lights_channel_flash_config()".

 drivers/staging/greybus/light.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 3f4148c..0f538b8 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -925,6 +925,8 @@ static void __gb_lights_led_unregister(struct gb_channel 
*channel)
return;
 
led_classdev_unregister(cdev);
+   kfree(cdev->name);
+   cdev->name = NULL;
channel->led = NULL;
 }
 
-- 
2.7.4

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


[PATCH v2] staging: greybus: light: Release memory obtained by kasprintf

2017-09-21 Thread Arvind Yadav
 - Free memory region, if gb_lights_channel_config is not successful.
 - No need to add check for gb_lights_channel_flash_config().

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
changes in v2:
- Subject line changed.
- add kfree in __gb_lights_led_unregister().
- No need to check return value of gb_lights_channel_flash_config().

 drivers/staging/greybus/light.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 3f4148c..bc1f8d2 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -926,6 +926,8 @@ static void __gb_lights_led_unregister(struct gb_channel 
*channel)
 
led_classdev_unregister(cdev);
channel->led = NULL;
+   kfree(cdev->name);
+   cdev->name = NULL;
 }
 
 static void gb_lights_channel_unregister(struct gb_channel *channel)
@@ -998,11 +1000,8 @@ static int gb_lights_channel_config(struct gb_light 
*light,
 
light->has_flash = true;
 
-   ret = gb_lights_channel_flash_config(channel);
-   if (ret < 0)
-   return ret;
+   return gb_lights_channel_flash_config(channel);
 
-   return ret;
 }
 
 static int gb_lights_light_config(struct gb_lights *glights, u8 id)
-- 
1.9.1

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


[PATCH] media: staging: greybus: Release memory obtained by kasprintf

2017-09-21 Thread Arvind Yadav
Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/greybus/light.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 3f4148c..b00d47c 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -984,7 +984,7 @@ static int gb_lights_channel_config(struct gb_light *light,
 
ret = channel_attr_groups_set(channel, cdev);
if (ret < 0)
-   return ret;
+   goto err;
 
gb_lights_led_operations_set(channel, cdev);
 
@@ -994,15 +994,18 @@ static int gb_lights_channel_config(struct gb_light 
*light,
 * configurations.
 */
if (!is_channel_flash(channel))
-   return ret;
+   goto err;
 
light->has_flash = true;
 
ret = gb_lights_channel_flash_config(channel);
if (ret < 0)
-   return ret;
+   goto err;
 
return ret;
+err:
+   kfree(cdev->name);
+   return ret;
 }
 
 static int gb_lights_light_config(struct gb_lights *glights, u8 id)
-- 
1.9.1

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


[PATCH] Staging: atomisp: constify driver_attribute

2017-08-31 Thread Arvind Yadav
driver_attribute are not supposed to change at runtime.
Functions driver_create_file/driver_remove_file are working with
const driver_attribute. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
index 1ae2358..9f74b2d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
@@ -162,7 +162,7 @@ static ssize_t iunit_dbgopt_store(struct device_driver 
*drv, const char *buf,
return size;
 }
 
-static struct driver_attribute iunit_drvfs_attrs[] = {
+static const struct driver_attribute iunit_drvfs_attrs[] = {
__ATTR(dbglvl, 0644, iunit_dbglvl_show, iunit_dbglvl_store),
__ATTR(dbgfun, 0644, iunit_dbgfun_show, iunit_dbgfun_store),
__ATTR(dbgopt, 0644, iunit_dbgopt_show, iunit_dbgopt_store),
-- 
1.9.1

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


[PATCH] staging: lustre: constify cl_lock_operations

2017-08-27 Thread Arvind Yadav
cl_lock_operations are not supposed to change at runtime.
cl_lock_slice_add is working with const cl_lock_operations.
So mark the non-const cl_lock_operations structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 1c4a8fe..b3fbc3c 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env,
kmem_cache_free(echo_lock_kmem, ecl);
 }
 
-static struct cl_lock_operations echo_lock_ops = {
+static const struct cl_lock_operations echo_lock_ops = {
.clo_fini  = echo_lock_fini,
 };
 
-- 
2.7.4

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


[PATCH] staging: atomisp: constify v4l2_subdev_sensor_ops

2017-08-26 Thread Arvind Yadav
v4l2_subdev_sensor_ops are not supposed to change at runtime.
v4l2_subdev_sensor_ops are working with const 'sensor' field of
sturct v4l2_subdev_ops. So mark the non-const v4l2_subdev_sensor_ops
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c 
b/drivers/staging/media/atomisp/i2c/mt9m114.c
index 3fa9153..2c9b752 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -1806,7 +1806,7 @@ static const struct v4l2_subdev_video_ops 
mt9m114_video_ops = {
.g_frame_interval = mt9m114_g_frame_interval,
 };
 
-static struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = {
+static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = {
.g_skip_frames  = mt9m114_g_skip_frames,
 };
 
-- 
2.7.4

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


Re: [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

2017-08-21 Thread Arvind Yadav

Hi


On Tuesday 22 August 2017 01:50 AM, Dan Carpenter wrote:

Don't say "[PATCH 4/4]".  It's not a patchset or a part of an email
thread.

Yes, It's part of these patchset.
  [PATCH 1/4] misc: apds9802als: constify i2c_device_id
  [PATCH 2/4] misc: hmc6352: constify i2c_device_id
  [PATCH 3/4] misc: isl29020: constify i2c_device_id
  [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id



regards,
dan carpenter


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


[PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

2017-08-21 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/iio/light/tsl2x7x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 1467199..9b4425d 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -2010,7 +2010,7 @@ static int tsl2x7x_remove(struct i2c_client *client)
return 0;
 }
 
-static struct i2c_device_id tsl2x7x_idtable[] = {
+static const struct i2c_device_id tsl2x7x_idtable[] = {
{ "tsl2571", tsl2571 },
{ "tsl2671", tsl2671 },
{ "tmd2671", tmd2671 },
-- 
2.7.4

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


[PATCH] staging: vboxvideo: constify drm_fb_helper_funcs

2017-08-21 Thread Arvind Yadav
drm_fb_helper_funcs are not supposed to change at runtime.
All functions working with drm_fb_helper_funcs provided by
 work with const drm_fb_helper_funcs.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/vboxvideo/vbox_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index 35f6d9f..70d99b7 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -330,7 +330,7 @@ static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 
*red, u16 *green,
*blue = regno;
 }
 
-static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
+static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
.gamma_set = vbox_fb_gamma_set,
.gamma_get = vbox_fb_gamma_get,
.fb_probe = vboxfb_create,
-- 
1.9.1

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


[PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures

2017-08-20 Thread Arvind Yadav
snd_soc_dai_ops are not supposed to change at runtime. All functions
working with snd_soc_dai_ops provided by  work with
const snd_soc_dai_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/greybus/audio_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index 25c8bb4..a6d01f0 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -674,7 +674,7 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int 
mute, int stream)
return ret;
 }
 
-static struct snd_soc_dai_ops gbcodec_dai_ops = {
+static const struct snd_soc_dai_ops gbcodec_dai_ops = {
.startup = gbcodec_startup,
.shutdown = gbcodec_shutdown,
.hw_params = gbcodec_hw_params,
-- 
1.9.1

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


[PATCH] staging: most: hdm-dim2: constify platform_device_id

2017-08-13 Thread Arvind Yadav
platform_device_id are not supposed to change at runtime. All functions
working with platform_device_id provided by 
work with const platform_device_id. So mark the non-const structs as
const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/most/hdm-dim2/dim2_hdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c 
b/drivers/staging/most/hdm-dim2/dim2_hdm.c
index 4607d03..b1567c80 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
@@ -894,7 +894,7 @@ static int dim2_remove(struct platform_device *pdev)
return 0;
 }
 
-static struct platform_device_id dim2_id[] = {
+static const struct platform_device_id dim2_id[] = {
{ "medialb_dim2" },
{ }, /* Terminating entry */
 };
-- 
2.7.4

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


[PATCH] staging: bcm2835-audio: constify snd_pcm_ops structures

2017-08-09 Thread Arvind Yadav
snd_pcm_ops are not supposed to change at runtime. All functions
working with snd_pcm_ops provided by  work with
const snd_pcm_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
index 3637ddf..1bf34ce 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
@@ -438,7 +438,7 @@ static int snd_bcm2835_pcm_lib_ioctl(struct 
snd_pcm_substream *substream,
 }
 
 /* operators */
-static struct snd_pcm_ops snd_bcm2835_playback_ops = {
+static const struct snd_pcm_ops snd_bcm2835_playback_ops = {
.open = snd_bcm2835_playback_open,
.close = snd_bcm2835_playback_close,
.ioctl = snd_bcm2835_pcm_lib_ioctl,
@@ -450,7 +450,7 @@ static int snd_bcm2835_pcm_lib_ioctl(struct 
snd_pcm_substream *substream,
.ack = snd_bcm2835_pcm_ack,
 };
 
-static struct snd_pcm_ops snd_bcm2835_playback_spdif_ops = {
+static const struct snd_pcm_ops snd_bcm2835_playback_spdif_ops = {
.open = snd_bcm2835_playback_spdif_open,
.close = snd_bcm2835_playback_close,
.ioctl = snd_bcm2835_pcm_lib_ioctl,
-- 
1.9.1

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


[PATCH 1/3] staging: most: usb: constify usb_device_id

2017-08-08 Thread Arvind Yadav
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by  work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index d0f68cb..a9c3785 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -832,7 +832,7 @@ static const struct file_operations hdm_usb_fops = {
 /**
  * usb_device_id - ID table for HCD device probing
  */
-static struct usb_device_id usbid[] = {
+static const struct usb_device_id usbid[] = {
{ USB_DEVICE(USB_VENDOR_ID_SMSC, USB_DEV_ID_BRDG), },
{ USB_DEVICE(USB_VENDOR_ID_SMSC, USB_DEV_ID_OS81118), },
{ USB_DEVICE(USB_VENDOR_ID_SMSC, USB_DEV_ID_OS81119), },
-- 
2.7.4

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


[PATCH 2/3] staging: rtl8188eu: constify usb_device_id

2017-08-08 Thread Arvind Yadav
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by  work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 963235f..2ef71c3 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -32,7 +32,7 @@
 #define USB_VENDER_ID_REALTEK  0x0bda
 
 /* DID_USB_v916_20130116 */
-static struct usb_device_id rtw_usb_id_tbl[] = {
+static const struct usb_device_id rtw_usb_id_tbl[] = {
/*=== Realtek demoboard ===*/
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8179)}, /* 8188EUS */
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0179)}, /* 8188ETV */
-- 
2.7.4

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


[PATCH 3/3] staging: rtl8712: constify usb_device_id

2017-08-08 Thread Arvind Yadav
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by  work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8712/usb_intf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/usb_intf.c 
b/drivers/staging/rtl8712/usb_intf.c
index 897d462..b3e266b 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -47,7 +47,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
 
 static void r871xu_dev_remove(struct usb_interface *pusb_intf);
 
-static struct usb_device_id rtl871x_usb_id_tbl[] = {
+static const struct usb_device_id rtl871x_usb_id_tbl[] = {
 
 /* RTL8188SU */
/* Realtek */
-- 
2.7.4

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


[PATCH 0/3] constify staging usb_device_id

2017-08-08 Thread Arvind Yadav
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by  work with
const usb_device_id. So mark the non-const structs as const.

Arvind Yadav (3):
  [PATCH 1/3] staging: most: usb: constify usb_device_id
  [PATCH 2/3] staging: rtl8188eu: constify usb_device_id
  [PATCH 3/3] staging: rtl8712: constify usb_device_id

 drivers/staging/most/hdm-usb/hdm_usb.c  | 2 +-
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
 drivers/staging/rtl8712/usb_intf.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4

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


[PATCH] staging: ccree: constify dev_pm_ops structures.

2017-08-08 Thread Arvind Yadav
dev_pm_ops are not supposed to change at runtime. All functions
working with dev_pm_ops provided by  work with const
dev_pm_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/ccree/ssi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_driver.c 
b/drivers/staging/ccree/ssi_driver.c
index e0faca0..1753906 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -549,7 +549,7 @@ static int cc7x_remove(struct platform_device *plat_dev)
 }
 
 #if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP)
-static struct dev_pm_ops arm_cc7x_driver_pm = {
+static const struct dev_pm_ops arm_cc7x_driver_pm = {
SET_RUNTIME_PM_OPS(ssi_power_mgr_runtime_suspend, 
ssi_power_mgr_runtime_resume, NULL)
 };
 #endif
-- 
1.9.1

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


[PATCH v3 2/3] staging: lustre: ldlm: constify attribute_group structures.

2017-07-21 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  patch was sent to wrong group.
Changes in v3:
  typo error in cover-latter.

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

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t 
cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group ldlm_attr_group = {
+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
 };
 
-- 
1.9.1

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


[PATCH v3 1/3] staging: lustre: constify attribute_group structures.

2017-07-21 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   9489 992  40   105212919 lustre/lustre/osc/lproc_osc.o
   1289 288   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3794 928  404762129a lustre/lustre/lov/lproc_lov.o
   3802 576  4044181142 lustre/lustre/mdc/lproc_mdc.o

File size After adding 'const':
   textdata bss dec hex filename
   9553 928  40   105212919 lustre/lustre/osc/lproc_osc.o
   1353 224   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3858 864  404762129a lustre/lustre/lov/lproc_lov.o
   3866 512  4044181142 lustre/lustre/mdc/lproc_mdc.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  Fix kbuild error: conflicting types for 'lprocfs_obd_setup'.
  By changing protype of 'lprocfs_obd_setup'.
Changes in v3:
  typo error in cover-latter.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 915283c..9054d37 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -59,7 +59,7 @@ struct lprocfs_vars {
 
 struct lprocfs_static_vars {
struct lprocfs_vars *obd_vars;
-   struct attribute_group *sysfs_vars;
+   const struct attribute_group *sysfs_vars;
 };
 
 /* if we find more consumers this could be generalized */
@@ -468,7 +468,7 @@ struct dentry *ldebugfs_register(const char *name,
 void ldebugfs_remove(struct dentry **entryp);
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs);
+ const struct attribute_group *attrs);
 int lprocfs_obd_cleanup(struct obd_device *obd);
 
 int ldebugfs_seq_create(struct dentry *parent,
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c 
b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
index bf25f88..4c13e39 100644
--- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
+++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
@@ -161,7 +161,7 @@ static int lmv_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lmv_attr_group = {
+static const struct attribute_group lmv_attr_group = {
.attrs = lmv_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c 
b/drivers/staging/lustre/lustre/lov/lproc_lov.c
index eb6d30d..ce46821 100644
--- a/drivers/staging/lustre/lustre/lov/lproc_lov.c
+++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c
@@ -279,7 +279,7 @@ static int lov_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lov_attr_group = {
+static const struct attribute_group lov_attr_group = {
.attrs = lov_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 9021c46..9fea535 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -219,7 +219,7 @@ static ssize_t max_pages_per_rpc_show(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group mdc_attr_group = {
+static const struct attribute_group mdc_attr_group = {
.attrs = mdc_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
 };
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
 {
int rc = 0;
 
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c 
b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 86f252d..6e0fd15 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -831,7 +831,7 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
NULL,
 };
 
-static struct attribute_group osc_attr_group = {
+static

[PATCH v3 3/3] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-21 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  patch was sent to wrong group.
Changes in v3:
  typo error in cover-latter.

 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
 struct kobject *lustre_kobj;
 EXPORT_SYMBOL_GPL(lustre_kobj);
 
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
index e6c785a..814334b 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
@@ -151,7 +151,7 @@ static ssize_t max_dirty_mb_store(struct kobject *kobj, 
struct attribute *attr,
NULL,
 };
 
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
 };
 
-- 
1.9.1

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


[PATCH v3 0/3] Constify lustre attribute_group structures.

2017-07-21 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Arvind Yadav (3):
  [PATCH v3 1/3] staging: lustre: constify attribute_group structures.
  [PATCH v3 2/3] staging: lustre: ldlm: constify attribute_group structures.
  [PATCH v3 3/3] staging: lustre: obdclass: linux: constify attribute_group 
structures.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

--
1.9.1

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


[PATCH v2 0/3] Constify lustre attribute_group structures.

2017-07-20 Thread Arvind Yadav
ttribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Arvind Yadav (3):
  [PATCH v2 1/3] staging: lustre: constify attribute_group structures.
  [PATCH v2 2/3] staging: lustre: ldlm: constify attribute_group structures.
  [PATCH v2 3/3] staging: lustre: obdclass: linux: constify attribute_group 
structures.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

--
1.9.1

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


[PATCH v2 3/3] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-20 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  patch was sent to wrong group.

 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
 struct kobject *lustre_kobj;
 EXPORT_SYMBOL_GPL(lustre_kobj);
 
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
index e6c785a..814334b 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
@@ -151,7 +151,7 @@ static ssize_t max_dirty_mb_store(struct kobject *kobj, 
struct attribute *attr,
NULL,
 };
 
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
 };
 
-- 
1.9.1

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


[PATCH v2 2/3] staging: lustre: ldlm: constify attribute_group structures.

2017-07-20 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  patch was sent to wrong group.

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

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t 
cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group ldlm_attr_group = {
+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
 };
 
-- 
1.9.1

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


[PATCH v2 1/3] staging: lustre: constify attribute_group structures.

2017-07-20 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   9489 992  40   105212919 lustre/lustre/osc/lproc_osc.o
   1289 288   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3794 928  404762129a lustre/lustre/lov/lproc_lov.o
   3802 576  4044181142 lustre/lustre/mdc/lproc_mdc.o

File size After adding 'const':
   textdata bss dec hex filename
   9553 928  40   105212919 lustre/lustre/osc/lproc_osc.o
   1353 224   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3858 864  404762129a lustre/lustre/lov/lproc_lov.o
   3866 512  4044181142 lustre/lustre/mdc/lproc_mdc.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  Fix kbuild error: conflicting types for 'lprocfs_obd_setup'.
  By changing protype of 'lprocfs_obd_setup'.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 915283c..9054d37 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -59,7 +59,7 @@ struct lprocfs_vars {
 
 struct lprocfs_static_vars {
struct lprocfs_vars *obd_vars;
-   struct attribute_group *sysfs_vars;
+   const struct attribute_group *sysfs_vars;
 };
 
 /* if we find more consumers this could be generalized */
@@ -468,7 +468,7 @@ struct dentry *ldebugfs_register(const char *name,
 void ldebugfs_remove(struct dentry **entryp);
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs);
+ const struct attribute_group *attrs);
 int lprocfs_obd_cleanup(struct obd_device *obd);
 
 int ldebugfs_seq_create(struct dentry *parent,
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c 
b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
index bf25f88..4c13e39 100644
--- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
+++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
@@ -161,7 +161,7 @@ static int lmv_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lmv_attr_group = {
+static const struct attribute_group lmv_attr_group = {
.attrs = lmv_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c 
b/drivers/staging/lustre/lustre/lov/lproc_lov.c
index eb6d30d..ce46821 100644
--- a/drivers/staging/lustre/lustre/lov/lproc_lov.c
+++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c
@@ -279,7 +279,7 @@ static int lov_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lov_attr_group = {
+static const struct attribute_group lov_attr_group = {
.attrs = lov_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 9021c46..9fea535 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -219,7 +219,7 @@ static ssize_t max_pages_per_rpc_show(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group mdc_attr_group = {
+static const struct attribute_group mdc_attr_group = {
.attrs = mdc_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
 };
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
 {
int rc = 0;
 
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c 
b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 86f252d..6e0fd15 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -831,7 +831,7 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
NULL,
 };
 
-static struct attribute_group osc_attr_group = {
+static const struct attribute_group osc_attr_group = {

[PATCH v4] staging: unisys: visorbus: Constify attribute_group structures.

2017-07-18 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  Change log typo was not correct.
Changes in v3:
  merge conflict.
Changes in v4:
  version change description was missing.

 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 9012cc1..ff80ab2 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -294,7 +294,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -391,7 +391,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 87ea852..6d4498f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1138,7 +1138,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


Re: [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

2017-07-18 Thread Arvind Yadav

Hi Greg,

On Tuesday 18 July 2017 01:30 PM, Greg KH wrote:

On Tue, Jul 18, 2017 at 01:24:42PM +0530, Arvind Yadav wrote:

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
  drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

What changed from the previous patches?  Always include that below the
--- line as maintainers have no short-term memory at all.

v4?

Sorry, I have missed it. :(


thanks,

greg k-h

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


[PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

2017-07-18 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 9012cc1..ff80ab2 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -294,7 +294,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -391,7 +391,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 87ea852..6d4498f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1138,7 +1138,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


[PATCH v2] staging: unisys: visorbus: Constify attribute_group structures.

2017-07-17 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
Changes in v2:
  Change log typo was not correct.

 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Hi Greg,


On Monday 17 July 2017 04:15 PM, Greg KH wrote:

On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
  drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
something that is preventing that?

Yes, we can use. if we are only initializing '.attrs'.
ATTRIBUTE_GROUPS() will not work if we will initialize other member of
attribute_group like 'bin_attrs', 'is_visible', and  'name'.


thanks,

greg k-h

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


[PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


Re: [PATCH 1/4] staging: lustre: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this. I will fix this error and push again.

~arvind


On Monday 17 July 2017 12:45 PM, kbuild test robot wrote:

Hi Arvind,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc1 next-20170717]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
 wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
 chmod +x ~/bin/make.cross
 # save the attached .config to linux build tree
 make.cross ARCH=sparc64

Note: the 
linux-review/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
 HEAD a6df15f5fc00a12dffbac94e0ccc52155118946e builds fine.
   It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):


drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1033:5: error: 
conflicting types for 'lprocfs_obd_setup'

 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^
In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^
In file included from include/linux/linkage.h:6:0,
 from include/linux/kernel.h:6,
 from include/asm-generic/bug.h:15,
 from arch/sparc/include/asm/bug.h:20,
 from include/linux/bug.h:4,
 from include/linux/mmdebug.h:4,
 from include/linux/gfp.h:4,
 from include/linux/slab.h:14,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:36,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:19: error: 
conflicting types for 'lprocfs_obd_setup'
 EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
   ^
include/linux/export.h:65:21: note: in definition of macro 
'___EXPORT_SYMBOL'
  extern typeof(sym) sym;  \
 ^~~

drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:1: note: in 
expansion of macro 'EXPORT_SYMBOL_GPL'

 EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
 ^
In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^

vim +/lprocfs_obd_setup +1033 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c

9b8013023 Oleg Drokin   2015-05-21  1032
9b8013023 Oleg Drokin   2015-05-21 @1033  int lprocfs_obd_setup(struct 
obd_device *obd, struct lprocfs_vars *list,
9b8013023 Oleg Drokin   2015-05-21  1034  struct 
attribute_group *attrs)
d7e09d039 Peng Tao  2013-05-02  1035  {
d7e09d039 Peng Tao  2013-05-02  1036int rc = 0;
d7e09d039 Peng Tao  2013-05-02  1037
9b8013023 Oleg Drokin   2015-05-21  1038
init_completion(>obd_kobj_unregister);
9b8013023 Oleg Drokin   2015-05-21  1039rc = 
kobject_init_and_add(>obd_kobj, _ktype,
9b8013023 Oleg Drokin   2015-05-21  1040  
obd->obd_type->typ_kobj,
9b8013023 Oleg Drokin   2015-05-21  1041  "%s", 
obd->obd_name);
9b8013023 Oleg Drokin   2015-05-21  1042if (rc)
9b8013023 Oleg Drokin   2015-05-21  1043return rc;
9b8013023 Oleg Drokin   2015-05-21  1044
9b8013023 Oleg Drokin   2015-05-21  1045if (attrs) {
9b8013023 Oleg Drokin   2015-05-21  1046rc = 
sysfs_create_group(>obd_kobj, attrs);
9b8013023 Oleg Drokin   2015-05-21  1047if (rc) {
9b8013023 Oleg Drokin   2015-05-21  1048
kobject_put(>obd_kobj);
9b8013023 Oleg Drokin   2015-05-21  1049

Re: [PATCH 0/4] constify lustre attribute_group structures

2017-07-17 Thread Arvind Yadav
Sorry for noise. Please ignore this. It's having build error. Again, I 
will push all changes.


~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Arvind Yadav (4):
   [PATCH 1/4] staging: lustre: constify attribute_group structures.
   [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.
   [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group 
structures.
   [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

  drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
  drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
  drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
  drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
  drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
  8 files changed, 9 insertions(+), 9 deletions(-)



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


Re: [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t 
cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
  };
  
-static struct attribute_group ldlm_attr_group = {

+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
  };
  


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


Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
  struct kobject *lustre_kobj;
  EXPORT_SYMBOL_GPL(lustre_kobj);
  
-static struct attribute_group lustre_attr_group = {

+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
  };
  


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


Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
  struct kobject *lustre_kobj;
  EXPORT_SYMBOL_GPL(lustre_kobj);
  
-static struct attribute_group lustre_attr_group = {

+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
  };
  


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


Re: [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this. This change should not be separate.

~arvind

On Monday 17 July 2017 11:19 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
  };
  
  int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,

- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
  {
int rc = 0;
  


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


[PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

2017-07-16 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
 };
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
 {
int rc = 0;
 
-- 
1.9.1

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


[PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.

2017-07-16 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t 
cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group ldlm_attr_group = {
+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
 };
 
-- 
1.9.1

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


[PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-16 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
 struct kobject *lustre_kobj;
 EXPORT_SYMBOL_GPL(lustre_kobj);
 
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
 };
 
-- 
1.9.1

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


[PATCH 1/4] staging: lustre: constify attribute_group structures.

2017-07-16 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   9489 992  40   105212919 lustre/lustre/osc/lproc_osc.o
   1289 288   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3794 928  404762129a lustre/lustre/lov/lproc_lov.o
   3802 576  4044181142 lustre/lustre/mdc/lproc_mdc.o

File size After adding 'const':
   textdata bss dec hex filename
   9553 928  40   105212919 lustre/lustre/osc/lproc_osc.o
   1353 224   01577 629 lustre/lustre/lmv/lproc_lmv.o
   3858 864  404762129a lustre/lustre/lov/lproc_lov.o
   3866 512  4044181142 lustre/lustre/mdc/lproc_mdc.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++--
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c  | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c  | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c  | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 915283c..9054d37 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -59,7 +59,7 @@ struct lprocfs_vars {
 
 struct lprocfs_static_vars {
struct lprocfs_vars *obd_vars;
-   struct attribute_group *sysfs_vars;
+   const struct attribute_group *sysfs_vars;
 };
 
 /* if we find more consumers this could be generalized */
@@ -468,7 +468,7 @@ struct dentry *ldebugfs_register(const char *name,
 void ldebugfs_remove(struct dentry **entryp);
 
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs);
+ const struct attribute_group *attrs);
 int lprocfs_obd_cleanup(struct obd_device *obd);
 
 int ldebugfs_seq_create(struct dentry *parent,
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c 
b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
index bf25f88..4c13e39 100644
--- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
+++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
@@ -161,7 +161,7 @@ static int lmv_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lmv_attr_group = {
+static const struct attribute_group lmv_attr_group = {
.attrs = lmv_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c 
b/drivers/staging/lustre/lustre/lov/lproc_lov.c
index eb6d30d..ce46821 100644
--- a/drivers/staging/lustre/lustre/lov/lproc_lov.c
+++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c
@@ -279,7 +279,7 @@ static int lov_target_seq_open(struct inode *inode, struct 
file *file)
NULL,
 };
 
-static struct attribute_group lov_attr_group = {
+static const struct attribute_group lov_attr_group = {
.attrs = lov_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 9021c46..9fea535 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -219,7 +219,7 @@ static ssize_t max_pages_per_rpc_show(struct kobject *kobj,
NULL,
 };
 
-static struct attribute_group mdc_attr_group = {
+static const struct attribute_group mdc_attr_group = {
.attrs = mdc_attrs,
 };
 
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c 
b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 86f252d..6e0fd15 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -831,7 +831,7 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
NULL,
 };
 
-static struct attribute_group osc_attr_group = {
+static const struct attribute_group osc_attr_group = {
.attrs = osc_attrs,
 };
 
-- 
1.9.1

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


[PATCH 0/4] constify lustre attribute_group structures

2017-07-16 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Arvind Yadav (4):
  [PATCH 1/4] staging: lustre: constify attribute_group structures.
  [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.
  [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group 
structures.
  [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

-- 
1.9.1

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


[PATCH] staging: atomisp: gc2235: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  107541360   4   121182f56
drivers/staging/media/atomisp/i2c/gc2235.o

File size After adding 'const':
   textdata bss dec hex filename
  108181296   4   121182f56
drivers/staging/media/atomisp/i2c/gc2235.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 50f4317..48ca23b 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -1183,7 +1183,7 @@ static int gc2235_probe(struct i2c_client *client,
return ret;
 }
 
-static struct acpi_device_id gc2235_acpi_match[] = {
+static const struct acpi_device_id gc2235_acpi_match[] = {
{ "INT33F8" },
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: mt9m114: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  151482640   8   177964584
drivers/staging/media/atomisp/i2c/mt9m114.o

File size After adding 'const':
   textdata bss dec hex filename
  152442512   8   177644564
drivers/staging/media/atomisp/i2c/mt9m114.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/mt9m114.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c 
b/drivers/staging/media/atomisp/i2c/mt9m114.c
index ced175c..68980ab 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -1928,7 +1928,7 @@ static int mt9m114_probe(struct i2c_client *client,
 
 MODULE_DEVICE_TABLE(i2c, mt9m114_id);
 
-static struct acpi_device_id mt9m114_acpi_match[] = {
+static const struct acpi_device_id mt9m114_acpi_match[] = {
{ "INT33F0" },
{ "CRMT1040" },
{},
-- 
2.7.4

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


[PATCH] staging: atomisp: ov5693: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  207293264   0   239935db9
drivers/staging/media/atomisp/i2c/ov5693/ov5693.o

File size After adding 'const':
   textdata bss dec hex filename
  207933200   0   239935db9
drivers/staging/media/atomisp/i2c/ov5693/ov5693.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/ov5693/ov5693.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c 
b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
index 5e9dafe..2c79678 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
@@ -2032,7 +2032,7 @@ static int ov5693_probe(struct i2c_client *client,
 
 MODULE_DEVICE_TABLE(i2c, ov5693_id);
 
-static struct acpi_device_id ov5693_acpi_match[] = {
+static const struct acpi_device_id ov5693_acpi_match[] = {
{"INT33BE"},
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: ov2722: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  147711880   0   16651410b 
drivers/staging/media/atomisp/i2c/ov2722.o

File size After adding 'const':
   textdata bss dec hex filename
  148351816   0   16651410b 
drivers/staging/media/atomisp/i2c/ov2722.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/ov2722.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov2722.c 
b/drivers/staging/media/atomisp/i2c/ov2722.c
index b7afade..10094ac 100644
--- a/drivers/staging/media/atomisp/i2c/ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/ov2722.c
@@ -1337,7 +1337,7 @@ static int ov2722_probe(struct i2c_client *client,
 
 MODULE_DEVICE_TABLE(i2c, ov2722_id);
 
-static struct acpi_device_id ov2722_acpi_match[] = {
+static const struct acpi_device_id ov2722_acpi_match[] = {
{ "INT33FB" },
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: gc0310: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  102971888   0   121852f99 
drivers/staging/media/atomisp/i2c/gc0310.o

File size After adding 'const':
   textdata bss dec hex filename
  103611824   0   121852f99 
drivers/staging/media/atomisp/i2c/gc0310.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/gc0310.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c 
b/drivers/staging/media/atomisp/i2c/gc0310.c
index 1ec616a..c8162bb 100644
--- a/drivers/staging/media/atomisp/i2c/gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/gc0310.c
@@ -1453,7 +1453,7 @@ static int gc0310_probe(struct i2c_client *client,
return ret;
 }
 
-static struct acpi_device_id gc0310_acpi_match[] = {
+static const struct acpi_device_id gc0310_acpi_match[] = {
{"XXGC0310"},
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: ov8858: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  238048448   0   322527dfc 
drivers/staging/media/atomisp/i2c/ov8858.o

File size After adding 'const':
   textdata bss dec hex filename
  238688384   0   322527dfc 
drivers/staging/media/atomisp/i2c/ov8858.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/ov8858.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov8858.c 
b/drivers/staging/media/atomisp/i2c/ov8858.c
index 9574bc4..43e1638 100644
--- a/drivers/staging/media/atomisp/i2c/ov8858.c
+++ b/drivers/staging/media/atomisp/i2c/ov8858.c
@@ -2189,7 +2189,7 @@ static const struct i2c_device_id ov8858_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ov8858_id);
 
-static struct acpi_device_id ov8858_acpi_match[] = {
+static const struct acpi_device_id ov8858_acpi_match[] = {
{"INT3477"},
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: ov2680: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  124663120   8   155943cea 
drivers/staging/media/atomisp/i2c/ov2680.o

File size After adding 'const':
   textdata bss dec hex filename
  125303056   8   155943cea 
drivers/staging/media/atomisp/i2c/ov2680.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/ov2680.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov2680.c 
b/drivers/staging/media/atomisp/i2c/ov2680.c
index 5660910..9671876 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/ov2680.c
@@ -1519,7 +1519,7 @@ static int ov2680_probe(struct i2c_client *client,
return ret;
 }
 
-static struct acpi_device_id ov2680_acpi_match[] = {
+static const struct acpi_device_id ov2680_acpi_match[] = {
{"XXOV2680"},
{},
 };
-- 
2.7.4

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


[PATCH] staging: atomisp: lm3554: constify acpi_device_id.

2017-07-06 Thread Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by  work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   53471920  2472911c7b 
drivers/staging/media/atomisp/i2c/lm3554.o

File size After adding 'const':
   textdata bss dec hex filename
   54111856  2472911c7b 
drivers/staging/media/atomisp/i2c/lm3554.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/atomisp/i2c/lm3554.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/lm3554.c 
b/drivers/staging/media/atomisp/i2c/lm3554.c
index dd9c9c3..9ba1037 100644
--- a/drivers/staging/media/atomisp/i2c/lm3554.c
+++ b/drivers/staging/media/atomisp/i2c/lm3554.c
@@ -974,7 +974,7 @@ static const struct dev_pm_ops lm3554_pm_ops = {
.resume = lm3554_resume,
 };
 
-static struct acpi_device_id lm3554_acpi_match[] = {
+static const struct acpi_device_id lm3554_acpi_match[] = {
{ "INTCF1C" },
{},
 };
-- 
2.7.4

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


[PATCH] staging: ccree: constify dev_pm_ops structures.

2017-06-29 Thread Arvind Yadav
dev_pm_ops are not supposed to change at runtime. All functions
working with dev_pm_ops provided by  work with const
dev_pm_ops. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   3800 488   0428810c0 drivers/staging/ccree/ssi_driver.o

File size After adding 'const':
   textdata bss dec hex filename
   4010 288   0429810ca drivers/staging/ccree/ssi_driver.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/ccree/ssi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_driver.c 
b/drivers/staging/ccree/ssi_driver.c
index bc19adc..27e8f63 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -516,7 +516,7 @@ static int cc7x_remove(struct platform_device *plat_dev)
return 0;
 }
 #if defined (CONFIG_PM_RUNTIME) || defined (CONFIG_PM_SLEEP)
-static struct dev_pm_ops arm_cc7x_driver_pm = {
+static const struct dev_pm_ops arm_cc7x_driver_pm = {
SET_RUNTIME_PM_OPS(ssi_power_mgr_runtime_suspend, 
ssi_power_mgr_runtime_resume, NULL)
 };
 #endif
-- 
1.9.1

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


[PATCH] staging: unisys: visorbus: constify channel_attr_grp and dev_attr_grp

2017-06-23 Thread Arvind Yadav
File size before:
   textdata bss dec hex filename
   6712 960 52181932001 
drivers/staging/unisys/visorbus/visorbus_main.o

File size After adding 'const':
   textdata bss dec hex filename
   6840 832 52181932001 
drivers/staging/unisys/visorbus/visorbus_main.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index a692561..26f9885 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
-- 
1.9.1

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


[PATCH] staging: unisys: visorbus: constify visorchipset_parahotplug_group

2017-06-23 Thread Arvind Yadav
File size before:
   textdata bss dec hex filename
  11058 816  24   118982e7a 
drivers/staging/unisys/visorbus/visorchipset.o

File size After adding 'const':
   textdata bss dec hex filename
  11122 752  24   118982e7a 
drivers/staging/unisys/visorbus/visorchipset.o

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 4cfd0fa..5a499fa 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1151,7 +1151,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


[PATCH] Staging: media: davinci_vpfe Fix resource leaks in error paths.

2017-06-07 Thread Arvind Yadav
Free memory, if ipipe_s_config and ipipe_g_config are not successful.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index 6a3434c..b6994ee 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1286,15 +1286,20 @@ static int ipipe_s_config(struct v4l2_subdev *sd, 
struct vpfe_ipipe_config *cfg)
if (to && from && size) {
if (copy_from_user(to, from, size)) {
rval = -EFAULT;
+   kfree(params);
break;
}
rval = module_if->set(ipipe, to);
-   if (rval)
+   if (rval) {
+   kfree(params);
goto error;
+   }
} else if (to && !from && size) {
rval = module_if->set(ipipe, NULL);
-   if (rval)
+   if (rval) {
+   kfree(params);
goto error;
+   }
}
kfree(params);
}
@@ -1328,10 +1333,13 @@ static int ipipe_g_config(struct v4l2_subdev *sd, 
struct vpfe_ipipe_config *cfg)
 
if (to && from && size) {
rval = module_if->get(ipipe, from);
-   if (rval)
+   if (rval) {
+   kfree(params);
goto error;
+   }
if (copy_to_user(to, from, size)) {
rval = -EFAULT;
+   kfree(params);
break;
}
}
-- 
1.9.1

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


[PATCH] Staging: media: Unmap and release region obtained by ioremap_nocache

2017-03-17 Thread Arvind Yadav
Free memory mapping, if vpfe_ipipe_init is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index ff47a8f3..6a3434c 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1803,14 +1803,14 @@ void vpfe_ipipe_unregister_entities(struct 
vpfe_ipipe_device *vpfe_ipipe)
return -EBUSY;
ipipe->base_addr = ioremap_nocache(res->start, res_len);
if (!ipipe->base_addr)
-   return -EBUSY;
+   goto error_release;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 6);
if (!res)
-   return -ENOENT;
+   goto error_unmap;
ipipe->isp5_base_addr = ioremap_nocache(res->start, res_len);
if (!ipipe->isp5_base_addr)
-   return -EBUSY;
+   goto error_unmap;
 
v4l2_subdev_init(sd, _v4l2_ops);
sd->internal_ops = _v4l2_internal_ops;
@@ -1839,6 +1839,12 @@ void vpfe_ipipe_unregister_entities(struct 
vpfe_ipipe_device *vpfe_ipipe)
sd->ctrl_handler = >ctrls;
 
return media_entity_pads_init(me, IPIPE_PADS_NUM, pads);
+
+error_unmap:
+   iounmap(ipipe->base_addr);
+error_release:
+   release_mem_region(res->start, res_len);
+   return -ENOMEM;
 }
 
 /*
-- 
1.9.1

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


[PATCH v2 01/2] rtl8192u: r8192U:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav
'commit 2584cf83578c ("arch, drivers: don't
include  directly, use  instead")'
Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8192u/r8192U.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 0b7b04e..c078659 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "ieee80211/ieee80211.h"
 
 #define RTL8192U
-- 
1.9.1

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


Re: [v1] i4l: act2000: act2000:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav

Thanks for your suggestion :).
I have done the changes as per your concern . Please review it.

Thanks :)
-Arvind

On Thursday 05 January 2017 05:35 PM, Greg KH wrote:

On Thu, Jan 05, 2017 at 05:25:05PM +0530, Arvind Yadav wrote:

Please find my comment below.

Where?  What happened to your email quoting?


Thanks
-Arvind

On Thursday 05 January 2017 05:16 PM, Greg KH wrote:

On Thu, Jan 05, 2017 at 04:09:24PM +0530, Arvind Yadav wrote:

Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

That doesn't make much sense, and doesn't match the subject: or the
patch itself.
-- Please refer the commit which is already in main-lined.
commit 2584cf83578c26db144730ef498f4070f82ee3ea

Ah, here it is, please quote stuff correctly.

If you are referring to something else, great, then say so in the commit
itself.  Every commit should be self-explanatory, how am I supposed to
know this.

And this text still doesn't make sense to me, please fix.


And what is with the "[v1]"?
---V1 is stands  for patch set version 1

Please read Documentation/SubmittingPatches for how to properly label
patches, don't make new things up, we have too many different developers
(i.e. 4000+) for everyone to do their own unique thing.  :)

thanks,

greg k-h


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


[PATCH v2 02/2] i4l: act2000: act2000:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav
'commit 2584cf83578c ("arch, drivers: don't
include  directly, use  instead")'
Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/i4l/act2000/act2000.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/act2000/act2000.h 
b/drivers/staging/i4l/act2000/act2000.h
index 321d437..e372ff5 100644
--- a/drivers/staging/i4l/act2000/act2000.h
+++ b/drivers/staging/i4l/act2000/act2000.h
@@ -70,7 +70,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
-- 
1.9.1

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


Re: [v1] i4l: act2000: act2000:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav

Please find my comment below.
Thanks
-Arvind

On Thursday 05 January 2017 05:16 PM, Greg KH wrote:

On Thu, Jan 05, 2017 at 04:09:24PM +0530, Arvind Yadav wrote:

Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

That doesn't make much sense, and doesn't match the subject: or the
patch itself.
-- Please refer the commit which is already in main-lined.
commit 2584cf83578c26db144730ef498f4070f82ee3ea

And what is with the "[v1]"?
---V1 is stands  for patch set version 1
thanks,

greg k-h


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


[v1] rtl8192u: r8192U:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav
Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/rtl8192u/r8192U.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 0b7b04e..c078659 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "ieee80211/ieee80211.h"
 
 #define RTL8192U
-- 
1.9.1

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


[v1] i4l: act2000: act2000:- Do not use 'asm/io.h' directly, use 'linux/io.h'.

2017-01-05 Thread Arvind Yadav
Make uniform definition of ioremap, ioremap_wc, ioremap_wt and
ioremap_cache, tree-wide.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/i4l/act2000/act2000.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/act2000/act2000.h 
b/drivers/staging/i4l/act2000/act2000.h
index 321d437..e372ff5 100644
--- a/drivers/staging/i4l/act2000/act2000.h
+++ b/drivers/staging/i4l/act2000/act2000.h
@@ -70,7 +70,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
-- 
1.9.1

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


[PATCH] android: ashmem: handle the failures in ashmen driver

2016-08-29 Thread Arvind Yadav
Check return value of range_alloc, ashmem_shrink_scan and
register_shrinker. Handle errors correctly.

Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com>
---
 drivers/staging/android/ashmem.c | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index ca9a53c..eacc48d 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -595,6 +595,7 @@ static int ashmem_pin(struct ashmem_area *asma, size_t 
pgstart, size_t pgend)
 {
struct ashmem_range *range, *next;
int ret = ASHMEM_NOT_PURGED;
+   int err;
 
list_for_each_entry_safe(range, next, >unpinned_list, unpinned) {
/* moved past last applicable page; we can short circuit */
@@ -643,8 +644,11 @@ static int ashmem_pin(struct ashmem_area *asma, size_t 
pgstart, size_t pgend)
 * more complicated, we allocate a new range for the
 * second half and adjust the first chunk's endpoint.
 */
-   range_alloc(asma, range, range->purged,
-   pgend + 1, range->pgend);
+   err = range_alloc(asma, range, range->purged,
+ pgend + 1, range->pgend);
+   if (err)
+   return err;
+
range_shrink(range, range->pgstart, pgstart - 1);
break;
}
@@ -800,7 +804,9 @@ static long ashmem_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
.nr_to_scan = LONG_MAX,
};
ret = ashmem_shrink_count(_shrinker, );
-   ashmem_shrink_scan(_shrinker, );
+   if (ret)
+   return ret;
+   ret = ashmem_shrink_scan(_shrinker, );
}
break;
}
@@ -870,12 +876,18 @@ static int __init ashmem_init(void)
goto out_free2;
}
 
-   register_shrinker(_shrinker);
+   ret = register_shrinker(_shrinker);
+   if (unlikely(ret)) {
+   pr_err("failed to register shrinker!\n");
+   goto out_free3;
+   }
 
pr_info("initialized\n");
 
return 0;
 
+out_free3:
+   misc_deregister(_misc);
 out_free2:
kmem_cache_destroy(ashmem_range_cachep);
 out_free1:
-- 
2.7.4

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