Re: [PATCH] staging: lustre: Avoid creating two variables

2015-04-24 Thread hari prasath
On 24 April 2015 at 15:46, Gujulan Elango, Hari Prasath (H.)
 wrote:
> This patch avoids creating two variables in the final assembly output
> i.e. a string and a pointer to the string.
>
> Signed-off-by: Hari Prasath Gujulan Elango 
> ---
>  drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c 
> b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> index c8e2930..8882707 100644
> --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> @@ -241,7 +241,7 @@ void cfs_print_to_console(struct ptldebug_header *hdr, 
> int mask,
>   const char *buf, int len, const char *file,
>   const char *fn)
>  {
> -   char *prefix = "Lustre", *ptype = NULL;
> +   char prefix[] = "Lustre", *ptype = NULL;
>
> if ((mask & D_EMERG) != 0) {
> prefix = dbghdr_to_err_string(hdr);
> --
> 1.9.1
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Please discard this change as it breaks the build. I had build a
different copy of the source and assumed it succeeded. Sorry for the
mistake.

-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: declare file operations structure as static

2015-04-30 Thread hari prasath
On 30 April 2015 at 19:54, gre...@linuxfoundation.org
 wrote:
> On Fri, Apr 24, 2015 at 07:52:31AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
>> The fops structure is referenced only locally and hence could be made static
>>
>> Signed-off-by: Hari Prasath Gujulan Elango 
>> ---
>>  drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Someone else just sent this same patch before you did, sorry :(
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

>>> I didn't check that before sending the patch. thanks Greg.

-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: i2o: Remove unwanted semicolon

2015-04-30 Thread hari prasath
On 30 April 2015 at 19:44, gre...@linuxfoundation.org
 wrote:
> On Thu, Apr 23, 2015 at 04:09:28PM +0100, Alan Cox wrote:
>> On Thu, 2015-04-23 at 13:43 +, Gujulan Elango, Hari Prasath (H.)
>> wrote:
>> > This patch removes unwanted semicolon around close braces of code blocks
>>
>>
>> The i2o driver moved into staging ready to be deleted unless someone
>> steps up with hardware willing to maintain it (which is rather
>> unlikely).
>
> I think it's now time to delete these, want me to do that for 4.2?  I
> can queue that up in my tree now, so that we don't see any more cleanup
> patches being made for them?
>
> thanks,
>
> greg k-h
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

>>> Greg I am not sure if this needs to go into next release. I send this patch 
>>> as checkpatch was complaining about it. May be the owners of this driver 
>>> can only decide >>> upon it.  Alan cox also mentioned the same point that 
>>> its about to be deleted.

-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgnc: do cleanup on module exit

2015-06-09 Thread hari prasath
On 9 June 2015 at 13:00, Gujulan Elango, Hari Prasath (H.)
 wrote:
> From: Hari Prasath Gujulan Elango 
>
> Cleanup the device entry,device class & unregister the character device
> in the module exit.All this cleanup is done already in the dgap_stop()
> function.We need to call this in the cleanup module.
>
> Signed-off-by: Hari Prasath Gujulan Elango 
> ---
>  drivers/staging/dgap/dgap.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
> index 26b0446..b6fa486 100644
> --- a/drivers/staging/dgap/dgap.c
> +++ b/drivers/staging/dgap/dgap.c
> @@ -7161,6 +7161,7 @@ static void dgap_cleanup_module(void)
>  {
> if (dgap_numboards)
> pci_unregister_driver(&dgap_driver);
> +   dgap_stop();
>  }
>
>  module_init(dgap_init_module);
> --

Please discard this patch. The subject line is wrong.It should be
'dgap' and not 'dgnc'. I am sending a new one.



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: atomisp: replace kmalloc & memcpy with kmemdup

2017-07-07 Thread Hari Prasath
kmemdup can be used to replace kmalloc followed by a memcpy.This was
pointed out by the coccinelle tool.

Signed-off-by: Hari Prasath 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
index 34cc56f..58d4619 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
@@ -146,12 +146,10 @@ sh_css_load_blob_info(const char *fw, const struct 
ia_css_fw_info *bi, struct ia
char *namebuffer;
int namelength = (int)strlen(name);
 
-   namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
+   namebuffer = (char *)kmemdup(name, namelength + 1, GFP_KERNEL);
if (namebuffer == NULL)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 
-   memcpy(namebuffer, name, namelength + 1);
-
bd->name = fw_minibuffer[index].name = namebuffer;
} else {
bd->name = name;
-- 
2.10.0.GIT

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


Re: [PATCH] staging: atomisp: replace kmalloc & memcpy with kmemdup

2017-07-07 Thread hari prasath
On 07-Jul-2017 5:25 PM, "Alan Cox"  wrote:

On Fri, 2017-07-07 at 17:20 +0530, Hari Prasath wrote:
> kmemdup can be used to replace kmalloc followed by a memcpy.This was
> pointed out by the coccinelle tool.

And kstrdup could do the job even better I think ?
> Yes & thanks for pointing me that. I will send a v2 version.

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


[PATCH v2] staging: atomisp: use kstrdup to replace kmalloc and memcpy

2017-07-07 Thread Hari Prasath
kstrdup kernel primitive can be used to replace kmalloc followed by
string copy. This was reported by coccinelle tool

Signed-off-by: Hari Prasath 
---
 .../media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c   | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
index 34cc56f..68db87b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
@@ -144,14 +144,10 @@ sh_css_load_blob_info(const char *fw, const struct 
ia_css_fw_info *bi, struct ia
)
{
char *namebuffer;
-   int namelength = (int)strlen(name);
-
-   namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
-   if (namebuffer == NULL)
-   return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
-
-   memcpy(namebuffer, name, namelength + 1);
 
+   namebuffer = kstrdup(name, GFP_KERNEL);
+   if (!namebuffer)
+   return -ENOMEM;
bd->name = fw_minibuffer[index].name = namebuffer;
} else {
bd->name = name;
-- 
2.10.0.GIT

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


Re: [PATCH v2] staging: atomisp: use kstrdup to replace kmalloc and memcpy

2017-07-09 Thread hari prasath
On 8 July 2017 at 16:31, Sakari Ailus  wrote:
> Hi Hari,
>
> On Fri, Jul 07, 2017 at 08:15:21PM +0530, Hari Prasath wrote:
>> kstrdup kernel primitive can be used to replace kmalloc followed by
>> string copy. This was reported by coccinelle tool
>>
>> Signed-off-by: Hari Prasath 
>> ---
>>  .../media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c   | 10 
>> +++---
>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git 
>> a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
>> b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> index 34cc56f..68db87b 100644
>> --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> @@ -144,14 +144,10 @@ sh_css_load_blob_info(const char *fw, const struct 
>> ia_css_fw_info *bi, struct ia
>>   )
>>   {
>>   char *namebuffer;
>> - int namelength = (int)strlen(name);
>> -
>> - namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
>> - if (namebuffer == NULL)
>> - return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
>> -
>> - memcpy(namebuffer, name, namelength + 1);
>>
>> + namebuffer = kstrdup(name, GFP_KERNEL);
>> + if (!namebuffer)
>> + return -ENOMEM;
>
> The patch also changes the return value in error cases. I believe the
> caller(s) expect to get errors in the IA_CCS_ERR_* range.

Hi,

In this particular case, the calling function just checks if it's not
success defined by a enum. I think returning -ENOMEM would not effect,
at least in this case.

- Hari Prasath


>
>>   bd->name = fw_minibuffer[index].name = namebuffer;
>>   } else {
>>   bd->name = name;
>
> --
> Regards,
>
> Sakari Ailus
> e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: atomisp: use kstrdup to replace kmalloc and memcpy

2017-07-09 Thread Hari Prasath
kstrdup kernel primitive can be used to replace kmalloc followed by
string copy. This was reported by coccinelle tool.

Signed-off-by: Hari Prasath 
---
v1: Replace kmalloc followed by memcpy with kmemdup. Based on
review comments from Alan Cox, this could better be done
using kstrdup.
v2: Replace kmalloc followed by memcpy by kstrdup in this case
as it essentially is a string copy.Review comment recieved
questioning the return value in case of error. Error value
returned should be what the calling function is expecting.
v3: Retain the original error value returned to the calling
function if kstrdup() fails.
---
 .../staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c  | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
index 34cc56f..5d231ee 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
@@ -144,14 +144,10 @@ sh_css_load_blob_info(const char *fw, const struct 
ia_css_fw_info *bi, struct ia
)
{
char *namebuffer;
-   int namelength = (int)strlen(name);
 
-   namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
-   if (namebuffer == NULL)
+   namebuffer = kstrdup(name, GFP_KERNEL);
+   if (!namebuffer)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
-
-   memcpy(namebuffer, name, namelength + 1);
-
bd->name = fw_minibuffer[index].name = namebuffer;
} else {
bd->name = name;
-- 
2.10.0.GIT

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


Re: [PATCH v2] staging: atomisp: use kstrdup to replace kmalloc and memcpy

2017-07-09 Thread hari prasath
On 10 July 2017 at 01:22, Sakari Ailus  wrote:
> On Sun, Jul 09, 2017 at 05:56:15PM +0530, hari prasath wrote:
>> On 8 July 2017 at 16:31, Sakari Ailus  wrote:
>> > Hi Hari,
>> >
>> > On Fri, Jul 07, 2017 at 08:15:21PM +0530, Hari Prasath wrote:
>> >> kstrdup kernel primitive can be used to replace kmalloc followed by
>> >> string copy. This was reported by coccinelle tool
>> >>
>> >> Signed-off-by: Hari Prasath 
>> >> ---
>> >>  .../media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c   | 10 
>> >> +++---
>> >>  1 file changed, 3 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git 
>> >> a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
>> >> b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> >> index 34cc56f..68db87b 100644
>> >> --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> >> +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
>> >> @@ -144,14 +144,10 @@ sh_css_load_blob_info(const char *fw, const struct 
>> >> ia_css_fw_info *bi, struct ia
>> >>   )
>> >>   {
>> >>   char *namebuffer;
>> >> - int namelength = (int)strlen(name);
>> >> -
>> >> - namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
>> >> - if (namebuffer == NULL)
>> >> - return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
>> >> -
>> >> - memcpy(namebuffer, name, namelength + 1);
>> >>
>> >> + namebuffer = kstrdup(name, GFP_KERNEL);
>> >> + if (!namebuffer)
>> >> + return -ENOMEM;
>> >
>> > The patch also changes the return value in error cases. I believe the
>> > caller(s) expect to get errors in the IA_CCS_ERR_* range.
>>
>> Hi,
>>
>> In this particular case, the calling function just checks if it's not
>> success defined by a enum. I think returning -ENOMEM would not effect,
>> at least in this case.
>
> It might not, but the function now returns both negative Posix and positive
> CSS error codes. The CSS error codes could well be converted to Posix but
> it should be done consistently and preferrably in a separate patch.


Hi Sakari, Thanks for your comments. I will stick with just replacing
with kstrdup and retain the original error return value. I will send a
v3.

Regards,
Hari

>
> --
> Sakari Ailus
> e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
From: Hari Prasath 

Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
 drivers/staging/iio/adc/ad7192.c | 1 +
 drivers/staging/iio/adc/ad7780.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index d11c6de..78308a5 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index dec3ba6..e38d2ab9 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


[PATCH v2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
v2: Wrong from email ID in first version of patch

---
 drivers/staging/iio/adc/ad7192.c | 1 +
 drivers/staging/iio/adc/ad7780.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index d11c6de..78308a5 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index dec3ba6..e38d2ab9 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


Re: [PATCH v2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread hari prasath
Kindly discard this patch versions. I will send a new one.

On 17 July 2017 at 17:49, Hari Prasath  wrote:
> Adding missing indio_dev->dev.of_node references to allow iio consumers
> to access the device channels.
>
> Signed-off-by: Hari Prasath 
> ---
> v2: Wrong from email ID in first version of patch
>
> ---
>  drivers/staging/iio/adc/ad7192.c | 1 +
>  drivers/staging/iio/adc/ad7780.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/staging/iio/adc/ad7192.c 
> b/drivers/staging/iio/adc/ad7192.c
> index d11c6de..78308a5 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
> spi_set_drvdata(spi, indio_dev);
> st->devid = spi_get_device_id(spi)->driver_data;
> indio_dev->dev.parent = &spi->dev;
> +   indio_dev->dev.of_node = spi->dev.of_node;
> indio_dev->name = spi_get_device_id(spi)->name;
> indio_dev->modes = INDIO_DIRECT_MODE;
>
> diff --git a/drivers/staging/iio/adc/ad7780.c 
> b/drivers/staging/iio/adc/ad7780.c
> index dec3ba6..e38d2ab9 100644
> --- a/drivers/staging/iio/adc/ad7780.c
> +++ b/drivers/staging/iio/adc/ad7780.c
> @@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
> spi_set_drvdata(spi, indio_dev);
>
> indio_dev->dev.parent = &spi->dev;
> +   indio_dev->dev.of_node = spi->dev.of_node;
> indio_dev->name = spi_get_device_id(spi)->name;
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->channels = &st->chip_info->channel;
> --
> 2.10.0.GIT
>



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
v2: Wrong from mail ID in first version of patch
---
 drivers/staging/iio/adc/ad7192.c | 1 -
 drivers/staging/iio/adc/ad7780.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 78308a5..d11c6de 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,7 +668,6 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
-   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index e38d2ab9..dec3ba6 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,7 +195,6 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
-   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


Re: [PATCHv2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread hari prasath
Hi,

I agree that it's initialized in the core IIO driver. Also I have
screwed up the patch.

Regards,
Hari

On 17 July 2017 at 18:47, Lars-Peter Clausen  wrote:
> Hi,
>
> The patch seems to be reverted?
>
> Also should this part in the IIO core take care of automatically setting the
> of_node of the IIO device? As far as I can see we don't have to initialize
> it manually.
>
> /* If the calling driver did not initialize of_node, do it here */
> if (!indio_dev->dev.of_node && indio_dev->dev.parent)
> indio_dev->dev.of_node = indio_dev->dev.parent->of_node;
>
> - Lars
>
> On 07/17/2017 02:34 PM, Hari Prasath wrote:
>> Adding missing indio_dev->dev.of_node references to allow iio consumers
>> to access the device channels.
>>
>> Signed-off-by: Hari Prasath 
>> ---
>>   v2: Wrong from mail ID in first version of patch
>> ---
>>  drivers/staging/iio/adc/ad7192.c | 1 -
>>  drivers/staging/iio/adc/ad7780.c | 1 -
>>  2 files changed, 2 deletions(-)
>>
>> diff --git a/drivers/staging/iio/adc/ad7192.c 
>> b/drivers/staging/iio/adc/ad7192.c
>> index 78308a5..d11c6de 100644
>> --- a/drivers/staging/iio/adc/ad7192.c
>> +++ b/drivers/staging/iio/adc/ad7192.c
>> @@ -668,7 +668,6 @@ static int ad7192_probe(struct spi_device *spi)
>>   spi_set_drvdata(spi, indio_dev);
>>   st->devid = spi_get_device_id(spi)->driver_data;
>>   indio_dev->dev.parent = &spi->dev;
>> - indio_dev->dev.of_node = spi->dev.of_node;
>>   indio_dev->name = spi_get_device_id(spi)->name;
>>   indio_dev->modes = INDIO_DIRECT_MODE;
>>
>> diff --git a/drivers/staging/iio/adc/ad7780.c 
>> b/drivers/staging/iio/adc/ad7780.c
>> index e38d2ab9..dec3ba6 100644
>> --- a/drivers/staging/iio/adc/ad7780.c
>> +++ b/drivers/staging/iio/adc/ad7780.c
>> @@ -195,7 +195,6 @@ static int ad7780_probe(struct spi_device *spi)
>>   spi_set_drvdata(spi, indio_dev);
>>
>>   indio_dev->dev.parent = &spi->dev;
>> - indio_dev->dev.of_node = spi->dev.of_node;
>>   indio_dev->name = spi_get_device_id(spi)->name;
>>   indio_dev->modes = INDIO_DIRECT_MODE;
>>   indio_dev->channels = &st->chip_info->channel;
>>
>



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: adc: add space around substraction operation

2017-07-17 Thread Hari Prasath
Fix checkpatch warning to add space around the substraction operation

Signed-off-by: Hari Prasath 
---
 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c 
b/drivers/staging/iio/adc/ad7280a.c
index d5ab83f..d79e774 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -745,14 +745,14 @@ static irqreturn_t ad7280_event_handler(int irq, void 
*private)
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-   in_voltage-voltage_thresh_low_value,
+   in_voltage - voltage_thresh_low_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-   in_voltage-voltage_thresh_high_value,
+   in_voltage - voltage_thresh_high_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
-- 
2.10.0.GIT

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


[PATCH] Remove explicit return type cast

2017-08-02 Thread Hari Prasath
Remove explicit typecasting of return value in the interrupt handlers.

Signed-off-by: Hari Prasath 
---
 drivers/staging/pi433/pi433_if.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index ed737f4..95f3ef9 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -151,7 +151,7 @@ DIO0_irq_handler(unsigned int irq, void *dev_id, struct 
pt_regs *regs)
wake_up_interruptible(&device->fifo_wait_queue);
}
 
-   return (irq_handler_t) IRQ_HANDLED;
+   return IRQ_HANDLED;
 }
 
 static irq_handler_t
@@ -171,7 +171,7 @@ DIO1_irq_handler(unsigned int irq, void *dev_id, struct 
pt_regs *regs)
printk("DIO1 irq: %d bytes free in fifo\n", device->free_in_fifo); // 
TODO: printk() should include KERN_ facility level
wake_up_interruptible(&device->fifo_wait_queue);
 
-   return (irq_handler_t) IRQ_HANDLED;
+   return IRQ_HANDLED;
 }
 
 static void *DIO_irq_handler[NUM_DIO] = {
-- 
2.10.0.GIT

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


Re: [PATCH] Remove explicit return type cast

2017-08-03 Thread hari prasath
On 3 August 2017 at 11:52, kbuild test robot  wrote:
> Hi Hari,
>
> [auto build test WARNING on staging/staging-testing]
> [also build test WARNING on next-20170802]
> [cannot apply to v4.13-rc3]
> [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/Hari-Prasath/Remove-explicit-return-type-cast/20170803-080312
> config: blackfin-allyesconfig (attached as .config)
> compiler: bfin-uclinux-gcc (GCC) 6.2.0
> 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=blackfin
>

>> I tried these steps, it's giving me build error as below.

  CC  security/selinux/exports.o
  CC  security/apparmor/file.o
fs/ubifs/lpt_commit.c: In function 'next_pnode_to_dirty':
fs/ubifs/lpt_commit.c:617:1: internal compiler error: in
bfin_optimize_loop, at config/bfin/bfin.c:3978
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
scripts/Makefile.build:302: recipe for target 'fs/ubifs/lpt_commit.o' failed
make[2]: *** [fs/ubifs/lpt_commit.o] Error 1
make[2]: *** Waiting for unfinished jobs



> All warnings (new ones prefixed by >>):
>
>drivers/staging/pi433/pi433_if.c: In function 'DIO0_irq_handler':
>>> drivers/staging/pi433/pi433_if.c:154:9: warning: return makes pointer from 
>>> integer without a cast [-Wint-conversion]
>  return IRQ_HANDLED;
> ^~~
>drivers/staging/pi433/pi433_if.c: In function 'DIO1_irq_handler':
>drivers/staging/pi433/pi433_if.c:174:9: warning: return makes pointer from 
> integer without a cast [-Wint-conversion]
>  return IRQ_HANDLED;
> ^~~
>
> vim +154 drivers/staging/pi433/pi433_if.c
>
>129
>130  /* GPIO interrupt handlers */
>131  static irq_handler_t
>132  DIO0_irq_handler(unsigned int irq, void *dev_id, struct pt_regs *regs)
>133  {
>134  struct pi433_device *device = dev_id;
>135
>136  if  (device->irq_state[DIO0] == DIO_PacketSent)
>137  {
>138  device->free_in_fifo = FIFO_SIZE;
>139  printk("DIO0 irq: Packet sent\n"); // TODO: printk() 
> should include KERN_ facility level
>140  wake_up_interruptible(&device->fifo_wait_queue);
>141  }
>142  else if (device->irq_state[DIO0] == DIO_Rssi_DIO0)
>143  {
>144  printk("DIO0 irq: RSSI level over threshold\n");
>145  wake_up_interruptible(&device->rx_wait_queue);
>146  }
>147  else if (device->irq_state[DIO0] == DIO_PayloadReady)
>148  {
>149  printk("DIO0 irq: PayloadReady\n");
>150  device->free_in_fifo = 0;
>151  wake_up_interruptible(&device->fifo_wait_queue);
>152  }
>153
>  > 154  return IRQ_HANDLED;
>155  }
>156
>
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Remove explicit return type cast

2017-08-08 Thread hari prasath
On 3 August 2017 at 18:53, Dan Carpenter  wrote:
> On Thu, Aug 03, 2017 at 06:23:54PM +0530, hari prasath wrote:
>> On 3 August 2017 at 11:52, kbuild test robot  wrote:
>> > Hi Hari,
>> >
>> > [auto build test WARNING on staging/staging-testing]
>> > [also build test WARNING on next-20170802]
>> > [cannot apply to v4.13-rc3]
>> > [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/Hari-Prasath/Remove-explicit-return-type-cast/20170803-080312
>> > config: blackfin-allyesconfig (attached as .config)
>> > compiler: bfin-uclinux-gcc (GCC) 6.2.0
>> > 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=blackfin
>> >
>>
>> >> I tried these steps, it's giving me build error as below.
>>
>
> You don't need to cross compile on blackfin to get the warning.  Just
> use the normal compiler.
>
> regards,
> dan carpenter
>

> Sorry, I had sent the patch in a hurry. Yes the warning is true. I will try 
> to come up with a v2 of the patch without any warnings. As of now this can be 
> discarded.
>  thanks,
>  hari prasath



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: fsl-mc: Remove redundant initalization of the .owner field

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes the redundant static initialization of the .owner field from
this driver as it is being overidden by the call from the platform driver 
register

Signed-off-by: Hari Prasath 
---
 drivers/staging/fsl-mc/bus/mc-bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c 
b/drivers/staging/fsl-mc/bus/mc-bus.c
index 23512d0..766a659 100644
--- a/drivers/staging/fsl-mc/bus/mc-bus.c
+++ b/drivers/staging/fsl-mc/bus/mc-bus.c
@@ -713,7 +713,6 @@ MODULE_DEVICE_TABLE(of, fsl_mc_bus_match_table);
 static struct platform_driver fsl_mc_bus_driver = {
.driver = {
   .name = "fsl_mc_bus",
-  .owner = THIS_MODULE,
   .pm = NULL,
   .of_match_table = fsl_mc_bus_match_table,
   },
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: i2o: Remove unwanted semicolon

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes unwanted semicolon around close braces of code blocks

Signed-off-by: Hari Prasath 
---
 drivers/staging/i2o/iop.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/i2o/iop.c b/drivers/staging/i2o/iop.c
index 23bdbe4..18dcc34 100644
--- a/drivers/staging/i2o/iop.c
+++ b/drivers/staging/i2o/iop.c
@@ -75,7 +75,7 @@ struct i2o_message *i2o_msg_get_wait(struct i2o_controller 
*c, int wait)
}
 
return msg;
-};
+}
 
 #if BITS_PER_LONG == 64
 /**
@@ -123,7 +123,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context);
 
return entry->context;
-};
+}
 
 /**
  *  i2o_cntxt_list_remove - Remove a pointer from the context list
@@ -159,7 +159,7 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void 
*ptr)
  context, ptr);
 
return context;
-};
+}
 
 /**
  *  i2o_cntxt_list_get - Get a pointer from the context list and remove it
@@ -192,7 +192,7 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 
context)
  ptr);
 
return ptr;
-};
+}
 
 /**
  *  i2o_cntxt_list_get_ptr - Get a context id from the context list
@@ -224,7 +224,7 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void 
*ptr)
  ptr, context);
 
return context;
-};
+}
 #endif
 
 /**
@@ -245,7 +245,7 @@ struct i2o_controller *i2o_find_iop(int unit)
}
 
return NULL;
-};
+}
 
 /**
  * i2o_iop_find_device - Find a I2O device on an I2O controller
@@ -266,7 +266,7 @@ struct i2o_device *i2o_iop_find_device(struct 
i2o_controller *c, u16 tid)
return dev;
 
return NULL;
-};
+}
 
 /**
  * i2o_quiesce_controller - quiesce controller
@@ -308,7 +308,7 @@ static int i2o_iop_quiesce(struct i2o_controller *c)
i2o_status_get(c);  // Entered READY state
 
return rc;
-};
+}
 
 /**
  * i2o_iop_enable - move controller from ready to OPERATIONAL
@@ -348,7 +348,7 @@ static int i2o_iop_enable(struct i2o_controller *c)
i2o_status_get(c);  // entered OPERATIONAL state
 
return rc;
-};
+}
 
 /**
  * i2o_iop_quiesce_all - Quiesce all I2O controllers on the system
@@ -363,7 +363,7 @@ static inline void i2o_iop_quiesce_all(void)
if (!c->no_quiesce)
i2o_iop_quiesce(c);
}
-};
+}
 
 /**
  * i2o_iop_enable_all - Enables all controllers on the system
@@ -376,7 +376,7 @@ static inline void i2o_iop_enable_all(void)
 
list_for_each_entry_safe(c, tmp, &i2o_controllers, list)
i2o_iop_enable(c);
-};
+}
 
 /**
  * i2o_clear_controller - Bring I2O controller into HOLD state
@@ -581,7 +581,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
i2o_iop_enable_all();
 
return rc;
-};
+}
 
 /**
  * i2o_iop_activate - Bring controller up to HOLD
@@ -650,7 +650,7 @@ static int i2o_iop_activate(struct i2o_controller *c)
}
 
return i2o_hrt_get(c);
-};
+}
 
 static void i2o_res_alloc(struct i2o_controller *c, unsigned long flags)
 {
@@ -779,7 +779,7 @@ static int i2o_iop_online(struct i2o_controller *c)
return rc;
 
return 0;
-};
+}
 
 /**
  * i2o_iop_remove - Remove the I2O controller from the I2O core
@@ -891,7 +891,7 @@ static int i2o_systab_build(void)
systab->num_entries = count;
 
return 0;
-};
+}
 
 /**
  * i2o_parse_hrt - Parse the hardware resource table.
@@ -905,7 +905,7 @@ static int i2o_parse_hrt(struct i2o_controller *c)
 {
i2o_dump_hrt(c);
return 0;
-};
+}
 
 /**
  * i2o_status_get - Get the status block from the I2O controller
@@ -1029,7 +1029,7 @@ static void i2o_iop_release(struct device *dev)
struct i2o_controller *c = to_i2o_controller(dev);
 
i2o_iop_free(c);
-};
+}
 
 /**
  * i2o_iop_alloc - Allocate and initialize a i2o_controller struct
@@ -1062,7 +1062,7 @@ struct i2o_controller *i2o_iop_alloc(void)
 I2O_MSG_INPOOL_MIN)) {
kfree(c);
return ERR_PTR(-ENOMEM);
-   };
+   }
 
INIT_LIST_HEAD(&c->devices);
spin_lock_init(&c->lock);
@@ -1081,7 +1081,7 @@ struct i2o_controller *i2o_iop_alloc(void)
 #endif
 
return c;
-};
+}
 
 /**
  * i2o_iop_add - Initialize the I2O controller and add him to the I2O core
@@ -1145,7 +1145,7 @@ int i2o_iop_add(struct i2o_controller *c)
i2o_iop_reset(c);
 
return rc;
-};
+}
 
 /**
  * i2o_event_register - Turn on/off event notification for a I2O device
@@ -1181,7 +1181,7 @@ int i2o_event_register(struct i2o_device *dev, struct 
i2o_driver *drv,
i2o_msg_post(c, msg);
 
return 0;
-};
+}
 
 /**
  * i2o_iop_init - I2O main initialization function
@@ -1231,7 +1231,7 @@ static void __e

[PATCH] staging: comedi: Remove unwanted lines of code

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes a few lines of code & retains the same functionality

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/comedi/drivers/cb_pcimdda.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdda.c 
b/drivers/staging/comedi/drivers/cb_pcimdda.c
index a4781db..19210d8 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdda.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdda.c
@@ -164,11 +164,7 @@ static int cb_pcimdda_auto_attach(struct comedi_device 
*dev,
 
s = &dev->subdevices[1];
/* digital i/o subdevice */
-   ret = subdev_8255_init(dev, s, NULL, PCIMDDA_8255_BASE_REG);
-   if (ret)
-   return ret;
-
-   return 0;
+   return subdev_8255_init(dev, s, NULL, PCIMDDA_8255_BASE_REG);
 }
 
 static struct comedi_driver cb_pcimdda_driver = {
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: emxx_udc : remove stray semicolon

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes a stray semicolon around closing brace of an if code
block.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/emxx_udc/emxx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index fbf82bc..32dcacb 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2347,7 +2347,7 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
dev_err(udc->dev, "*** Reset Cancel failed\n");
return -EINVAL;
}
-   };
+   }
 
 #if 0
if ((system_rev & EMXX_REV_MASK) < EMXX_REV_ES3)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: emxx_udc: Remove dead code

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes few lines of commented code.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/emxx_udc/emxx_udc.c | 33 -
 1 file changed, 33 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 32dcacb..4177d62 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2199,18 +2199,6 @@ static void _nbu2ss_ep0_enable(struct nbu2ss_udc *udc)
_nbu2ss_writel(&udc->p_regs->EP0_INT_ENA, EP0_INT_EN_BIT);
 }
 
-#if 0
-/*-*/
-static void _nbu2ss_ep0_disable(struct nbu2ss_udc *udc)
-{
-   _nbu2ss_bitclr(&udc->p_regs->EP0_INT_ENA, EP0_INT_EN_BIT);
-
-   _nbu2ss_bitset(&udc->p_regs->EP0_CONTROL
-   , (EP0_BCLR | EP0_INAK | EP0_ONAK | EP0_BCLR));
-
-   _nbu2ss_bitclr(&udc->p_regs->EP0_CONTROL, EP0_AUTO);
-}
-#endif
 
 /*-*/
 static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
@@ -2311,12 +2299,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
if (udc->udc_enabled)
return 0;
 
-#if 0
-   emxx_open_clockgate(EMXX_CLK_USB1);
-   /* emxx_clkctrl_off(EMXX_CLKCTRL_USB1); */
-   /* emxx_clkctrl_on(EMXX_CLKCTRL_USB1); */
-   emxx_unreset_device(EMXX_RST_USB1);
-#endif
/*
Reset
*/
@@ -2330,13 +2312,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
 
_nbu2ss_writel(&udc->p_regs->AHBSCTR, WAIT_MODE);
 
-#if 0
-   /* DMA Mode Setting */
-   if ((system_rev & EMXX_REV_MASK) == EMXX_REV_ES1) {
-   _nbu2ss_bitset(&udc->p_regs->AHBMCTR, BURST_TYPE);
-   _nbu2ss_bitclr(&udc->p_regs->AHBMCTR, HTRANS_MODE);
-   } else
-#endif
_nbu2ss_writel(&udc->p_regs->AHBMCTR,
HBUSREQ_MODE | HTRANS_MODE | WBURST_TYPE);
 
@@ -2349,9 +2324,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
}
}
 
-#if 0
-   if ((system_rev & EMXX_REV_MASK) < EMXX_REV_ES3)
-#endif
_nbu2ss_bitset(&udc->p_regs->UTMI_CHARACTER_1, USB_SQUSET);
 
_nbu2ss_bitset(&udc->p_regs->USB_CONTROL, (INT_SEL | SOF_RCV));
@@ -2383,11 +2355,6 @@ static void _nbu2ss_disable_controller(struct nbu2ss_udc 
*udc)
_nbu2ss_reset_controller(udc);
_nbu2ss_bitset(&udc->p_regs->EPCTR, (DIRPD | EPC_RST));
}
-#if 0
-   emxx_reset_device(EMXX_RST_USB1);
-   /* emxx_clkctrl_on(EMXX_CLKCTRL_USB1); */
-   emxx_close_clockgate(EMXX_CLK_USB1);
-#endif
 }
 
 /*-*/
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: gsc_hdpi: Remove dead code

2015-04-23 Thread Gujulan Elango, Hari Prasath (H.)
This patch removes commented code from this driver.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/comedi/drivers/gsc_hpdi.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c 
b/drivers/staging/comedi/drivers/gsc_hpdi.c
index 3cb6409..d9715ea 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -135,13 +135,6 @@ static const struct hpdi_board hpdi_boards[] = {
.device_id  = PCI_DEVICE_ID_PLX_9080,
.subdevice_id   = 0x2400,
 },
-#if 0
-   {
-   .name   = "pxi-hpdi32",
-   .device_id  = 0x9656,
-   .subdevice_id   = 0x2705,
-},
-#endif
 };
 
 struct hpdi_private {
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: declare file operations structure as static

2015-04-24 Thread Gujulan Elango, Hari Prasath (H.)
The fops structure is referenced only locally and hence could be made static

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index acfe08e..fbeddf9 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -147,7 +147,7 @@ static ssize_t mdc_kuc_write(struct file *file,
return count;
 }
 
-struct file_operations mdc_kuc_fops = {
+static const struct file_operations mdc_kuc_fops = {
.open   = mdc_kuc_open,
.write  = mdc_kuc_write,
.release= single_release,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: Avoid creating two variables

2015-04-24 Thread Gujulan Elango, Hari Prasath (H.)
This patch avoids creating two variables in the final assembly output
i.e. a string and a pointer to the string.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index c8e2930..8882707 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -241,7 +241,7 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int 
mask,
  const char *buf, int len, const char *file,
  const char *fn)
 {
-   char *prefix = "Lustre", *ptype = NULL;
+   char prefix[] = "Lustre", *ptype = NULL;
 
if ((mask & D_EMERG) != 0) {
prefix = dbghdr_to_err_string(hdr);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: Use time_after macro

2015-04-24 Thread Gujulan Elango, Hari Prasath (H.)
This patch replaces a condition check for time elapsea with a
simple time_after macro

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 0bbffec..602a189 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -28,6 +28,7 @@
 #include "r8192E_phyreg.h"
 #include "r8190P_rtl8256.h" /* RTL8225 Radio frontend */
 #include "r8192E_cmdpkt.h"
+#include 
 
 static void rtl8192_hw_sleep_down(struct net_device *dev)
 {
@@ -105,7 +106,7 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
return;
}
 
-   if ((time - jiffies) > msecs_to_jiffies(MAX_SLEEP_TIME)) {
+   if (time_after(time, jiffies + msecs_to_jiffies(MAX_SLEEP_TIME))) {
netdev_info(dev, ">too long to sleep:%lld > %ld\n",
time - jiffies, msecs_to_jiffies(MAX_SLEEP_TIME));
spin_unlock_irqrestore(&priv->ps_lock, flags);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712e: use time_before() macro

2015-04-24 Thread Gujulan Elango, Hari Prasath (H.)
This patch replaces the condition check for time elapsed with a
simplified time_before() macro

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 602a189..88233cc 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -99,7 +99,7 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
 
time -= msecs_to_jiffies(8 + 16 + 7);
 
-   if ((time - jiffies) <= msecs_to_jiffies(MIN_SLEEP_TIME)) {
+   if (time_before(time, jiffies + msecs_to_jiffies(MIN_SLEEP_TIME))) {
spin_unlock_irqrestore(&priv->ps_lock, flags);
netdev_info(dev, "too short to sleep::%lld < %ld\n",
time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: Check return value and handle error

2015-04-27 Thread Gujulan Elango, Hari Prasath (H.)
Check the return value of function and handle error condition appropriately.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/iio/accel/lis3l02dq_core.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c 
b/drivers/staging/iio/accel/lis3l02dq_core.c
index ebcab56..13d8018 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -289,6 +289,8 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_CALIBBIAS:
reg = lis3l02dq_axis_map[LIS3L02DQ_BIAS][chan->address];
ret = lis3l02dq_spi_read_reg_8(indio_dev, reg, (u8 *)&stemp);
+   if (ret)
+   goto error_ret;
/* to match with what previous code does */
*val = stemp;
return IIO_VAL_INT;
@@ -584,6 +586,8 @@ int lis3l02dq_disable_all_events(struct iio_dev *indio_dev)
ret = lis3l02dq_spi_read_reg_8(indio_dev,
   LIS3L02DQ_REG_CTRL_2_ADDR,
   &control);
+   if (ret)
+   goto error_ret;
 
control &= ~LIS3L02DQ_REG_CTRL_2_ENABLE_INTERRUPT;
ret = lis3l02dq_spi_write_reg_8(indio_dev,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: Return error if memory allocation fails

2015-04-27 Thread Gujulan Elango, Hari Prasath (H.)
Should return ENOMEM if memory allocation occurs.There is a wrong code
jump here and this patch addresses this issue.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/comedi/comedi_fops.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index e78ddbe..b3e8f3d 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1412,16 +1412,12 @@ static int do_insnlist_ioctl(struct comedi_device *dev,
return -EFAULT;
 
data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
-   if (!data) {
-   ret = -ENOMEM;
-   goto error;
-   }
+   if (!data)
+   return -ENOMEM;
 
insns = kcalloc(insnlist.n_insns, sizeof(*insns), GFP_KERNEL);
-   if (!insns) {
-   ret = -ENOMEM;
-   goto error;
-   }
+   if (!insns)
+   return -ENOMEM;
 
if (copy_from_user(insns, insnlist.insns,
   sizeof(*insns) * insnlist.n_insns)) {
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: Fix freeing ERR_PTR

2015-04-29 Thread Gujulan Elango, Hari Prasath (H.)
The return value of memdup_user is a pointer to errno.Freeing it will cause
error.Hence set it to NULL before branching to free the pointer.smatch also
raises the same warning.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 42fba3f..9d59be8 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1915,6 +1915,7 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev,
pparmbuf = memdup_user(p->pointer, len);
if (IS_ERR(pparmbuf)) {
ret = PTR_ERR(pparmbuf);
+   pparmbuf = NULL;
goto _r871x_mp_ioctl_hdl_exit;
}
poidparam = (struct mp_ioctl_param *)pparmbuf;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8712: Fix freeing ERR_PTR

2015-04-29 Thread Gujulan Elango, Hari Prasath (H.)
From: Julia Lawall 
Sent: Thursday, April 30, 2015 12:12 AM
To: Gujulan Elango, Hari Prasath (H.)
Cc: sh...@linux.com; cristina.oprice...@gmail.com; hamohammed...@gmail.com; 
vitaly.osi...@gmail.com; de...@driverdev.osuosl.org
Subject: Re: [PATCH] staging: rtl8712: Fix freeing ERR_PTR

On Wed, 29 Apr 2015, Gujulan Elango, Hari Prasath (H.) wrote:

> The return value of memdup_user is a pointer to errno.Freeing it will cause
> error.Hence set it to NULL before branching to free the pointer.smatch also
> raises the same warning.

Perhaps there is no point to jumping to the label if there is nothing to
do there.

The code contains other strange things, like:

    if (status) {
    ret = -EFAULT;
    goto _r871x_mp_ioctl_hdl_exit;
    }
_r871x_mp_ioctl_hdl_exit:

Overall, it would be nice to see if the code could be reorganized so that
there is only a goto if there is something to do to cleanup, so that
return ret would only be executed in an error case, and so that the code
would return 0 directly on success.


thanks for your comments. I am sending version 2 of the patch for review.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: rtl8712: Fix freeing ERR_PTR

2015-04-29 Thread Gujulan Elango, Hari Prasath (H.)
The return value of memdup_user is a pointer to errno.Freeing it will cause
error.Hence set it to NULL before branching to free the pointer.smatch also
raises the same warning.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:Remove unnecessary goto and return error directly.Use goto
   only if some cleanup is done.These were review comments by
   Julia Lawall.
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 24 +++-
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 42fba3f..f563b2d 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1905,18 +1905,14 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev,
uint status;
int ret = 0;
 
-   if ((!p->length) || (!p->pointer)) {
-   ret = -EINVAL;
-   goto _r871x_mp_ioctl_hdl_exit;
-   }
+   if ((!p->length) || (!p->pointer))
+   return -EINVAL;
bset = (u8)(p->flags & 0x);
len = p->length;
pparmbuf = NULL;
pparmbuf = memdup_user(p->pointer, len);
-   if (IS_ERR(pparmbuf)) {
-   ret = PTR_ERR(pparmbuf);
-   goto _r871x_mp_ioctl_hdl_exit;
-   }
+   if (IS_ERR(pparmbuf))
+   return PTR_ERR(pparmbuf);
poidparam = (struct mp_ioctl_param *)pparmbuf;
if (poidparam->subcode >= MAX_MP_IOCTL_SUBCODE) {
ret = -EINVAL;
@@ -2058,21 +2054,15 @@ static int r871x_set_chplan(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   int ret = 0;
struct _adapter *padapter = netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
int ch_plan = -1;
 
-   if ((padapter->bDriverStopped) || (pdata == NULL)) {
-   ret = -EINVAL;
-   goto exit;
-   }
+   if ((padapter->bDriverStopped) || (pdata == NULL))
+   return -EINVAL;
ch_plan = (int)*extra;
r8712_set_chplan_cmd(padapter, ch_plan);
-
-exit:
-
-   return ret;
+   return 0;
 }
 
 static int r871x_wps_start(struct net_device *dev,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: rtl8712: Fix freeing ERR_PTR

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)

From: Dan Carpenter 
Sent: Thursday, April 30, 2015 12:45 PM
To: Gujulan Elango, Hari Prasath (H.)
Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
florian.c.schilha...@googlemail.com; gre...@linuxfoundation.org; Babu, 
Viswanathan (V.); larry.fin...@lwfinger.net
Subject: Re: [PATCHv2] staging: rtl8712: Fix freeing ERR_PTR

I sent a fix for this a couple weeks ago.

On Thu, Apr 30, 2015 at 06:32:01AM +, Gujulan Elango, Hari Prasath (H.) 
wrote:
> The return value of memdup_user is a pointer to errno.Freeing it will cause
> error.Hence set it to NULL before branching to free the pointer.smatch also
> raises the same warning.
>
> Signed-off-by: Hari Prasath Gujulan Elango 
> ---
>   v2:Remove unnecessary goto and return error directly.Use goto
>  only if some cleanup is done.These were review comments by
>  Julia Lawall.
> ---
>  drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 24 +++-
>  1 file changed, 7 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
> b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> index 42fba3f..f563b2d 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> @@ -1905,18 +1905,14 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev,
>   uint status;
>   int ret = 0;
>
> - if ((!p->length) || (!p->pointer)) {
> - ret = -EINVAL;
> - goto _r871x_mp_ioctl_hdl_exit;
> - }
> + if ((!p->length) || (!p->pointer))
> + return -EINVAL;
>   bset = (u8)(p->flags & 0x);
>   len = p->length;
>   pparmbuf = NULL;
>   pparmbuf = memdup_user(p->pointer, len);
> - if (IS_ERR(pparmbuf)) {
> - ret = PTR_ERR(pparmbuf);
> - goto _r871x_mp_ioctl_hdl_exit;
> - }
> + if (IS_ERR(pparmbuf))
> + return PTR_ERR(pparmbuf);


These changes are good.  My patch was similar.

http://www.spinics.net/lists/linux-kernel-janitors/msg21846.html

>   poidparam = (struct mp_ioctl_param *)pparmbuf;
>   if (poidparam->subcode >= MAX_MP_IOCTL_SUBCODE) {
>   ret = -EINVAL;
> @@ -2058,21 +2054,15 @@ static int r871x_set_chplan(struct net_device *dev,
>   struct iw_request_info *info,
>   union iwreq_data *wrqu, char *extra)
>  {
> - int ret = 0;
>   struct _adapter *padapter = netdev_priv(dev);
>   struct iw_point *pdata = &wrqu->data;
>   int ch_plan = -1;
>
> - if ((padapter->bDriverStopped) || (pdata == NULL)) {
> - ret = -EINVAL;
> - goto exit;
> - }
> + if ((padapter->bDriverStopped) || (pdata == NULL))
> + return -EINVAL;
>   ch_plan = (int)*extra;
>   r8712_set_chplan_cmd(padapter, ch_plan);
> -
> -exit:
> -
> - return ret;
> + return 0;

These changes are an unrelated cleanup to a different function.  Only do
one thing per patch.

---

Ok Dan I would send patch v3 with only these changes. I will send the cleanup 
done on another unrelated function as a separate patch.

regards
Hari Prasath

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


[PATCHv3] staging: rtl8712: Fix freeing ERR_PTR

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
The return value of memdup_user is a pointer to errno.Freeing it will cause
error.Hence set it to NULL before branching to free the pointer.smatch also
raises the same warning.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:Remove unnecessary goto and return error directly.Use goto
   only if some cleanup is done.These were review comments by
   Julia Lawall.

v3:Address Dan Carpenter review comments.Send unrelated changes as
   seperate patch.
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 42fba3f..663f5bd 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1905,18 +1905,14 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev,
uint status;
int ret = 0;
 
-   if ((!p->length) || (!p->pointer)) {
-   ret = -EINVAL;
-   goto _r871x_mp_ioctl_hdl_exit;
-   }
+   if ((!p->length) || (!p->pointer))
+   return -EINVAL;
bset = (u8)(p->flags & 0x);
len = p->length;
pparmbuf = NULL;
pparmbuf = memdup_user(p->pointer, len);
-   if (IS_ERR(pparmbuf)) {
-   ret = PTR_ERR(pparmbuf);
-   goto _r871x_mp_ioctl_hdl_exit;
-   }
+   if (IS_ERR(pparmbuf))
+   return PTR_ERR(pparmbuf);
poidparam = (struct mp_ioctl_param *)pparmbuf;
if (poidparam->subcode >= MAX_MP_IOCTL_SUBCODE) {
ret = -EINVAL;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: return error directly

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
Signed-off-by: Hari Prasath Gujulan Elango 

return error directly to avoid unwanted branching where no cleanup
is done.Also removes the ret variable.
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 663f5bd..f563b2d 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -2054,21 +2054,15 @@ static int r871x_set_chplan(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   int ret = 0;
struct _adapter *padapter = netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
int ch_plan = -1;
 
-   if ((padapter->bDriverStopped) || (pdata == NULL)) {
-   ret = -EINVAL;
-   goto exit;
-   }
+   if ((padapter->bDriverStopped) || (pdata == NULL))
+   return -EINVAL;
ch_plan = (int)*extra;
r8712_set_chplan_cmd(padapter, ch_plan);
-
-exit:
-
-   return ret;
+   return 0;
 }
 
 static int r871x_wps_start(struct net_device *dev,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: rtl8712: return error directly

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
return error directly to avoid unwanted branching where no cleanup
is done.Also removes the ret variable.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 663f5bd..f563b2d 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -2054,21 +2054,15 @@ static int r871x_set_chplan(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   int ret = 0;
struct _adapter *padapter = netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
int ch_plan = -1;
 
-   if ((padapter->bDriverStopped) || (pdata == NULL)) {
-   ret = -EINVAL;
-   goto exit;
-   }
+   if ((padapter->bDriverStopped) || (pdata == NULL))
+   return -EINVAL;
ch_plan = (int)*extra;
r8712_set_chplan_cmd(padapter, ch_plan);
-
-exit:
-
-   return ret;
+   return 0;
 }
 
 static int r871x_wps_start(struct net_device *dev,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8712: return error directly

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
From: gre...@linuxfoundation.org 
Sent: Thursday, April 30, 2015 3:05 PM
To: Gujulan Elango, Hari Prasath (H.)
Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; dan.carpen...@oracle.com; 
larry.fin...@lwfinger.net; florian.c.schilha...@googlemail.com; Babu, 
Viswanathan (V.)
Subject: Re: [PATCH] staging: rtl8712: return error directly

On Thu, Apr 30, 2015 at 08:23:08AM +, Gujulan Elango, Hari Prasath (H.) 
wrote:
> Signed-off-by: Hari Prasath Gujulan Elango 
>
> return error directly to avoid unwanted branching where no cleanup
> is done.Also removes the ret variable.

signed-off-by goes below the description, not above it.

Please fix up and resend.



I have sent the v2 patch.
regards
hari
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: fix wrong assignment

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
This patch addresses a spatch warning on assigning a negative
value to a unsigned integer.Similar patch has been submitted by
Larry Finger earlier to silence the same spatch warning in another
file. The logic is the negative number to an unsigned quantity is
fixed by adding 256 to -98 to get the equivalent negative number as
per Larry Finger.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 352d381..41d2f3f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2310,7 +2310,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
 
struct rtllib_rx_stats stats = {
.signal = 0,
-   .noise = -98,
+   .noise = 158, /*-98 -dBm*/
.rate = 0,
.freq = RTLLIB_24GHZ_BAND,
};
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192e: fix wrong assignment

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)
From: Dan Carpenter 
Sent: Thursday, April 30, 2015 6:33 PM
To: Gujulan Elango, Hari Prasath (H.)
Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
gre...@linuxfoundation.org; wlan...@realtek.com; mateusz.kulikow...@gmail.com; 
Babu, Viswanathan (V.); larry.fin...@lwfinger.net
Subject: Re: [PATCH] staging: rtl8192e: fix wrong assignment

On Thu, Apr 30, 2015 at 12:06:28PM +, Gujulan Elango, Hari Prasath (H.) 
wrote:
> This patch addresses a spatch warning on assigning a negative
> value to a unsigned integer.Similar patch has been submitted by
> Larry Finger earlier to silence the same spatch warning in another
> file.

What's the git hash and title for Larry's patch?

> The logic is the negative number to an unsigned quantity is
> fixed by adding 256 to -98 to get the equivalent negative number as
> per Larry Finger.

>> It was a spatch warning.I am not sure if that change by Larry went in,but 
>> here's the link where I found a submission by Larry.
http://permalink.gmane.org/gmane.linux.kernel.wireless.general/113125


regards,
dan carpenter

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


Re: [PATCH] staging: rtl8192e: fix wrong assignment

2015-04-30 Thread Gujulan Elango, Hari Prasath (H.)

From: Larry Finger  on behalf of Larry Finger 

Sent: Thursday, April 30, 2015 11:03 PM
To: Gujulan Elango, Hari Prasath (H.); Dan Carpenter
Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
gre...@linuxfoundation.org; wlan...@realtek.com; mateusz.kulikow...@gmail.com; 
Babu, Viswanathan (V.)
Subject: Re: [PATCH] staging: rtl8192e: fix wrong assignment

On 04/30/2015 11:59 AM, Gujulan Elango, Hari Prasath (H.) wrote:
> From: Dan Carpenter 
> Sent: Thursday, April 30, 2015 6:33 PM
> To: Gujulan Elango, Hari Prasath (H.)
> Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
> gre...@linuxfoundation.org; wlan...@realtek.com; 
> mateusz.kulikow...@gmail.com; Babu, Viswanathan (V.); 
> larry.fin...@lwfinger.net
> Subject: Re: [PATCH] staging: rtl8192e: fix wrong assignment
>
> On Thu, Apr 30, 2015 at 12:06:28PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
>> This patch addresses a spatch warning on assigning a negative
>> value to a unsigned integer.Similar patch has been submitted by
>> Larry Finger earlier to silence the same spatch warning in another
>> file.
>
> What's the git hash and title for Larry's patch?
>
>> The logic is the negative number to an unsigned quantity is
>> fixed by adding 256 to -98 to get the equivalent negative number as
>> per Larry Finger.
>
>>> It was a spatch warning.I am not sure if that change by Larry went in,but 
>>> here's the link where I found a submission by Larry.
> http://permalink.gmane.org/gmane.linux.kernel.wireless.general/113125

If you actually read that patch, you will see that the "fix" was to remove the
noise member initialization. The git hash, title, and commit message for the
previous change was as follows:

commit 354d0f3c40fb40193213e40f3177ff528798ca8d
Author: Larry Finger 
Date:   Wed Sep 25 12:57:47 2013 -0500

 rtlwifi: Fix smatch warnings in usb.c

 Smatch displays the following:
   CHECK   drivers/net/wireless/rtlwifi/usb.c
 drivers/net/wireless/rtlwifi/usb.c:458 _rtl_usb_rx_process_agg() warn:
assigning (-98) to unsigned variable 'stats.noise'
 drivers/net/wireless/rtlwifi/usb.c:503 _rtl_usb_rx_process_noagg() warn:
assigning (-98) to unsigned variable 'stats.noise'
 drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring
unreachable code.
 drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring
unreachable code.

 The variable 'stats.noise' is not used, thus the initializers are removed.
 The unreachable code info is fixed by including the appropriate section 
inside
 #ifdef .. #endif constructions.

 Signed-off-by: Larry Finger 
 Signed-off-by: John W. Linville 

If you are going to be submitting kernel patches, then I suggest a tutorial on
the usage of git so that you can find previous commits.

Unlike the rtlwifi drivers, this one appears to set the noise value, thus a
simple removal of the initialization is not appropriate. Your fix of setting the
value to 256-98 seems to be correct.

>>> I did see the git log related to this file. I was not sure if I could 
>>> remove the variable right away assuming the variable is used somewhere. 
>>> Hence I sticked with just silencing the smatch warning.


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


Re: [PATCH] staging: rtl8192e: fix wrong assignment

2015-05-04 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, Apr 30, 2015 at 02:09:13PM -0500, Larry Finger wrote:
> On 04/30/2015 12:50 PM, Gujulan Elango, Hari Prasath (H.) wrote:
> >
> >From: Larry Finger  on behalf of Larry Finger 
> >
> >Sent: Thursday, April 30, 2015 11:03 PM
> >To: Gujulan Elango, Hari Prasath (H.); Dan Carpenter
> >Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
> >gre...@linuxfoundation.org; wlan...@realtek.com; 
> >mateusz.kulikow...@gmail.com; Babu, Viswanathan (V.)
> >Subject: Re: [PATCH] staging: rtl8192e: fix wrong assignment
> >
> >On 04/30/2015 11:59 AM, Gujulan Elango, Hari Prasath (H.) wrote:
> >>From: Dan Carpenter 
> >>Sent: Thursday, April 30, 2015 6:33 PM
> >>To: Gujulan Elango, Hari Prasath (H.)
> >>Cc: de...@driverdev.osuosl.org; julia.law...@lip6.fr; 
> >>gre...@linuxfoundation.org; wlan...@realtek.com; 
> >>mateusz.kulikow...@gmail.com; Babu, Viswanathan (V.); 
> >>larry.fin...@lwfinger.net
> >>Subject: Re: [PATCH] staging: rtl8192e: fix wrong assignment
> >>
> >>On Thu, Apr 30, 2015 at 12:06:28PM +, Gujulan Elango, Hari Prasath (H.) 
> >>wrote:
> >>>This patch addresses a spatch warning on assigning a negative
> >>>value to a unsigned integer.Similar patch has been submitted by
> >>>Larry Finger earlier to silence the same spatch warning in another
> >>>file.
> >>
> >>What's the git hash and title for Larry's patch?
> >>
> >>>The logic is the negative number to an unsigned quantity is
> >>>fixed by adding 256 to -98 to get the equivalent negative number as
> >>>per Larry Finger.
> >>
> >>>>It was a spatch warning.I am not sure if that change by Larry went in,but 
> >>>>here's the link where I found a submission by Larry.
> >>http://permalink.gmane.org/gmane.linux.kernel.wireless.general/113125
> >
> >If you actually read that patch, you will see that the "fix" was to remove 
> >the
> >noise member initialization. The git hash, title, and commit message for the
> >previous change was as follows:
> >
> >commit 354d0f3c40fb40193213e40f3177ff528798ca8d
> >Author: Larry Finger 
> >Date:   Wed Sep 25 12:57:47 2013 -0500
> >
> >  rtlwifi: Fix smatch warnings in usb.c
> >
> >  Smatch displays the following:
> >CHECK   drivers/net/wireless/rtlwifi/usb.c
> >  drivers/net/wireless/rtlwifi/usb.c:458 _rtl_usb_rx_process_agg() warn:
> >assigning (-98) to unsigned variable 'stats.noise'
> >  drivers/net/wireless/rtlwifi/usb.c:503 _rtl_usb_rx_process_noagg() 
> > warn:
> >assigning (-98) to unsigned variable 'stats.noise'
> >  drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: 
> > ignoring
> >unreachable code.
> >  drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: 
> > ignoring
> >unreachable code.
> >
> >  The variable 'stats.noise' is not used, thus the initializers are 
> > removed.
> >  The unreachable code info is fixed by including the appropriate 
> > section inside
> >  #ifdef .. #endif constructions.
> >
> >  Signed-off-by: Larry Finger 
> >  Signed-off-by: John W. Linville 
> >
> >If you are going to be submitting kernel patches, then I suggest a tutorial 
> >on
> >the usage of git so that you can find previous commits.
> >
> >Unlike the rtlwifi drivers, this one appears to set the noise value, thus a
> >simple removal of the initialization is not appropriate. Your fix of setting 
> >the
> >value to 256-98 seems to be correct.
> >
> >>>>I did see the git log related to this file. I was not sure if I could 
> >>>>remove the variable right away assuming the variable is used somewhere. 
> >>>>Hence I sticked with just silencing the smatch warning.
> >
> >
> >
> 
> Obviously, you cannot remove the variable now.
> 
> Please fix your mailer. The most recent material to which you were
> replying was not indented any levels, but the "new" material was 3
> levels deep. It is extremely difficult to follow the thread.
> 
> Larry
>

Please exuse me for the replies being screwed up. I just figured out how to 
reply to e-mails from Mutt.Hope you would be getting cleaner replies from now 
on. 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192e: fix wrong assignment

2015-05-04 Thread Gujulan Elango, Hari Prasath (H.)
On Fri, May 01, 2015 at 10:46:53AM +0300, Dan Carpenter wrote:
> The subject says "fix" but this does not fix a run time bug, it just
> silences a warning.  It's still the correct thing according to Larry
> so that's good.
> 
> On Thu, Apr 30, 2015 at 12:06:28PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > This patch addresses a spatch warning on assigning a negative
> > value to a unsigned integer.
> 
> It's not an unsigned integer, it's an u8.
> 
> > Similar patch has been submitted by
> > Larry Finger earlier to silence the same spatch warning in another
> > file.
> 
> A similar warning but a totally different patch.
> 
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
> > b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > index 352d381..41d2f3f 100644
> > --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > @@ -2310,7 +2310,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
> >  
> > struct rtllib_rx_stats stats = {
> > .signal = 0,
> > -   .noise = -98,
> > +   .noise = 158, /*-98 -dBm*/
> 
> Let's just do this:
> 
>   .noise = (u8) -98,
> 
> That way it silences the warning and we don't need the comment.
> 
> regards,
> dan carpenter
> 

I am sending version 2 of this patch with the above said changes for
review.

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


[PATCHv2] staging: rtl8192e: fix wrong assignment

2015-05-04 Thread Gujulan Elango, Hari Prasath (H.)
This patch addresses a spatch warning on assigning a negative
value to a unsigned integer.Similar patch has been submitted by
Larry Finger earlier to silence the same spatch warning in another
file.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2: Address Dan Carpenter review comments for version 1 of this
patch.
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 352d381..a7a1ade 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2310,7 +2310,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
 
struct rtllib_rx_stats stats = {
.signal = 0,
-   .noise = -98,
+   .noise = (u8) -98,
.rate = 0,
.freq = RTLLIB_24GHZ_BAND,
};
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: rtl8192e: fix wrong assignment

2015-05-05 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, May 05, 2015 at 12:19:57PM +0300, Dan Carpenter wrote:
> On Mon, May 04, 2015 at 10:17:09PM +0200, Mateusz Kulikowski wrote:
> > As far as I know (radio) noise is rarely above 0 dBm - if it is, you're 
> > doing something wrong.
> > This means we can just change rtllib_rx_stats::noise to s8.
> 
> I think it's hard to do that because these definitions are part of the
> user space API.
> 
> include/uapi/linux/wireless.h
> 
> linux-wireless is not on the CC list so we will never know for sure.
> 
> There are still a bunch of these warnings.
> 
> drivers/staging/rtl8192u/r8192U_wx.c:271 rtl8180_wx_get_range() warn: 
> assigning (-78) to unsigned variable 'range->avg_qual.level'
> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:914 r8711_wx_get_range() warn: 
> assigning (-78) to unsigned variable 'range->avg_qual.level'
> drivers/net/wireless/ipw2x00/ipw2100.c:6817 ipw2100_wx_get_range() warn: 
> assigning (-78) to unsigned variable 'range->avg_qual.level'
> drivers/net/wireless/hostap/hostap_ioctl.c:1023 prism2_ioctl_giwrange() warn: 
> assigning (-60) to unsigned variable 'range->avg_qual.level'
> drivers/net/wireless/prism54/isl_ioctl.c:451 prism54_get_range() warn: 
> assigning (-80) to unsigned variable 'range->avg_qual.level'
> 
> drivers/staging/rtl8192u/r8192U_core.c:4493 rtl8192_rx_nomal() warn: 
> assigning (-98) to unsigned variable 'stats.noise'
> drivers/staging/rtl8192u/r8192U_core.c:4605 rtl8192_rx_cmd() warn: assigning 
> (-98) to unsigned variable 'stats.noise'
> drivers/staging/rtl8192u/r8192U_wx.c:266 rtl8180_wx_get_range() warn: 
> assigning (-98) to unsigned variable 'range->max_qual.noise'
> drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323 r8192_get_wireless_stats() 
> warn: assigning (-100) to unsigned variable 'wstats->qual.noise'
> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2322 rtl8192_rx_normal() warn: 
> assigning (-98) to unsigned variable 'stats.noise'
> drivers/net/wireless/hostap/hostap_ioctl.c:1024 prism2_ioctl_giwrange() warn: 
> assigning (-95) to unsigned variable 'range->avg_qual.noise'
> 
> regards,
> dan carpenter
> 

Added the linux-wireless guys in the CC list so that they can comment on
this.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-07 Thread Gujulan Elango, Hari Prasath (H.)
Remove the goto and return error directly thereby removing a variable

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
index b139ed4..a979048 100644
--- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
@@ -1209,7 +1209,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
-   int ret = 0;
 
DBG_8723A("%s(%s): call netdev_open23a\n", __func__, ndev->name);
 
@@ -1238,14 +1237,12 @@ static int cfg80211_rtw_change_iface(struct wiphy 
*wiphy,
 
if (cfg80211_infrastructure_mode(padapter, type) != _SUCCESS) {
rtw_wdev->iftype = old_type;
-   ret = -EPERM;
-   goto exit;
+   return -EPERM;
}
 
rtw_setopmode_cmd23a(padapter, type);
 
-exit:
-   return ret;
+   return 0;
 }
 
 void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-07 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 07, 2015 at 03:19:34PM +0300, Dan Carpenter wrote:
> On Thu, May 07, 2015 at 08:03:06AM -0400, Jes Sorensen wrote:
> > "Gujulan Elango, Hari Prasath (H.)"  writes:
> > > Remove the goto and return error directly thereby removing a variable
> > >
> > > Signed-off-by: Hari Prasath Gujulan Elango 
> > > ---
> > >  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > NACK!
> 
> SHOUTING!
> 
> > 
> > The goto is cleaner and more consistent, rather than hiding a return in
> > the middle of the code.
> 
> More consistent with what?  There are already returns earlier in the
> function.  Do-nothing gotos are pointless and annoying.
> 
> regards,
> dan carpenter
> 

I sent this patch  because goto & return was mixed up in this function.
There was a return as well as goto used. And i guess goto is not 
encouraged anywhere. In this case especially,I couldn't see any 
significant cleanup being done in the goto label.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: rtl8192e: Use time_after macro

2015-05-08 Thread Gujulan Elango, Hari Prasath (H.)
This patch replaces a condition check for time elapsed with a
simple time_after macro

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:Fixes a build warning.time_after() macro requires both of
its arguments to be unsigned long.Build warning was missed & later
reported by the kbuild test robot.
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 0bbffec..840dda9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -28,6 +28,7 @@
 #include "r8192E_phyreg.h"
 #include "r8190P_rtl8256.h" /* RTL8225 Radio frontend */
 #include "r8192E_cmdpkt.h"
+#include 
 
 static void rtl8192_hw_sleep_down(struct net_device *dev)
 {
@@ -93,6 +94,7 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
 
u32 tmp;
unsigned long flags;
+   unsigned long timeout;
 
spin_lock_irqsave(&priv->ps_lock, flags);
 
@@ -104,8 +106,8 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));
return;
}
-
-   if ((time - jiffies) > msecs_to_jiffies(MAX_SLEEP_TIME)) {
+   timeout = jiffies + msecs_to_jiffies(MAX_SLEEP_TIME);
+   if (time_after((unsigned long)time, timeout)) {
netdev_info(dev, ">too long to sleep:%lld > %ld\n",
time - jiffies, msecs_to_jiffies(MAX_SLEEP_TIME));
spin_unlock_irqrestore(&priv->ps_lock, flags);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2]staging: rtl8192e: use time_before() macro

2015-05-08 Thread Gujulan Elango, Hari Prasath (H.)
This patch replaces the condition check for time elapsed with a
simplified time_before() macro

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:Fixes a build warning.time_before() macro requires both of
its arguments to be unsigned long.Build warning was missed & later
reported by the kbuild test robot.Previous version of this patch was
sent with a wrong subject line i.e it was showing rtl8712e instead of
the rtl8192e.
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 840dda9..386ae0c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -100,7 +100,8 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
 
time -= msecs_to_jiffies(8 + 16 + 7);
 
-   if ((time - jiffies) <= msecs_to_jiffies(MIN_SLEEP_TIME)) {
+   timeout = jiffies + msecs_to_jiffies(MIN_SLEEP_TIME);
+   if (time_before((unsigned long)time,timeout)) {
spin_unlock_irqrestore(&priv->ps_lock, flags);
netdev_info(dev, "too short to sleep::%lld < %ld\n",
time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: remove redundant initialization

2015-05-12 Thread Gujulan Elango, Hari Prasath (H.)
The variable pHalData is initialized twice in this same function with
same value.So removing one of them.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
index 11e1108..9733aa6 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
@@ -55,7 +55,7 @@ int FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, 
u32 CmdLen,
u8 h2c_box_num;
u32 msgbox_addr;
u32 msgbox_ex_addr;
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
+   struct hal_data_8723a *pHalData;
u32 h2c_cmd = 0;
u16 h2c_cmd_ex = 0;
int ret = _FAIL;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-12 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 07, 2015 at 10:09:59AM -0400, Jes Sorensen wrote:
> "Gujulan Elango, Hari Prasath (H.)"  writes:
> > On Thu, May 07, 2015 at 03:19:34PM +0300, Dan Carpenter wrote:
> >> On Thu, May 07, 2015 at 08:03:06AM -0400, Jes Sorensen wrote:
> >> > "Gujulan Elango, Hari Prasath (H.)"  writes:
> >> > > Remove the goto and return error directly thereby removing a variable
> >> > >
> >> > > Signed-off-by: Hari Prasath Gujulan Elango 
> >> > > ---
> >> > >  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
> >> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> >> > 
> >> > NACK!
> >> 
> >> SHOUTING!
> >> 
> >> > 
> >> > The goto is cleaner and more consistent, rather than hiding a return in
> >> > the middle of the code.
> >> 
> >> More consistent with what?  There are already returns earlier in the
> >> function.  Do-nothing gotos are pointless and annoying.
> >> 
> >> regards,
> >> dan carpenter
> >> 
> >
> > I sent this patch  because goto & return was mixed up in this function.
> > There was a return as well as goto used. And i guess goto is not 
> > encouraged anywhere. In this case especially,I couldn't see any 
> > significant cleanup being done in the goto label.
> 
> I will accept a patch to remove the returns in the middle of the
> function, if you wish to submit that.
> 
> A return at the very beginning of a function is OK, but in the middle of
> a larger function they make it harder to catch when code exists.
> 
> Jes

Is this accepted as it is or should I send v2 with the goto retained but
the return in the middle of the function also converted to goto for
consistency.I agree that goto's are used at many places in the kernel
but this is really a small function where it doesn't seem to help
much.Also there is no signficant cleanup being done in the definition of
the label.

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


[PATCH] staging: rtl8712: fix indentation issue

2015-05-12 Thread Gujulan Elango, Hari Prasath (H.)
Fixed indentation issue in few lines.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8712/recv_linux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c 
b/drivers/staging/rtl8712/recv_linux.c
index 799a0f9..4201ce7 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -132,9 +132,9 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
return;
 _recv_indicatepkt_drop:
 /*enqueue back to free_recv_queue*/
-if (precv_frame)
+   if (precv_frame)
r8712_free_recvframe(precv_frame, pfree_recv_queue);
-precvpriv->rx_drop++;
+   precvpriv->rx_drop++;
 }
 
 static void _r8712_reordering_ctrl_timeout_handler (unsigned long data)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: check kzalloc return value

2015-05-13 Thread Gujulan Elango, Hari Prasath (H.)
check the return value of kzalloc before accessing the memory pointer

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index bf1ec27..6fa5261 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -292,6 +292,10 @@ static int client_common_fill_super(struct super_block 
*sb, char *md, char *dt,
char *buf;
 
buf = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
+   if (!buf) {
+   err = -ENOMEM;
+   goto out_md_fid;
+   }
obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
  valid ^ CLIENT_CONNECT_MDT_REQD, ",");
LCONSOLE_ERROR_MSG(0x170, "Server %s does not support 
feature(s) needed for correct operation of this client (%s). Please upgrade 
server or downgrade client.\n",
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wlan-ng: check return value of kmalloc

2015-05-13 Thread Gujulan Elango, Hari Prasath (H.)
check return value of kmalloc before accessing the memory pointer.This
function returns a non-zero value on failure hence a return value of 1
is used.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/wlan-ng/p80211conv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index bd69e8c..c38e8ef 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -207,6 +207,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/*  need to pick keynum other than default? */
 
p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
+   if (!p80211_wep->data)
+   return 1;
foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
  skb->len,
  (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK),
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wlan-ng: check return value of kmalloc

2015-05-13 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, May 13, 2015 at 03:02:25PM +0300, Dan Carpenter wrote:
> On Wed, May 13, 2015 at 02:51:07PM +0300, Dan Carpenter wrote:
> > On Wed, May 13, 2015 at 11:32:50AM +, Gujulan Elango, Hari Prasath (H.) 
> > wrote:
> > > check return value of kmalloc before accessing the memory pointer.This
> > > function returns a non-zero value on failure hence a return value of 1
> > > is used.
> > 
> > Could you do some reasearch where this thing is freed?
> 
> 
> Never mind.  It's freed in the caller.  But it does a weird thing:
> 
> TODO-list:  Clean up p80211_wep->data allocation in 
> p80211knetdev_hard_start_xmit().
> 
> It's set to NULL, then memset to zero, then when we call
> skb_ether_to_p80211() we again set it to NULL then at the end we check
> if it is equal to skb->data (it is not), and we also call kzfree()
> instead of kfree().  Load of nonsense.
> 
> regards,
> dan carpenter
> 

yes Dan I did see the code.Should it be corrected ? Is this driver going
to be removed as its supporting a legacy device? I couldn't see any
patches being submitted against this driver for few months.

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


[PATCHv2] staging: wlan-ng: check return value of kmalloc

2015-05-13 Thread Gujulan Elango, Hari Prasath (H.)
check return value of kmalloc before accessing the memory pointer and
return -ENOMEM if allocation fails.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:Return -ENOMEM for memory allocation failure.
---
 drivers/staging/wlan-ng/p80211conv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index bd69e8c..c0e6ac8 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -207,6 +207,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/*  need to pick keynum other than default? */
 
p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
+   if (!p80211_wep->data)
+   return -ENOMEM;
foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
  skb->len,
  (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK),
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wlan-ng: check return value of kmalloc

2015-05-13 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, May 13, 2015 at 05:27:10PM +0300, Dan Carpenter wrote:
> On Wed, May 13, 2015 at 01:36:44PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > On Wed, May 13, 2015 at 03:02:25PM +0300, Dan Carpenter wrote:
> > > On Wed, May 13, 2015 at 02:51:07PM +0300, Dan Carpenter wrote:
> > > > On Wed, May 13, 2015 at 11:32:50AM +0000, Gujulan Elango, Hari Prasath 
> > > > (H.) wrote:
> > > > > check return value of kmalloc before accessing the memory pointer.This
> > > > > function returns a non-zero value on failure hence a return value of 1
> > > > > is used.
> > > > 
> > > > Could you do some reasearch where this thing is freed?
> > > 
> > > 
> > > Never mind.  It's freed in the caller.  But it does a weird thing:
> > > 
> > > TODO-list:  Clean up p80211_wep->data allocation in 
> > > p80211knetdev_hard_start_xmit().
> > > 
> > > It's set to NULL, then memset to zero, then when we call
> > > skb_ether_to_p80211() we again set it to NULL then at the end we check
> > > if it is equal to skb->data (it is not), and we also call kzfree()
> > > instead of kfree().  Load of nonsense.
> > > 
> > > regards,
> > > dan carpenter
> > > 
> > 
> > yes Dan I did see the code.Should it be corrected ? Is this driver going
> > to be removed as its supporting a legacy device? I couldn't see any
> > patches being submitted against this driver for few months.
> 
> Can you just return -ENOMEM instead of 1.
> 
> It's not important to match the surrounding style since the surrounding
> style is garbage.
> 
> regards,
> dan carpenter
> 

I have send the v2 patch with the above said change.thanks

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


[PATCH] staging: rtl8188eu: remove unwanted assignment

2015-05-14 Thread Gujulan Elango, Hari Prasath (H.)
remove an unwanted assignment to a variable which is overwritten in the
very next line.The first value assigned is not used.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8188eu/hal/usb_halinit.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c 
b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 7b01d5a..8726222 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -2077,7 +2077,6 @@ static void UpdateHalRAMask8188EUsb(struct adapter 
*adapt, u32 mac_id, u8 rssi_l
break;
}
 
-   rate_bitmap = 0x0fff;
rate_bitmap = ODM_Get_Rate_Bitmap(&haldata->odmpriv, mac_id, mask, 
rssi_level);
DBG_88E("%s => mac_id:%d, networkType:0x%02x, mask:0x%08x\n\t ==> 
rssi_level:%d, rate_bitmap:0x%08x\n",
__func__, mac_id, networkType, mask, rssi_level, rate_bitmap);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: return error if copy_to_user fails

2015-05-14 Thread Gujulan Elango, Hari Prasath (H.)
The return value of copy_to_user() isn't checked for failure.Hence
return -EFAULT if it fails.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/lustre/lustre/lov/lov_pack.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c 
b/drivers/staging/lustre/lustre/lov/lov_pack.c
index 5356d53..aa3d6de 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pack.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pack.c
@@ -448,9 +448,10 @@ int lov_getstripe(struct obd_export *exp, struct 
lov_stripe_md *lsm,
(lum.lmm_stripe_count < lsm->lsm_stripe_count)) {
/* Return right size of stripe to user */
lum.lmm_stripe_count = lsm->lsm_stripe_count;
-   rc = copy_to_user(lump, &lum, lum_size);
-   rc = -EOVERFLOW;
-   goto out_set;
+   if (copy_to_user(lump, &lum, lum_size)) {
+   rc = -EFAULT;
+   goto out_set;
+   }
}
rc = lov_packmd(exp, &lmmk, lsm);
if (rc < 0)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: return error if copy_to_user fails

2015-05-14 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 14, 2015 at 12:47:19PM +0300, Dan Carpenter wrote:
> On Thu, May 14, 2015 at 09:22:01AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > The return value of copy_to_user() isn't checked for failure.Hence
> > return -EFAULT if it fails.
> > 
> > Signed-off-by: Hari Prasath Gujulan Elango 
> > ---
> >  drivers/staging/lustre/lustre/lov/lov_pack.c | 7 ---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c 
> > b/drivers/staging/lustre/lustre/lov/lov_pack.c
> > index 5356d53..aa3d6de 100644
> > --- a/drivers/staging/lustre/lustre/lov/lov_pack.c
> > +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c
> > @@ -448,9 +448,10 @@ int lov_getstripe(struct obd_export *exp, struct 
> > lov_stripe_md *lsm,
> > (lum.lmm_stripe_count < lsm->lsm_stripe_count)) {
> > /* Return right size of stripe to user */
> > lum.lmm_stripe_count = lsm->lsm_stripe_count;
> > -   rc = copy_to_user(lump, &lum, lum_size);
> > -   rc = -EOVERFLOW;
> > -   goto out_set;
> > +   if (copy_to_user(lump, &lum, lum_size)) {
> > +   rc = -EFAULT;
> > +   goto out_set;
> > +   }
> 
> I'm not sure this is right, and I don't think we should take it without
> some lustre people signing off.
> 
> The original code looks deliberate, like the error happened earlier and
> if the copy_to_user() succeed that's fine because it gives them a hint
> what went wrong, but we want to return an error -EOVERFLOW regardless of
> if the copy_to_user() works or not.
> 
> regards,
> dan carpenter
> 

I was little skeptical when sending this patch.I agree with you and we
shall wait for comments from lustre developers.May be if it was
purposeful,they could have left out a comment.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rts5208: remove variable and check directly

2015-05-15 Thread Gujulan Elango, Hari Prasath (H.)
This trivial patch removes temporary variable to check return value of
a function and checks return value directly.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rts5208/ms.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index ee818b0..ab6e8bc 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -52,7 +52,6 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 
trans_mode,
u8 tpc, u8 cnt, u8 cfg)
 {
struct ms_info *ms_card = &(chip->ms_card);
-   int retval;
u8 *ptr;
 
dev_dbg(rtsx_dev(chip), "%s: tpc = 0x%x\n", __func__, tpc);
@@ -72,8 +71,7 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 
trans_mode,
 
rtsx_add_cmd(chip, READ_REG_CMD, MS_TRANS_CFG, 0, 0);
 
-   retval = rtsx_send_cmd(chip, MS_CARD, 5000);
-   if (retval < 0) {
+   if (rtsx_send_cmd(chip, MS_CARD, 5000) < 0) {
rtsx_clear_ms_error(chip);
ms_set_err_code(chip, MS_TO_ERROR);
rtsx_trace(chip);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rts5208: use temporary variable for readability

2015-05-15 Thread Gujulan Elango, Hari Prasath (H.)
Use a temporary value to hold the SD lock status thereby making the code
readable.This also fixes a coding style violation with the braces around
the if block.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rts5208/sd.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index a8d657b..2eff625 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -237,6 +237,7 @@ RTY_SEND_CMD:
}
 
if ((rsp_type == SD_RSP_TYPE_R1) || (rsp_type == SD_RSP_TYPE_R1b)) {
+   u8 sd_lock_status;
if ((cmd_idx != SEND_RELATIVE_ADDR) &&
(cmd_idx != SEND_IF_COND)) {
if (cmd_idx != STOP_TRANSMISSION) {
@@ -246,11 +247,11 @@ RTY_SEND_CMD:
}
}
 #ifdef SUPPORT_SD_LOCK
-   if (ptr[1] & 0x7D)
+   sd_lock_status = 0x7D;
 #else
-   if (ptr[1] & 0x7F)
+   sd_lock_status = 0x7F;
 #endif
-   {
+   if (ptr[1] & sd_lock_status) {
dev_dbg(rtsx_dev(chip), "ptr[1]: 0x%02x\n",
ptr[1]);
rtsx_trace(chip);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rts5208: use temporary variable for readability

2015-05-17 Thread Gujulan Elango, Hari Prasath (H.)
On Fri, May 15, 2015 at 04:09:42PM +0300, Dan Carpenter wrote:
> On Fri, May 15, 2015 at 12:09:42PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > Use a temporary value to hold the SD lock status thereby making the code
> > readable.This also fixes a coding style violation with the braces around
> > the if block.
> > 
> 
> This isn't more readable than the original code.
> 
> The right fix is to get rid if #ifdefs from the .c files.
> 
> Figure out when SUPPORT_SD_LOCK is defined and when it's not.  Add a
> #define LOCK_STATUS 0x7D or 0x7F to the right places in the header
> files.
> 
> regards,
> dan carpenter
> 

The macro SUPPORT_SD_LOCK is defined only in the header file
rtsx_chip.h.Its defined always.The macro is used at other places in this
file. So I will drop this patch for now. Please discard.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: replace printk with subsystem debug

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
replace the printk with netdev subsystem debug infrastructure.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index fe3e7e12..f6e3f83 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -344,7 +344,7 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, 
struct sk_buff *skb,
res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
atomic_dec(&crypt->refcnt);
if (res < 0) {
-   printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed 
(SA= %pM keyidx=%d)\n",
+   netdev_dbg(ieee->dev, "%s: MSDU decryption/MIC verification 
failed (SA= %pM keyidx=%d)\n",
   ieee->dev->name, hdr->addr2, keyidx);
return -1;
}
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rtl8192e: define macro for use in C file

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
This macro defines the maximum sequence number for an IEEE802.11 frame.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtllib.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 3c8b708..9ee0896 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -47,6 +47,7 @@
 #define MAX_PRECMD_CNT 16
 #define MAX_RFDEPENDCMD_CNT 16
 #define MAX_POSTCMD_CNT 16
+#define IEEE80211_MAX_SEQ 4096
 
 #ifndef WIRELESS_SPY
 #define WIRELESS_SPY
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8192e: replace hard coded value with macro

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
replace the hard coded value for the maximum sequence number of a ieee
802.11 frame by a Macro.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/rtl8192e/rtllib_tx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 3b15963..6325ceb 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -326,7 +326,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device 
*ieee,
goto FORCED_AGG_SETTING;
} else if (pTxTs->bUsingBa == false) {
if 
(SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum,
-  (pTxTs->TxCurSeq+1)%4096))
+  (pTxTs->TxCurSeq+1)%IEEE80211_MAX_SEQ))
pTxTs->bUsingBa = true;
else
goto FORCED_AGG_SETTING;
@@ -525,7 +525,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct 
sk_buff *skb,
skb->priority, TX_DIR, true))
return 0;
seqnum = pTS->TxCurSeq;
-   pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096;
+   pTS->TxCurSeq = (pTS->TxCurSeq+1)%IEEE80211_MAX_SEQ;
return seqnum;
}
return 0;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: rtl8192e: define macro for use in C file

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, May 18, 2015 at 03:47:58PM +0300, Dan Carpenter wrote:
> Fold this together with the other patch.  Do 1 thing per patch, not half
> a thing per patch.  This change makes no sense on its own.
> 
> regards,
> dan carpenter
> 

I didn't think of it. I am sending v2 with both the related changes as a
single patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: rtl8192e: replace hard coded value with macro

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
replace the hard coded value of 4096 with macro which defines the
maximum sequence number of a ieee 802.11 frame.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2: Previously send this as two different patches which is wrong
as the individual patches doesn't make sense.Resending as a single patch
---
 drivers/staging/rtl8192e/rtllib.h| 1 +
 drivers/staging/rtl8192e/rtllib_tx.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 3c8b708..9ee0896 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -47,6 +47,7 @@
 #define MAX_PRECMD_CNT 16
 #define MAX_RFDEPENDCMD_CNT 16
 #define MAX_POSTCMD_CNT 16
+#define IEEE80211_MAX_SEQ 4096
 
 #ifndef WIRELESS_SPY
 #define WIRELESS_SPY
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 3b15963..6325ceb 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -326,7 +326,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device 
*ieee,
goto FORCED_AGG_SETTING;
} else if (pTxTs->bUsingBa == false) {
if 
(SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum,
-  (pTxTs->TxCurSeq+1)%4096))
+  (pTxTs->TxCurSeq+1)%IEEE80211_MAX_SEQ))
pTxTs->bUsingBa = true;
else
goto FORCED_AGG_SETTING;
@@ -525,7 +525,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct 
sk_buff *skb,
skb->priority, TX_DIR, true))
return 0;
seqnum = pTS->TxCurSeq;
-   pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096;
+   pTS->TxCurSeq = (pTS->TxCurSeq+1)%IEEE80211_MAX_SEQ;
return seqnum;
}
return 0;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192e: replace printk with subsystem debug

2015-05-18 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, May 18, 2015 at 10:29:55PM +0200, Mateusz Kulikowski wrote:
> Hi,
> 
> On 18.05.2015 13:27, Gujulan Elango, Hari Prasath (H.) wrote:
> > replace the printk with netdev subsystem debug infrastructure.
> > 
> > Signed-off-by: Hari Prasath Gujulan Elango 
> > ---
> >  drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
> > b/drivers/staging/rtl8192e/rtllib_rx.c
> > index fe3e7e12..f6e3f83 100644
> > --- a/drivers/staging/rtl8192e/rtllib_rx.c
> > +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> > @@ -344,7 +344,7 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device 
> > *ieee, struct sk_buff *skb,
> > res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
> > atomic_dec(&crypt->refcnt);
> > if (res < 0) {
> > -   printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed 
> > (SA= %pM keyidx=%d)\n",
> > +   netdev_dbg(ieee->dev, "%s: MSDU decryption/MIC verification 
> > failed (SA= %pM keyidx=%d)\n",
> >ieee->dev->name, hdr->addr2, keyidx);
> > return -1;
> > }
> > 
> I posted it already in one of my patches (v2, v3 - now I'm working on v4 with 
> this change as well):
> https://lkml.org/lkml/2015/5/9/200 <- v3
> https://lkml.org/lkml/2015/4/13 <- v2
> 
> Regards,
> Mateusz

Ok i checked the git log to see if this change has already gone in.I
found a comment stating that printk with KERN_DEBUG shall be left as it
is.So i sent a patch for this.Ok lets drop this duplicate patch then :)

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


[PATCH] staging: sm750fb: replace kzalloc with devm_kzalloc

2015-05-26 Thread Gujulan Elango, Hari Prasath (H.)
replace kzalloc with devm_kzalloc thereby removing the corresponding
kfree.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/sm750fb/sm750.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3c7ea95..bb6beb0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1112,7 +1112,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 * we use this marcro as the same */
spec_offset = offsetof(struct sm750_share, share);
 
-   spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
+   spec_share = devm_kzalloc(&pdev->dev, sizeof(*spec_share), GFP_KERNEL);
if (!spec_share) {
pr_err("Could not allocate memory for share.\n");
goto err_share;
@@ -1244,7 +1244,6 @@ err_info0_set:
framebuffer_release(info[0]);
 err_info0_alloc:
 err_map:
-   kfree(spec_share);
 err_share:
 err_enable:
return -ENODEV;
@@ -1285,7 +1284,6 @@ static void __exit lynxfb_pci_remove(struct pci_dev *pdev)
iounmap(share->pvMem);
spec_share = container_of(share, struct sm750_share, share);
kfree(g_settings);
-   kfree(spec_share);
pci_set_drvdata(pdev, NULL);
 }
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: sm750fb: Add missing Kconfig dependency

2015-05-26 Thread Gujulan Elango, Hari Prasath (H.)
The Kconfig dependency for this driver should include the kernel
configuration FB_MODE_HELPERS which defines the vesa_modes
structure.Without this dependency,the driver build generates a linker 
error if build as a built-in driver.It gets build find as a module,but
may cause issue during runtime.

Signed-off-by: Hari Prasath Gujulan Elango 
---
 drivers/staging/sm750fb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index c40d088..bfb3429 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,6 +1,6 @@
 config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
-   depends on FB && PCI
+   depends on FB && PCI && FB_MODE_HELPERS
help
  Frame buffer driver for the Silicon Motion SM750 chip
  with 2D accelearion and dual head support.
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: sm750fb: replace kzalloc with devm_kzalloc

2015-05-26 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, May 27, 2015 at 11:10:34AM +0530, Sudip Mukherjee wrote:
> On Tue, May 26, 2015 at 10:04:44AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > replace kzalloc with devm_kzalloc thereby removing the corresponding
> > kfree.
> your patch is corrupt and can not be applied.
> But even then, can this be called as code improvement?
> 
> regards
> sudip
> > 
> > Signed-off-by: Hari Prasath Gujulan Elango 
> > ---

May i know whats wrong with the patch ? I am able to apply it without
any issue.Yes I agree this is a trivial patch.The memory cleanup is 
simpler.I have seen some patches in the past like this.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: sm750fb: Add missing Kconfig dependency

2015-05-26 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, May 27, 2015 at 11:32:11AM +0530, Sudip Mukherjee wrote:
> On Tue, May 26, 2015 at 02:50:30PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > The Kconfig dependency for this driver should include the kernel
> > configuration FB_MODE_HELPERS which defines the vesa_modes
> > structure.Without this dependency,the driver build generates a linker 
> > error if build as a built-in driver.
> 
> thanks, we all missed this. But while building it also showed:
> undefined reference to cfb_fillrect, cfb_copyarea, cfb_imageblit.
> And having a look at all the other framebuffer drivers the correct fix
> should be:
> 

I got only one build error which was undefined reference to
`vesa_modes'.How come I didn't get these other undefined references ?
May be I am missing something ?

> diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
> index c40d088..ccebc25 100644
> --- a/drivers/staging/sm750fb/Kconfig
> +++ b/drivers/staging/sm750fb/Kconfig
> @@ -1,6 +1,10 @@
>  config FB_SM750
>   tristate "Silicon Motion SM750 framebuffer support"
>   depends on FB && PCI
> + select FB_MODE_HELPERS
> + select FB_CFB_FILLRECT
> + select FB_CFB_COPYAREA
> + select FB_CFB_IMAGEBLIT
>   help
> Frame buffer driver for the Silicon Motion SM750 chip
> with 2D accelearion and dual head support.
> 
> 
> > 
> > Signed-off-by: Hari Prasath Gujulan Elango 
> And your Signed-off-by and the email header From: name is not matching.
> please send a new patch with these changes.
> 
> regards
> sudip

I changed it in my local gitconfig file. From now on it should be
correct as you expect.I will send v2 patch after my confusion is
clarified.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: sm750fb: replace kzalloc with devm_kzalloc

2015-05-27 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, May 27, 2015 at 01:07:17PM +0530, Sudip Mukherjee wrote:
> On Wed, May 27, 2015 at 10:28:54AM +0300, Dan Carpenter wrote:
> > On Wed, May 27, 2015 at 11:10:34AM +0530, Sudip Mukherjee wrote:
> > > On Tue, May 26, 2015 at 10:04:44AM +, Gujulan Elango, Hari Prasath 
> > > (H.) wrote:
> > > > replace kzalloc with devm_kzalloc thereby removing the corresponding
> > > > kfree.
> > > your patch is corrupt and can not be applied.
> > > But even then, can this be called as code improvement?
> > 
> > It applies fine here.  This seems like a nice patch.
> But my checkpatch is still giving errors about corrupt patch :(

Before I send any patch,I ensure to run checkpatch.pl on the patch and
this patch is no exception. It didn't give me any errors or
warnings.Running checkpatch.pl on the modified file does generate some
warnings and errors but none of them related to the changes I did.

warm regards
Hari Prasath

> 
> regards
> sudip
> 
> 
> > 
> > regards,
> > dan carpenter
> > 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: sm750fb: Add missing Kconfig dependency

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
The sm750fb driver has few Framebuffer configuration dependencies that
need to be selected in order to get compiled successfully.

Signed-off-by: Gujulan Elango Hari Prasath 
---
v2:Addressed the review comments by Sudhip Mukherjee as I had
missed out a few other dependencies for this driver in my previous
version of the patch.
---
 drivers/staging/sm750fb/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index c40d088..59d7c52 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,6 +1,10 @@
 config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
depends on FB && PCI
+   select FB_MODE_HELPERS
+select FB_CFB_FILLRECT
+select FB_CFB_COPYAREA
+select FB_CFB_IMAGEBLIT
help
  Frame buffer driver for the Silicon Motion SM750 chip
  with 2D accelearion and dual head support.
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: sm750fb: Add missing Kconfig dependency

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
The sm750fb driver has few Framebuffer configuration dependencies that
need to be selected in order to get compiled successfully.

Signed-off-by: Gujulan Elango Hari Prasath 
---
v3: Fix alignment issues addressed by Dan Carpenter.

v2:Addressed the review comments by Sudhip Mukherjee as I had
missed out a few other dependencies for this driver in my previous
version of the patch.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/sm750fb/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index c40d088..ccebc25 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,6 +1,10 @@
 config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
depends on FB && PCI
+   select FB_MODE_HELPERS
+   select FB_CFB_FILLRECT
+   select FB_CFB_COPYAREA
+   select FB_CFB_IMAGEBLIT
help
  Frame buffer driver for the Silicon Motion SM750 chip
  with 2D accelearion and dual head support.
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: sm750fb: Add missing Kconfig dependency

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 11:45:28AM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 08:40:41AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > diff --git a/drivers/staging/sm750fb/Kconfig 
> > b/drivers/staging/sm750fb/Kconfig
> > index c40d088..59d7c52 100644
> > --- a/drivers/staging/sm750fb/Kconfig
> > +++ b/drivers/staging/sm750fb/Kconfig
> > @@ -1,6 +1,10 @@
> >  config FB_SM750
> > tristate "Silicon Motion SM750 framebuffer support"
> > depends on FB && PCI
> > +   select FB_MODE_HELPERS
> > +select FB_CFB_FILLRECT
> > +select FB_CFB_COPYAREA
> > +select FB_CFB_IMAGEBLIT
> 
> These don't line up correctly.  Use tabs instead of spaces.
> 
> regards,
> dan carpenter
> 

I resend v3 but it seems there is a duplicate signature.Please dicard it
as well.I am sending v4 now.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: sm750fb: Add missing Kconfig dependency

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
The sm750fb driver has few Framebuffer configuration dependencies that
need to be selected in order to get compiled successfully

Signed-off-by: Gujulan Elango Hari Prasath 
---
v3: Fix alignment issues addressed by Dan Carpenter.

v2:Addressed the review comments by Sudhip Mukherjee as I had
missed out a few other dependencies for this driver in my previous
version of the patch.
---
 drivers/staging/sm750fb/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index c40d088..ccebc25 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,6 +1,10 @@
 config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
depends on FB && PCI
+   select FB_MODE_HELPERS
+   select FB_CFB_FILLRECT
+   select FB_CFB_COPYAREA
+   select FB_CFB_IMAGEBLIT
help
  Frame buffer driver for the Silicon Motion SM750 chip
  with 2D accelearion and dual head support.
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: sm750fb: Add missing Kconfig dependency

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 11:57:54AM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 08:54:12AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > 
> > I resend v3 but it seems there is a duplicate signature.Please dicard it
> > as well.I am sending v4 now.
> 
> v3 is fine.  The duplicate sign-off is below the cut off line --- so it
> will be removed automatically.
> 
> regards,
> dan carpenter
> 

checkpatch warned about it & so I resend it.But it should have been send
as v4,I send it as v3.I screwed up a bit.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
remove redundant code in this function by introducing a new retval
variable.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index a3a10f9..cc0445c 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -290,6 +290,7 @@ static int gs_fpgaboot(void)
 {
int err;
struct fpgaimage*fimage;
+   int retval = 0;
 
fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL);
if (!fimage)
@@ -298,44 +299,41 @@ static int gs_fpgaboot(void)
err = gs_load_image(fimage, file);
if (err) {
pr_err("gs_load_image error\n");
+   retval = -1;
goto err_out1;
}
 
err = gs_read_image(fimage);
if (err) {
pr_err("gs_read_image error\n");
+   retval = -1;
goto err_out2;
}
 
err = gs_set_download_method(fimage);
if (err) {
pr_err("gs_set_download_method error\n");
+   retval = -1;
goto err_out2;
}
 
err = gs_download_image(fimage, bus_2byte);
if (err) {
pr_err("gs_download_image error\n");
+   retval = -1;
goto err_out2;
}
 
+err_out2:
err = gs_release_image(fimage);
if (err) {
+   retval = -1;
pr_err("gs_release_image error\n");
-   goto err_out1;
}
-
-   kfree(fimage);
-   return 0;
-
-err_out2:
-   err = gs_release_image(fimage);
-   if (err)
-   pr_err("gs_release_image error\n");
 err_out1:
kfree(fimage);
 
-   return -1;
+   return retval;
 
 }
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 01:08:36PM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 09:38:23AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > remove redundant code in this function by introducing a new retval
> > variable.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath 
> 
> No the original code is quite bad but this patch makes it worse.
> 
> gs_release_image() can't fail, and it should be a void function.
> 

Dan, I didn't note that the gs_release_image() always returns success.

> > ---
> >  drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 18 --
> >  1 file changed, 8 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
> > b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > index a3a10f9..cc0445c 100644
> > --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > @@ -290,6 +290,7 @@ static int gs_fpgaboot(void)
> >  {
> > int err;
> > struct fpgaimage*fimage;
> > +   int retval = 0;
> >  
> > fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL);
> > if (!fimage)
> > @@ -298,44 +299,41 @@ static int gs_fpgaboot(void)
> > err = gs_load_image(fimage, file);
> > if (err) {
> 
>   goto free_fimage;
> 

I guess we should retain the debug message here and in the other cases
below.

> > pr_err("gs_load_image error\n");
> > +   retval = -1;
> > goto err_out1;
> > }
> >  
> > err = gs_read_image(fimage);
> > if (err) {
> 
> 
>   goto release_image;
> 
> > pr_err("gs_read_image error\n");
> > +   retval = -1;
> > goto err_out2;
> > }
> >  
> > err = gs_set_download_method(fimage);
> > if (err) {
> 
>   goto release_image;
> 
> > pr_err("gs_set_download_method error\n");
> > +   retval = -1;
> >     goto err_out2;
> > }
> >  
> > err = gs_download_image(fimage, bus_2byte);
> 
> 
> release_image:
>   gs_release_image(fimage);
> free_fimage:
>   kfree(fimage);
> 
>   return err;
> 
> regards,
> dan carpenter

I will send a v2 with these changes if its fine or we could just leave
it as it is.

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


[PATCHv2] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
remove redundant code in this function.remove return value check for
function that always return success.

Signed-off-by: Gujulan Elango Hari Prasath 
---
v2:address review comments from Dan.Remove return value check
for the function gs_release_image as it always returns success and
rearrange the code accordingly.Also delete debug messages.
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 44 ---
 1 file changed, 11 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index a3a10f9..a792c1a 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -288,7 +288,7 @@ static void finish_driver(void)
 
 static int gs_fpgaboot(void)
 {
-   int err;
+   int err = 0;
struct fpgaimage*fimage;
 
fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL);
@@ -296,47 +296,25 @@ static int gs_fpgaboot(void)
return -ENOMEM;
 
err = gs_load_image(fimage, file);
-   if (err) {
-   pr_err("gs_load_image error\n");
-   goto err_out1;
-   }
+   if (err)
+   goto free_image;
 
err = gs_read_image(fimage);
-   if (err) {
-   pr_err("gs_read_image error\n");
-   goto err_out2;
-   }
+   if (err)
+   goto release_image;
 
err = gs_set_download_method(fimage);
-   if (err) {
-   pr_err("gs_set_download_method error\n");
-   goto err_out2;
-   }
+   if (err)
+   goto release_image;
 
err = gs_download_image(fimage, bus_2byte);
-   if (err) {
-   pr_err("gs_download_image error\n");
-   goto err_out2;
-   }
-
-   err = gs_release_image(fimage);
-   if (err) {
-   pr_err("gs_release_image error\n");
-   goto err_out1;
-   }
-
-   kfree(fimage);
-   return 0;
 
-err_out2:
-   err = gs_release_image(fimage);
-   if (err)
-   pr_err("gs_release_image error\n");
-err_out1:
+release_image:
+   gs_release_image(fimage);
+free_image:
kfree(fimage);
 
-   return -1;
-
+   return err;
 }
 
 static int __init gs_fpgaboot_init(void)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 02:07:36PM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 10:51:38AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > remove redundant code in this function.remove return value check for
> > function that always return success.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath 
> > ---
> > v2:address review comments from Dan.Remove return value check
> > for the function gs_release_image as it always returns success and
> > rearrange the code accordingly.Also delete debug messages.
> > ---
> >  drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 44 
> > ---
> >  1 file changed, 11 insertions(+), 33 deletions(-)
> > 
> > diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
> > b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > index a3a10f9..a792c1a 100644
> > --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > @@ -288,7 +288,7 @@ static void finish_driver(void)
> >  
> >  static int gs_fpgaboot(void)
> >  {
> > -   int err;
> > +   int err = 0;
> 
> Don't do this.  It's just turns off GCC's warning about uninitialized
> variables.
> 
> regards,
> dan carpenter
> 

The reason i did that was if the function doesn't hit any error
condition, then it needs to return 0. If the err variable is not
initialized to 0,I assume that it can take any value.Please correct me
if i am wrong. I removed the retval variable and just used the 'err'
variable itself.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 02:37:43PM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 11:32:21AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > The reason i did that was if the function doesn't hit any error
> > condition, then it needs to return 0. If the err variable is not
> > initialized to 0,I assume that it can take any value.Please correct me
> > if i am wrong.
> 
> You are wrong.  We always set err.
> 
> regards,
> dan carpenter
> 

Ok I got it. I will send v3 of this patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: gs_fpgaboot: remove redundant code

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
remove redundant code in this function.remove return value check for
function that always return success

Signed-off-by: Gujulan Elango Hari Prasath 
---
v3:Remove initialization of the 'err' variable.

v2:address review comments from Dan.Remove return value check
for the function gs_release_image as it always returns success and
rearrange the code accordingly.Also delete debug messages.
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 42 ---
 1 file changed, 10 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index a3a10f9..7d05510 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -296,47 +296,25 @@ static int gs_fpgaboot(void)
return -ENOMEM;
 
err = gs_load_image(fimage, file);
-   if (err) {
-   pr_err("gs_load_image error\n");
-   goto err_out1;
-   }
+   if (err)
+   goto free_image;
 
err = gs_read_image(fimage);
-   if (err) {
-   pr_err("gs_read_image error\n");
-   goto err_out2;
-   }
+   if (err)
+   goto release_image;
 
err = gs_set_download_method(fimage);
-   if (err) {
-   pr_err("gs_set_download_method error\n");
-   goto err_out2;
-   }
+   if (err)
+   goto release_image;
 
err = gs_download_image(fimage, bus_2byte);
-   if (err) {
-   pr_err("gs_download_image error\n");
-   goto err_out2;
-   }
-
-   err = gs_release_image(fimage);
-   if (err) {
-   pr_err("gs_release_image error\n");
-   goto err_out1;
-   }
-
-   kfree(fimage);
-   return 0;
 
-err_out2:
-   err = gs_release_image(fimage);
-   if (err)
-   pr_err("gs_release_image error\n");
-err_out1:
+release_image:
+   gs_release_image(fimage);
+free_image:
kfree(fimage);
 
-   return -1;
-
+   return err;
 }
 
 static int __init gs_fpgaboot_init(void)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: check return value before using pointer

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
Check the return value of kcalloc first and then use the pointer.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/dgnc/dgnc_driver.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 805dc61..935e297 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -385,13 +385,14 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
/* make a temporary message buffer for the boot messages */
brd->msgbuf_head = kcalloc(8192, sizeof(u8), GFP_KERNEL);
-   brd->msgbuf = brd->msgbuf_head;
-
-   if (!brd->msgbuf) {
+   if (!brd->msgbuf_head) {
kfree(brd);
return -ENOMEM;
}
 
+   brd->msgbuf = brd->msgbuf_head;
+
+
/* store the info for the board we've found */
brd->magic = DGNC_BOARD_MAGIC;
brd->boardnum = dgnc_NumBoards;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: check return value of kzalloc

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
Check the return value of kzalloc & return error if it fails.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/dgnc/dgnc_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 935e297..2c729be 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -589,6 +589,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 * context, and there are no locks held.
 */
brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
+   if (!brd->flipbuf)
+   return -ENOMEM;
 
wake_up_interruptible(&brd->state_wait);
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgnc: check return value of kzalloc

2015-05-28 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 04:32:30PM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 01:23:57PM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > Check the return value of kzalloc & return error if it fails.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath 
> > ---
> >  drivers/staging/dgnc/dgnc_driver.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/staging/dgnc/dgnc_driver.c 
> > b/drivers/staging/dgnc/dgnc_driver.c
> > index 935e297..2c729be 100644
> > --- a/drivers/staging/dgnc/dgnc_driver.c
> > +++ b/drivers/staging/dgnc/dgnc_driver.c
> > @@ -589,6 +589,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int 
> > id)
> >  * context, and there are no locks held.
> >  */
> > brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
> > +   if (!brd->flipbuf)
> > +   return -ENOMEM;
> 
> Just delete flipbuf and all the references to it.
> 
> regards,
> dan carpenter
> 

ok I checked it out before.flipbuf is not used anywhere in this driver.I
will go ahead and delete all references to it and send out a new
patch.Let us discard this patch as it makes no sense.

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


[PATCH] staging: dgnc: delete all references to 'flipbuf'

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
This patch deletes all references to 'flipbuf'.Memory is allocated and
freed but never used anywhere in the driver.Also deleted an ununsed
Macro defined in the header file.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/dgnc/dgnc_driver.c | 9 -
 drivers/staging/dgnc/dgnc_driver.h | 3 ---
 2 files changed, 12 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index 935e297..7e4091f 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -355,7 +355,6 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
}
}
 
-   kfree(brd->flipbuf);
 
dgnc_Board[brd->boardnum] = NULL;
 
@@ -582,14 +581,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
brd->msgbuf_head = NULL;
spin_unlock_irqrestore(&dgnc_global_lock, flags);
 
-   /*
-* allocate flip buffer for board.
-*
-* Okay to malloc with GFP_KERNEL, we are not at interrupt
-* context, and there are no locks held.
-*/
-   brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
-
wake_up_interruptible(&brd->state_wait);
 
return 0;
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index f77fed5..3dee9f3 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -212,8 +212,6 @@ struct dgnc_board {
 
uintTtyRefCnt;
 
-   char*flipbuf;   /* Our flip buffer, alloced if board is 
found */
-
u16 dpatype;/* The board "type", as defined by DPA 
*/
u16 dpastatus;  /* The board "status", as defined by 
DPA */
 
@@ -288,7 +286,6 @@ struct un_t {
 #define CH_TX_FIFO_LWM  0x0800 /* TX Fifo is below Low Water   */
 #define CH_BREAK_SENDING 0x1000/* Break is being sent  
*/
 #define CH_LOOPBACK 0x2000 /* Channel is in lookback mode  */
-#define CH_FLIPBUF_IN_USE 0x4000   /* Channel's flipbuf is in use  */
 #define CH_BAUD0   0x08000 /* Used for checking B0 transitions */
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gs_fpgaboot: remove redundant code

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 09:39:14AM -0700, insop.s...@gainspeed.com wrote:
> On Thu, May 28, 2015 at 01:08:36PM +0300, Dan Carpenter wrote:
> > On Thu, May 28, 2015 at 09:38:23AM +, Gujulan Elango, Hari Prasath (H.) 
> > wrote:
> > > remove redundant code in this function by introducing a new retval
> > > variable.
> > > 
> > > Signed-off-by: Gujulan Elango Hari Prasath 
> > 
> > No the original code is quite bad but this patch makes it worse.
> 
> Please elaborate what was 'quite bad' in the original code?
> 
> Regards,
> ISS
> 

Well,this is a trivial patch.It doesn't solve anything.There was some
redundant code,so i thought of simplifying it. As Dan pointed out, the
gs_release_image() returns success always.So there was no point in
checking its return value.

regards,
Hari Prasath

> > 
> > gs_release_image() can't fail, and it should be a void function.
> > 
> > > ---
> > >  drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 18 --
> > >  1 file changed, 8 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
> > > b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > > index a3a10f9..cc0445c 100644
> > > --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > > +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> > > @@ -290,6 +290,7 @@ static int gs_fpgaboot(void)
> > >  {
> > >   int err;
> > >   struct fpgaimage*fimage;
> > > + int retval = 0;
> > >  
> > >   fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL);
> > >   if (!fimage)
> > > @@ -298,44 +299,41 @@ static int gs_fpgaboot(void)
> > >   err = gs_load_image(fimage, file);
> > >   if (err) {
> > 
> > goto free_fimage;
> > 
> > >   pr_err("gs_load_image error\n");
> > > + retval = -1;
> > >   goto err_out1;
> > >   }
> > >  
> > >   err = gs_read_image(fimage);
> > >   if (err) {
> > 
> > 
> > goto release_image;
> > 
> > >   pr_err("gs_read_image error\n");
> > > + retval = -1;
> > >   goto err_out2;
> > >   }
> > >  
> > >   err = gs_set_download_method(fimage);
> > >   if (err) {
> > 
> > goto release_image;
> > 
> > >   pr_err("gs_set_download_method error\n");
> > > + retval = -1;
> > >   goto err_out2;
> > >   }
> > >  
> > >   err = gs_download_image(fimage, bus_2byte);
> > 
> > 
> > release_image:
> > gs_release_image(fimage);
> > free_fimage:
> > kfree(fimage);
> > 
> > return err;
> > 
> > regards,
> > dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gs_fpgaboot: remove redundant code

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, May 28, 2015 at 12:03:26PM -0700, insop.s...@gainspeed.com wrote:
> On Thu, May 28, 2015 at 09:50:23PM +0300, Dan Carpenter wrote:
> > On Thu, May 28, 2015 at 09:39:14AM -0700, insop.s...@gainspeed.com wrote:
> > > On Thu, May 28, 2015 at 01:08:36PM +0300, Dan Carpenter wrote:
> > > > On Thu, May 28, 2015 at 09:38:23AM +, Gujulan Elango, Hari Prasath 
> > > > (H.) wrote:
> > > > > remove redundant code in this function by introducing a new retval
> > > > > variable.
> > > > > 
> > > > > Signed-off-by: Gujulan Elango Hari Prasath 
> > > > 
> > > > No the original code is quite bad but this patch makes it worse.
> > > 
> > > Please elaborate what was 'quite bad' in the original code?
> > 
> > GW-BASIC labels.
> what do you mean?
> 
> > return -1 instead of proper error codes.
> Okay,
> 
> > poorly thought out error messages.
> which one are you exactly refering?
> I went through all error messages, but cannot find which one(s) you exactly 
> mean.
> 
> > The error handling of gs_release_image() was silly.
> I would say, ""The error handling of gs_release_image() was "unnecessary"""
> instead.
> 
> So your feedback is mostly on error code and error messages
> Thank you for your feedback.
> 
> Regards,
> 
> ISS

I have sent v2 for this patch.Please have a look at it as well and
provide your feedback.

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


[PATCH] staging: dgnc: check return value of kzalloc

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
check return value of kzalloc and return error if it fails.

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/dgnc/dgnc_tty.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index ce4187f..2397c66 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -316,6 +316,8 @@ int dgnc_tty_init(struct dgnc_board *brd)
 * interrupt context, and there are no locks held.
 */
brd->channels[i] = kzalloc(sizeof(*brd->channels[i]), 
GFP_KERNEL);
+   if (!brd->channels[i])
+   return -ENOMEM;
}
}
 
@@ -1126,10 +1128,16 @@ static int dgnc_tty_open(struct tty_struct *tty, struct 
file *file)
 
if (!ch->ch_rqueue)
ch->ch_rqueue = kzalloc(RQUEUESIZE, GFP_KERNEL);
+   if (!ch->ch_rqueue)
+   return -ENOMEM;
if (!ch->ch_equeue)
ch->ch_equeue = kzalloc(EQUEUESIZE, GFP_KERNEL);
+   if (!ch->ch_equeue)
+   return -ENOMEM;
if (!ch->ch_wqueue)
ch->ch_wqueue = kzalloc(WQUEUESIZE, GFP_KERNEL);
+   if (!ch->ch_wqueue)
+   return -ENOMEM;
 
spin_lock_irqsave(&ch->ch_lock, flags);
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: remove unwanted else block

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
Remove the unwanted else block

Signed-off-by: Gujulan Elango Hari Prasath 
---
 drivers/staging/dgnc/dgnc_tty.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 2397c66..ca07b7f 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -899,10 +899,6 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
ch->ch_stops_sent = 0;
ch->ch_bd->bd_ops->send_start_character(ch);
}
-   /* No FLOW */
-   else {
-   /* Nothing needed. */
-   }
}
 }
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgnc: check return value of kzalloc

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
On Fri, May 29, 2015 at 11:54:09AM +0300, Dan Carpenter wrote:
> On Fri, May 29, 2015 at 07:44:11AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > check return value of kzalloc and return error if it fails.
> > 
> 
> There is a problem with your patch.  See if you can spot it.  Also can
> you add to the changelog what are the user visible effects of not
> checking for kzalloc() failure?  Last time with ->flipbuf there were no
> user visible effects.
> 
> Also return -ENOMEM seems like the wrong thing.  Shouldn't we do some
> error handling.  Also you are not working on linux-next?  Some of this
> stuff is done correctly in linux-next.
> 
> regards,
> dan carpenter
> 

Dan,I am working on the staging-testing git tree.I was not aware that
someone has submitted a similar patch which was reviewed by you &
sudip.If a patch to address this has already gone in,why am I not seeing
that change here.Am I missing something ?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgnc: check return value of kzalloc

2015-05-29 Thread Gujulan Elango, Hari Prasath (H.)
On Fri, May 29, 2015 at 01:52:28PM +0300, Dan Carpenter wrote:
> On Fri, May 29, 2015 at 10:06:48AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > On Fri, May 29, 2015 at 11:54:09AM +0300, Dan Carpenter wrote:
> > > On Fri, May 29, 2015 at 07:44:11AM +0000, Gujulan Elango, Hari Prasath 
> > > (H.) wrote:
> > > > check return value of kzalloc and return error if it fails.
> > > > 
> > > 
> > > There is a problem with your patch.  See if you can spot it.  Also can
> > > you add to the changelog what are the user visible effects of not
> > > checking for kzalloc() failure?  Last time with ->flipbuf there were no
> > > user visible effects.
> > > 
> > > Also return -ENOMEM seems like the wrong thing.  Shouldn't we do some
> > > error handling.  Also you are not working on linux-next?  Some of this
> > > stuff is done correctly in linux-next.
> > > 
> > > regards,
> > > dan carpenter
> > > 
> > 
> > Dan,I am working on the staging-testing git tree.I was not aware that
> > someone has submitted a similar patch which was reviewed by you &
> > sudip.If a patch to address this has already gone in,why am I not seeing
> > that change here.Am I missing something ?
> 
> Something is wrong.  You should see:
> 
> commit fa52d96c3ea110acb77e51c856ec0b54606cc17e
> Author: Giedrius Statkevičius 
> Date:   Fri Apr 10 02:42:29 2015 +0300
> 
> staging: dgnc: clean up allocation of ->channels[i]
> 
> 
> regards,
> dan carpenter

Yes Dan I was this commit and the comments.I updated my staging-testing
tree regularly by doing a git pull.But I am not sure how this change
went missing.Anyways this patch should be dropped.
> 
> 
> > ___
> > devel mailing list
> > de...@linuxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv3] staging: sm750fb: Add missing Kconfig dependency

2015-06-01 Thread Gujulan Elango, Hari Prasath (H.)
On Sun, May 31, 2015 at 11:36:09AM +0900, gre...@linuxfoundation.org wrote:
> On Thu, May 28, 2015 at 08:51:06AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > The sm750fb driver has few Framebuffer configuration dependencies that
> > need to be selected in order to get compiled successfully.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath 
> > ---
> > v3: Fix alignment issues addressed by Dan Carpenter.
> > 
> > v2:Addressed the review comments by Sudhip Mukherjee as I had
> > missed out a few other dependencies for this driver in my previous
> > version of the patch.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath 
> 
> 2 signed-off-by lines???

sorry about that Greg,I will send a v4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv4] staging: sm750fb: Add missing Kconfig dependency

2015-06-01 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango 

The sm750fb driver has few Framebuffer configuration dependencies that
need to be selected in order to get compiled successfully

Signed-off-by: Hari Prasath Gujulan Elango 
---
v4: Final version with From name & signed off by matching

v3: Fix alignment issues addressed by Dan Carpenter.

v2:Addressed the review comments by Sudhip Mukherjee as I had
missed out a few other dependencies for this driver in my previous
version of the patch.
---
 drivers/staging/sm750fb/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index c40d088..ccebc25 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,6 +1,10 @@
 config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
depends on FB && PCI
+   select FB_MODE_HELPERS
+   select FB_CFB_FILLRECT
+   select FB_CFB_COPYAREA
+   select FB_CFB_IMAGEBLIT
help
  Frame buffer driver for the Silicon Motion SM750 chip
  with 2D accelearion and dual head support.
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rts5208: remove variable and check directly

2015-06-01 Thread Gujulan Elango, Hari Prasath (H.)
On Sun, May 31, 2015 at 11:34:23AM +0900, gre...@linuxfoundation.org wrote:
> On Fri, May 15, 2015 at 11:33:53AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > This trivial patch removes temporary variable to check return value of
> > a function and checks return value directly.
> > 
> > Signed-off-by: Hari Prasath Gujulan Elango 
> 
> Same name problem here, and on all of your other patches you sent in.
> Please fix up and resend all of them, I've now dropped them from my
> queue.
> 
> thanks,
> 
> greg k-h

Please excuse me for the mess.Our company's e-mail display's the last
name and first name in this fashion and theres nothing much we could do
about it.Hence we have decided to use the additional 'From' field
suggested by you in the body of the commit message.I will send a new
version of the patches which has this issue.

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


[PATCHv2] staging: rts5208: remove variable and check directly

2015-06-01 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango 

This trivial patch removes temporary variable to check return value of
a function and checks return value directly.

Signed-off-by: Hari Prasath Gujulan Elango 
---
v2:signed off by and From names were not matching in previous
version as pointed out by Greg.
---
 drivers/staging/rts5208/ms.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index ee818b0..ab6e8bc 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -52,7 +52,6 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 
trans_mode,
u8 tpc, u8 cnt, u8 cfg)
 {
struct ms_info *ms_card = &(chip->ms_card);
-   int retval;
u8 *ptr;
 
dev_dbg(rtsx_dev(chip), "%s: tpc = 0x%x\n", __func__, tpc);
@@ -72,8 +71,7 @@ static int ms_transfer_tpc(struct rtsx_chip *chip, u8 
trans_mode,
 
rtsx_add_cmd(chip, READ_REG_CMD, MS_TRANS_CFG, 0, 0);
 
-   retval = rtsx_send_cmd(chip, MS_CARD, 5000);
-   if (retval < 0) {
+   if (rtsx_send_cmd(chip, MS_CARD, 5000) < 0) {
rtsx_clear_ms_error(chip);
ms_set_err_code(chip, MS_TO_ERROR);
rtsx_trace(chip);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   3   >