Re: [PATCH] Remove explicit return type cast

2017-08-08 Thread hari prasath
On 3 August 2017 at 18:53, Dan Carpenter <dan.carpen...@oracle.com> wrote:
> On Thu, Aug 03, 2017 at 06:23:54PM +0530, hari prasath wrote:
>> On 3 August 2017 at 11:52, kbuild test robot <l...@intel.com> 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


Re: [PATCH] Remove explicit return type cast

2017-08-03 Thread hari prasath
On 3 August 2017 at 11:52, kbuild test robot <l...@intel.com> 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(>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(>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(>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


[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 <geharipras...@gmail.com>
---
 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(>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(>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


[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 <geharipras...@gmail.com>
---
 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


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 <l...@metafoo.de> 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 <geharipras...@gmail.com>
>> ---
>>   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 = >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 = >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 = >chip_info->channel;
>>
>



-- 
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 <geharipras...@gmail.com>
---
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 = >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 = >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 = >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 <geharipras...@gmail.com> wrote:
> Adding missing indio_dev->dev.of_node references to allow iio consumers
> to access the device channels.
>
> Signed-off-by: Hari Prasath <geharipras...@gmail.com>
> ---
> 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 = >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 = >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 = >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


[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 <geharipras...@gmail.com>
---
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 = >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 = >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 = >chip_info->channel;
-- 
2.10.0.GIT

___
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 <hguju...@visteon.com>

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

Signed-off-by: Hari Prasath <geharipras...@gmail.com>
---
 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 = >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 = >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 = >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: atomisp: use kstrdup to replace kmalloc and memcpy

2017-07-10 Thread hari prasath
On 10 July 2017 at 01:22, Sakari Ailus <sakari.ai...@iki.fi> wrote:
> On Sun, Jul 09, 2017 at 05:56:15PM +0530, hari prasath wrote:
>> On 8 July 2017 at 16:31, Sakari Ailus <sakari.ai...@iki.fi> 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 <geharipras...@gmail.com>
>> >> ---
>> >>  .../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


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

2017-07-10 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 <geharipras...@gmail.com>
---
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 8 July 2017 at 16:31, Sakari Ailus <sakari.ai...@iki.fi> 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 <geharipras...@gmail.com>
>> ---
>>  .../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


[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 <geharipras...@gmail.com>
---
 .../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] staging: atomisp: replace kmalloc & memcpy with kmemdup

2017-07-07 Thread hari prasath
On 07-Jul-2017 5:25 PM, "Alan Cox" <a...@linux.intel.com> 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] 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 <geharipras...@gmail.com>
---
 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


[PATCHv2] staging: rtl8192e: prefer using eth_broadcast_addr()

2016-02-07 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Prefer using the eth_broadcast_addr() instead of memset to broadcast
address 0xFF to the array.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v2: From email address was missing as pointed by Greg.
---
 drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index d0fedb0..2a57640 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -355,9 +355,9 @@ static inline struct sk_buff *rtllib_probe_req(struct 
rtllib_device *ieee)
req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
req->header.duration_id = 0;
 
-   memset(req->header.addr1, 0xff, ETH_ALEN);
+   eth_broadcast_addr(req->header.addr1);
ether_addr_copy(req->header.addr2, ieee->dev->dev_addr);
-   memset(req->header.addr3, 0xff, ETH_ALEN);
+   eth_broadcast_addr(req->header.addr3);
 
tag = (u8 *) skb_put(skb, len + 2 + rate_len);
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout

2016-02-07 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

This patch makes use of wait_event_interruptible_timeout to achieve
timeout functionality.This is a TODO mentiond in the comment which is also
removed.It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v2: Patch introduced checkpatch warning on the 80 character
limit & it was pointed out by Greg.Hence resubmitting
---
 drivers/staging/dgnc/dgnc_neo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 39c76e7..ee3155b 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1306,10 +1306,10 @@ static int neo_drain(struct tty_struct *tty, uint 
seconds)
/*
 * Go to sleep waiting for the tty layer to wake me back up when
 * the empty flag goes away.
-*
-* NOTE: TODO: Do something with time passed in.
 */
-   rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & 
UN_EMPTY) == 0));
+   rc = wait_event_interruptible_timeout(un->un_flags_wait,
+ ((un->un_flags & UN_EMPTY) == 0),
+ msecs_to_jiffies(seconds * 1000));
 
/* If ret is non-zero, user ctrl-c'ed us */
return rc;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: rdma: use setup_timer() api

2016-02-04 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Replace the timer API's to initialize a timer & then assign the callback
function by the setup_timer() API.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v2: Unwanted text present in the commit comments
sections.Removed them
---
 drivers/staging/rdma/ehca/ehca_main.c | 3 +--
 drivers/staging/rdma/hfi1/verbs.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rdma/ehca/ehca_main.c 
b/drivers/staging/rdma/ehca/ehca_main.c
index 832f22f..e545712 100644
--- a/drivers/staging/rdma/ehca/ehca_main.c
+++ b/drivers/staging/rdma/ehca/ehca_main.c
@@ -1073,8 +1073,7 @@ static int __init ehca_module_init(void)
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
} else {
-   init_timer(_eqs_timer);
-   poll_eqs_timer.function = ehca_poll_eqs;
+   setup_timer(_eqs_timer, ehca_poll_eqs, 0UL);
poll_eqs_timer.expires = jiffies + HZ;
add_timer(_eqs_timer);
}
diff --git a/drivers/staging/rdma/hfi1/verbs.c 
b/drivers/staging/rdma/hfi1/verbs.c
index 09b8d41..769388d 100644
--- a/drivers/staging/rdma/hfi1/verbs.c
+++ b/drivers/staging/rdma/hfi1/verbs.c
@@ -1926,8 +1926,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
spin_lock_init(>n_qps_lock);
spin_lock_init(>n_srqs_lock);
spin_lock_init(>n_mcast_grps_lock);
-   init_timer(>mem_timer);
-   dev->mem_timer.function = mem_timer;
+   setup_timer(>mem_timer, mem_timer, 0UL);
dev->mem_timer.data = (unsigned long) dev;
 
/*
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rdma: use setup_timer() api

2016-02-04 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Date: Thu, 4 Feb 2016 18:46:31 +0530
Replace the timer API's to initialize a timer & then assign the callback
function by the setup_timer() API.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/rdma/ehca/ehca_main.c | 3 +--
 drivers/staging/rdma/hfi1/verbs.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rdma/ehca/ehca_main.c 
b/drivers/staging/rdma/ehca/ehca_main.c
index 832f22f..e545712 100644
--- a/drivers/staging/rdma/ehca/ehca_main.c
+++ b/drivers/staging/rdma/ehca/ehca_main.c
@@ -1073,8 +1073,7 @@ static int __init ehca_module_init(void)
ehca_gen_err("WARNING!!!");
ehca_gen_err("It is possible to lose interrupts.");
} else {
-   init_timer(_eqs_timer);
-   poll_eqs_timer.function = ehca_poll_eqs;
+   setup_timer(_eqs_timer, ehca_poll_eqs, 0UL);
poll_eqs_timer.expires = jiffies + HZ;
add_timer(_eqs_timer);
}
diff --git a/drivers/staging/rdma/hfi1/verbs.c 
b/drivers/staging/rdma/hfi1/verbs.c
index 09b8d41..769388d 100644
--- a/drivers/staging/rdma/hfi1/verbs.c
+++ b/drivers/staging/rdma/hfi1/verbs.c
@@ -1926,8 +1926,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
spin_lock_init(>n_qps_lock);
spin_lock_init(>n_srqs_lock);
spin_lock_init(>n_mcast_grps_lock);
-   init_timer(>mem_timer);
-   dev->mem_timer.function = mem_timer;
+   setup_timer(>mem_timer, mem_timer, 0UL);
dev->mem_timer.data = (unsigned long) dev;
 
/*
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: android: ion: use the manged version of DMA memory allocation

2016-02-02 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Use the managed version of the dma_alloc_coherent() i.e. the
dmam_alloc_coherent() & accordingly cleanup the error handling
part.Also,remove the references to dma_free_coherent.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/android/ion/ion_cma_heap.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index a3446da..88375d9 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -61,7 +61,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
if (!info)
return ION_CMA_ALLOCATE_FAILED;
 
-   info->cpu_addr = dma_alloc_coherent(dev, len, &(info->handle),
+   info->cpu_addr = dmam_alloc_coherent(dev, len, &(info->handle),
GFP_HIGHUSER | __GFP_ZERO);
 
if (!info->cpu_addr) {
@@ -71,7 +71,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
 
info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
if (!info->table)
-   goto free_mem;
+   goto err;
 
if (dma_get_sgtable(dev, info->table, info->cpu_addr, info->handle,
len))
@@ -83,8 +83,6 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
 
 free_table:
kfree(info->table);
-free_mem:
-   dma_free_coherent(dev, len, info->cpu_addr, info->handle);
 err:
kfree(info);
return ION_CMA_ALLOCATE_FAILED;
@@ -96,9 +94,6 @@ static void ion_cma_free(struct ion_buffer *buffer)
struct device *dev = cma_heap->dev;
struct ion_cma_buffer_info *info = buffer->priv_virt;
 
-   dev_dbg(dev, "Release buffer %p\n", buffer);
-   /* release memory */
-   dma_free_coherent(dev, buffer->size, info->cpu_addr, info->handle);
/* release sg table */
sg_free_table(info->table);
kfree(info->table);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: android: ion: use the manged version of DMA memory allocation

2016-02-02 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Use the managed version of the dma_alloc_coherent() i.e. the
dmam_alloc_coherent() & accordingly cleanup the error handling
part.Also,remove the references to dma_free_coherent

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v2:kbuild test robot reported warnings on ununsed
   variables.Those warnings are fixed.
---
 drivers/staging/android/ion/ion_cma_heap.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index a3446da..8cd720b 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -61,7 +61,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
if (!info)
return ION_CMA_ALLOCATE_FAILED;
 
-   info->cpu_addr = dma_alloc_coherent(dev, len, &(info->handle),
+   info->cpu_addr = dmam_alloc_coherent(dev, len, &(info->handle),
GFP_HIGHUSER | __GFP_ZERO);
 
if (!info->cpu_addr) {
@@ -71,7 +71,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
 
info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
if (!info->table)
-   goto free_mem;
+   goto err;
 
if (dma_get_sgtable(dev, info->table, info->cpu_addr, info->handle,
len))
@@ -83,8 +83,6 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
 
 free_table:
kfree(info->table);
-free_mem:
-   dma_free_coherent(dev, len, info->cpu_addr, info->handle);
 err:
kfree(info);
return ION_CMA_ALLOCATE_FAILED;
@@ -92,13 +90,8 @@ err:
 
 static void ion_cma_free(struct ion_buffer *buffer)
 {
-   struct ion_cma_heap *cma_heap = to_cma_heap(buffer->heap);
-   struct device *dev = cma_heap->dev;
struct ion_cma_buffer_info *info = buffer->priv_virt;
 
-   dev_dbg(dev, "Release buffer %p\n", buffer);
-   /* release memory */
-   dma_free_coherent(dev, buffer->size, info->cpu_addr, info->handle);
/* release sg table */
sg_free_table(info->table);
kfree(info->table);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: iio: replace clk_get() with devm_clk_get()

2016-02-02 Thread Gujulan Elango, Hari Prasath (H.)
This patch replaces the clk_get() with devm_clk_get().Accordingly,modified
the error paths,rename error labels and removed clk_put() in probe() &
remove functions.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v3: Rename error path labels to suite modified code as reviewd
by Matt Ranostay.
Remove clk_put() from the driver remove method as pointed by
Jonathan Cameron.

v2: From email address was missing as pointed by Dan Carpenter.
---
 drivers/staging/iio/adc/spear_adc.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/iio/adc/spear_adc.c 
b/drivers/staging/iio/adc/spear_adc.c
index 712cae0..f2c0065 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev)
st->adc_base_spear3xx =
(struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx;
 
-   st->clk = clk_get(dev, NULL);
+   st->clk = devm_clk_get(dev, NULL);
if (IS_ERR(st->clk)) {
dev_err(dev, "failed getting clock\n");
goto errout1;
@@ -297,28 +297,28 @@ static int spear_adc_probe(struct platform_device *pdev)
ret = clk_prepare_enable(st->clk);
if (ret) {
dev_err(dev, "failed enabling clock\n");
-   goto errout2;
+   goto errout1;
}
 
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(dev, "failed getting interrupt resource\n");
ret = -EINVAL;
-   goto errout3;
+   goto errout2;
}
 
ret = devm_request_irq(dev, irq, spear_adc_isr, 0, SPEAR_ADC_MOD_NAME,
   st);
if (ret < 0) {
dev_err(dev, "failed requesting interrupt\n");
-   goto errout3;
+   goto errout2;
}
 
if (of_property_read_u32(np, "sampling-frequency",
 >sampling_freq)) {
dev_err(dev, "sampling-frequency missing in DT\n");
ret = -EINVAL;
-   goto errout3;
+   goto errout2;
}
 
/*
@@ -348,16 +348,14 @@ static int spear_adc_probe(struct platform_device *pdev)
 
ret = iio_device_register(indio_dev);
if (ret)
-   goto errout3;
+   goto errout2;
 
dev_info(dev, "SPEAR ADC driver loaded, IRQ %d\n", irq);
 
return 0;
 
-errout3:
-   clk_disable_unprepare(st->clk);
 errout2:
-   clk_put(st->clk);
+   clk_disable_unprepare(st->clk);
 errout1:
iounmap(st->adc_base_spear6xx);
return ret;
@@ -370,7 +368,6 @@ static int spear_adc_remove(struct platform_device *pdev)
 
iio_device_unregister(indio_dev);
clk_disable_unprepare(st->clk);
-   clk_put(st->clk);
iounmap(st->adc_base_spear6xx);
 
return 0;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()

2016-01-21 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, Jan 21, 2016 at 12:45:59PM +0300, Dan Carpenter wrote:
> On Thu, Jan 21, 2016 at 09:11:38AM +, Gujulan Elango, Hari Prasath (H.) 
> wrote:
> > From: Hari Prasath Gujulan Elango
> > 
> 
> Your email address is missing here.
Hello Dan,
Many thanks for notifying.I am sending a v2.

regards,
Hari Prasath

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


[PATCH] staging: nvec: replace led_classdev_register

2016-01-21 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Replace the led_classdev_register() with the platform managed version
devm_led_classdev_register() & henceforth remove the redundant
nvec_paz00_remove() function.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/nvec/nvec_paz00.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/staging/nvec/nvec_paz00.c 
b/drivers/staging/nvec/nvec_paz00.c
index 68146bf..cddbfd2 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -63,7 +63,7 @@ static int nvec_paz00_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, led);
 
-   ret = led_classdev_register(>dev, >cdev);
+   ret = devm_led_classdev_register(>dev, >cdev);
if (ret < 0)
return ret;
 
@@ -73,18 +73,8 @@ static int nvec_paz00_probe(struct platform_device *pdev)
return 0;
 }
 
-static int nvec_paz00_remove(struct platform_device *pdev)
-{
-   struct nvec_led *led = platform_get_drvdata(pdev);
-
-   led_classdev_unregister(>cdev);
-
-   return 0;
-}
-
 static struct platform_driver nvec_paz00_driver = {
.probe  = nvec_paz00_probe,
-   .remove = nvec_paz00_remove,
.driver = {
.name  = "nvec-paz00",
},
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: replace clk_get() with devm_clk_get()

2016-01-21 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango

This patch replaces the clk_get() with devm_clk_get().
Accordingly,modified the error paths and removed clk_put() as well.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/iio/adc/spear_adc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/spear_adc.c 
b/drivers/staging/iio/adc/spear_adc.c
index 712cae0..4ac0f54 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev)
st->adc_base_spear3xx =
(struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx;
 
-   st->clk = clk_get(dev, NULL);
+   st->clk = devm_clk_get(dev, NULL);
if (IS_ERR(st->clk)) {
dev_err(dev, "failed getting clock\n");
goto errout1;
@@ -297,7 +297,7 @@ static int spear_adc_probe(struct platform_device *pdev)
ret = clk_prepare_enable(st->clk);
if (ret) {
dev_err(dev, "failed enabling clock\n");
-   goto errout2;
+   goto errout1;
}
 
irq = platform_get_irq(pdev, 0);
@@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev)
 
 errout3:
clk_disable_unprepare(st->clk);
-errout2:
-   clk_put(st->clk);
 errout1:
iounmap(st->adc_base_spear6xx);
return ret;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: iio: replace clk_get() with devm_clk_get()

2016-01-21 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

This patch replaces the clk_get() with devm_clk_get().
Accordingly,modified the error paths and removed clk_put() as well.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
v2: email address was missing in the From field.
---
 drivers/staging/iio/adc/spear_adc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/spear_adc.c 
b/drivers/staging/iio/adc/spear_adc.c
index 712cae0..4ac0f54 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev)
st->adc_base_spear3xx =
(struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx;
 
-   st->clk = clk_get(dev, NULL);
+   st->clk = devm_clk_get(dev, NULL);
if (IS_ERR(st->clk)) {
dev_err(dev, "failed getting clock\n");
goto errout1;
@@ -297,7 +297,7 @@ static int spear_adc_probe(struct platform_device *pdev)
ret = clk_prepare_enable(st->clk);
if (ret) {
dev_err(dev, "failed enabling clock\n");
-   goto errout2;
+   goto errout1;
}
 
irq = platform_get_irq(pdev, 0);
@@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev)
 
 errout3:
clk_disable_unprepare(st->clk);
-errout2:
-   clk_put(st->clk);
 errout1:
iounmap(st->adc_base_spear6xx);
return ret;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get()

2016-01-21 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, Jan 21, 2016 at 11:21:53AM -0800, Matt Ranostay wrote:
> On Thu, Jan 21, 2016 at 1:11 AM, Gujulan Elango, Hari Prasath (H.)
> <hguju...@visteon.com> wrote:
> > From: Hari Prasath Gujulan Elango
> >
> > This patch replaces the clk_get() with devm_clk_get().
> > Accordingly,modified the error paths and removed clk_put() as well.
> >
> > Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
> > ---
> >  drivers/staging/iio/adc/spear_adc.c | 6 ++
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/iio/adc/spear_adc.c 
> > b/drivers/staging/iio/adc/spear_adc.c
> > index 712cae0..4ac0f54 100644
> > --- a/drivers/staging/iio/adc/spear_adc.c
> > +++ b/drivers/staging/iio/adc/spear_adc.c
> > @@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev)
> > st->adc_base_spear3xx =
> > (struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx;
> >
> > -   st->clk = clk_get(dev, NULL);
> > +   st->clk = devm_clk_get(dev, NULL);
> > if (IS_ERR(st->clk)) {
> > dev_err(dev, "failed getting clock\n");
> > goto errout1;
> > @@ -297,7 +297,7 @@ static int spear_adc_probe(struct platform_device *pdev)
> > ret = clk_prepare_enable(st->clk);
> > if (ret) {
> > dev_err(dev, "failed enabling clock\n");
> > -   goto errout2;
> > +   goto errout1;
> > }
> >
> > irq = platform_get_irq(pdev, 0);
> > @@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev)
> >
> >  errout3:
> > clk_disable_unprepare(st->clk);
> 
> Shouldn't errout3 now be errout2.. having a gap would seem odd.
> 
I agree with you on this. But as Dan says,I would correct it in a
different patch.
> > -errout2:
> > -   clk_put(st->clk);
> >  errout1:
> > iounmap(st->adc_base_spear6xx);
> > return ret;
> > --
> > 1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: use eth_broadcast_addr() in place of memset

2016-01-20 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango

Replace the memset of array to broadcast address 0xFF by using the
eth_broadcast_addr() API

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index a076ede..aec20bb 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -1907,7 +1907,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
memset(param, 0, param_len);
 
param->cmd = IEEE_CMD_SET_ENCRYPTION;
-   memset(param->sta_addr, 0xff, ETH_ALEN);
+   eth_broadcast_addr(param->sta_addr);
 
switch (pext->alg) {
case IW_ENCODE_ALG_NONE:
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: prefer using eth_broadcast_addr()

2016-01-20 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango

Prefer using the eth_broadcast_addr() instead of memset to broadcast
address 0xFF to the array.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index d0fedb0..2a57640 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -355,9 +355,9 @@ static inline struct sk_buff *rtllib_probe_req(struct 
rtllib_device *ieee)
req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
req->header.duration_id = 0;
 
-   memset(req->header.addr1, 0xff, ETH_ALEN);
+   eth_broadcast_addr(req->header.addr1);
ether_addr_copy(req->header.addr2, ieee->dev->dev_addr);
-   memset(req->header.addr3, 0xff, ETH_ALEN);
+   eth_broadcast_addr(req->header.addr3);
 
tag = (u8 *) skb_put(skb, len + 2 + rate_len);
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: Move Macro definition

2016-01-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

This patch move's a macro defined in the middle of a structure
definition to make it more readable.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/wilc1000/wilc_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
b/drivers/staging/wilc1000/wilc_sdio.c
index e961b50..875ea68 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -29,12 +29,12 @@ static const struct sdio_device_id wilc_sdio_ids[] = {
 };
 
 #define WILC_SDIO_BLOCK_SIZE 512
+#define MAX_NUN_INT_THRPT_ENH2 (5) /* Max num interrupts allowed in registers 
0xf7, 0xf8 */
 
 typedef struct {
bool irq_gpio;
u32 block_size;
int nint;
-#define MAX_NUN_INT_THRPT_ENH2 (5) /* Max num interrupts allowed in registers 
0xf7, 0xf8 */
int has_thrpt_enh3;
 } wilc_sdio_t;
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: most: replace multiple if..else with table lookup

2015-12-28 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Replace multiple if..else if..statements with simple table lookup in two
functions.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/most/mostcore/core.c | 41 +---
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index ed1ed25..fe6705a 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -82,6 +82,14 @@ struct most_inst_obj {
struct list_head list;
 };
 
+static const struct {
+   int most_ch_data_type;
+   char *name;
+} ch_data_type[] = { { MOST_CH_CONTROL, "control\n" },
+   { MOST_CH_ASYNC, "async\n" },
+   { MOST_CH_SYNC, "sync\n" },
+   { MOST_CH_ISOC_AVP, "isoc_avp\n"} };
+
 #define to_inst_obj(d) container_of(d, struct most_inst_obj, kobj)
 
 /**
@@ -414,14 +422,12 @@ static ssize_t show_set_datatype(struct most_c_obj *c,
 struct most_c_attr *attr,
 char *buf)
 {
-   if (c->cfg.data_type & MOST_CH_CONTROL)
-   return snprintf(buf, PAGE_SIZE, "control\n");
-   else if (c->cfg.data_type & MOST_CH_ASYNC)
-   return snprintf(buf, PAGE_SIZE, "async\n");
-   else if (c->cfg.data_type & MOST_CH_SYNC)
-   return snprintf(buf, PAGE_SIZE, "sync\n");
-   else if (c->cfg.data_type & MOST_CH_ISOC_AVP)
-   return snprintf(buf, PAGE_SIZE, "isoc_avp\n");
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
+   if (c->cfg.data_type & ch_data_type[i].most_ch_data_type)
+   return snprintf(buf, PAGE_SIZE, ch_data_type[i].name);
+   }
return snprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
@@ -430,15 +436,16 @@ static ssize_t store_set_datatype(struct most_c_obj *c,
  const char *buf,
  size_t count)
 {
-   if (!strcmp(buf, "control\n")) {
-   c->cfg.data_type = MOST_CH_CONTROL;
-   } else if (!strcmp(buf, "async\n")) {
-   c->cfg.data_type = MOST_CH_ASYNC;
-   } else if (!strcmp(buf, "sync\n")) {
-   c->cfg.data_type = MOST_CH_SYNC;
-   } else if (!strcmp(buf, "isoc_avp\n")) {
-   c->cfg.data_type = MOST_CH_ISOC_AVP;
-   } else {
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
+   if (!strcmp(buf, ch_data_type[i].name)) {
+   c->cfg.data_type = ch_data_type[i].most_ch_data_type;
+   break;
+   }
+   }
+
+   if (i == ARRAY_SIZE(ch_data_type)) {
pr_info("WARN: invalid attribute settings\n");
return -EINVAL;
}
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: most: replace multiple if..else with table lookup

2015-12-24 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Replace multiple if..else if..statements with simple table lookup in two
functions.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/most/mostcore/core.c | 39 
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index ed1ed25..7b4636b 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -82,6 +82,14 @@ struct most_inst_obj {
struct list_head list;
 };
 
+static const struct {
+   int most_ch_data_type;
+   char *name;
+} ch_data_type[] = { { MOST_CH_CONTROL, "control\n" },
+   { MOST_CH_ASYNC, "async\n" },
+   { MOST_CH_SYNC, "sync\n" },
+   { MOST_CH_ISOC_AVP, "isoc_avp\n"} };
+
 #define to_inst_obj(d) container_of(d, struct most_inst_obj, kobj)
 
 /**
@@ -414,14 +422,12 @@ static ssize_t show_set_datatype(struct most_c_obj *c,
 struct most_c_attr *attr,
 char *buf)
 {
-   if (c->cfg.data_type & MOST_CH_CONTROL)
-   return snprintf(buf, PAGE_SIZE, "control\n");
-   else if (c->cfg.data_type & MOST_CH_ASYNC)
-   return snprintf(buf, PAGE_SIZE, "async\n");
-   else if (c->cfg.data_type & MOST_CH_SYNC)
-   return snprintf(buf, PAGE_SIZE, "sync\n");
-   else if (c->cfg.data_type & MOST_CH_ISOC_AVP)
-   return snprintf(buf, PAGE_SIZE, "isoc_avp\n");
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
+   if (c->cfg.data_type & ch_data_type[i].most_ch_data_type)
+   return snprintf(buf, PAGE_SIZE, ch_data_type[i].name);
+   }
return snprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
@@ -430,15 +436,14 @@ static ssize_t store_set_datatype(struct most_c_obj *c,
  const char *buf,
  size_t count)
 {
-   if (!strcmp(buf, "control\n")) {
-   c->cfg.data_type = MOST_CH_CONTROL;
-   } else if (!strcmp(buf, "async\n")) {
-   c->cfg.data_type = MOST_CH_ASYNC;
-   } else if (!strcmp(buf, "sync\n")) {
-   c->cfg.data_type = MOST_CH_SYNC;
-   } else if (!strcmp(buf, "isoc_avp\n")) {
-   c->cfg.data_type = MOST_CH_ISOC_AVP;
-   } else {
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
+   if (!strcmp(buf, ch_data_type[i].name))
+   c->cfg.data_type = ch_data_type[i].most_ch_data_type;
+   }
+
+   if (i == ARRAY_SIZE(ch_data_type)) {
pr_info("WARN: invalid attribute settings\n");
return -EINVAL;
}
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: convert to wait_event_interruptible_timeout

2015-12-24 Thread Gujulan Elango, Hari Prasath (H.)
This patch makes use of wait_event_interruptible_timeout to achieve timeout
functionality.This is a TODO mentiond in the comment which is also removed.
It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/dgnc/dgnc_neo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 39c76e7..7d9efe0 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1306,10 +1306,8 @@ static int neo_drain(struct tty_struct *tty, uint 
seconds)
/*
 * Go to sleep waiting for the tty layer to wake me back up when
 * the empty flag goes away.
-*
-* NOTE: TODO: Do something with time passed in.
 */
-   rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & 
UN_EMPTY) == 0));
+   rc = wait_event_interruptible_timeout(un->un_flags_wait, ((un->un_flags 
& UN_EMPTY) == 0), msecs_to_jiffies(seconds * 1000));
 
/* If ret is non-zero, user ctrl-c'ed us */
return rc;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: replace numerical constant with predefined MACRO

2015-12-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango <hguju...@visteon.com>

Replace the pre-defined macro signifying the ethernet protocol type
defined in the kernel headers instead of the numerical constant

Signed-off-by: Hari Prasath Gujulan Elango <hguju...@visteon.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 9d257b0..7100688 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -289,7 +289,7 @@ static inline int tcp_process(struct net_device *dev, 
struct txq_entry_t *tqe)
 
eth_hdr_ptr = [0];
h_proto = ntohs(*((unsigned short *)_hdr_ptr[12]));
-   if (h_proto == 0x0800) {
+   if (h_proto == ETH_P_IP) {
u8 *ip_hdr_ptr;
u8 protocol;
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: simplify 'memset' of 2D array

2015-08-20 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch simplifies the 'memset' done on a static 2D array.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 66fa677..908156e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1492,8 +1492,7 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
PRINT_D(GENERIC_DBG, Handling connect request\n);
 
#ifndef CONNECT_DIRECT
-   memset(gapu8RcvdSurveyResults[0], 0, MAX_SURVEY_RESULT_FRAG_SIZE);
-   memset(gapu8RcvdSurveyResults[1], 0, MAX_SURVEY_RESULT_FRAG_SIZE);
+   memset(gapu8RcvdSurveyResults, 0, sizeof(gapu8RcvdSurveyResults));
 
 
PRINT_D(HOSTINF_DBG, Getting site survey results\n);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: xgifb: prefer using the BIT macro

2015-07-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch uses the  BIT macro for bit shift operation.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/xgifb/XGI_main_26.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 943d463..5bfe151 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -18,8 +18,8 @@
 #define Index_CR_GPIO_Reg1 0x48
 #define Index_CR_GPIO_Reg3 0x4a
 
-#define GPIOG_EN(16)
-#define GPIOG_READ  (11)
+#define GPIOG_ENBIT(6)
+#define GPIOG_READ  BIT(1)
 
 static char *forcecrt2type;
 static char *mode;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: remove dead code

2015-07-08 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes commented code.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/lustre/lustre/osc/osc_cache.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 5592d32..c72035e 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1837,12 +1837,6 @@ static int try_to_add_extent_for_io(struct client_obd 
*cli,
oap2 = list_first_entry(tmp-oe_pages, struct osc_async_page,
oap_pending_item);
EASSERT(tmp-oe_owner == current, tmp);
-#if 0
-   if (overlapped(tmp, ext)) {
-   OSC_EXTENT_DUMP(D_ERROR, tmp, overlapped %p.\n, ext);
-   EASSERT(0, ext);
-   }
-#endif
if (oap2cl_page(oap)-cp_type != oap2cl_page(oap2)-cp_type) {
CDEBUG(D_CACHE, Do not permit different type of IO
 for a same RPC\n);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: use BIT macro

2015-06-25 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

Prefer using the BIT macro for shifting operation

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/comedi/comedi.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 66edda1..169328c 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -72,12 +72,12 @@
 #define CR_AREF(a) (((a)24)0x03)
 
 #define CR_FLAGS_MASK  0xfc00
-#define CR_ALT_FILTER  (126)
+#define CR_ALT_FILTER  BIT(26)
 #define CR_DITHER  CR_ALT_FILTER
 #define CR_DEGLITCHCR_ALT_FILTER
-#define CR_ALT_SOURCE  (127)
-#define CR_EDGE(130)
-#define CR_INVERT  (131)
+#define CR_ALT_SOURCE  BIT(27)
+#define CR_EDGEBIT(30)
+#define CR_INVERT  BIT(31)
 
 #define AREF_GROUND0x00/* analog ref = analog ground */
 #define AREF_COMMON0x01/* analog ref = analog common */
@@ -508,7 +508,7 @@ struct comedi_bufinfo {
 #define RANGE_LENGTH(b)((b)0x)
 
 #define RF_UNIT(flags) ((flags)0xff)
-#define RF_EXTERNAL(18)
+#define RF_EXTERNALBIT(8)
 
 #define UNIT_volt  0
 #define UNIT_mA1
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: sm750fb: remove redundant __func__ in debug statement

2015-06-24 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the redundant __func__ from dynamic debug prints as
the pr_xxx set of functions can be dynamically controlled to include
function name.Also fix a typo in debug statement.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
v2:Address Dan Carpenter's review comments to fold them as a
singl patch rather than sending these two changes as separate patches.
---
 drivers/staging/sm750fb/sm750_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750_accel.c 
b/drivers/staging/sm750fb/sm750_accel.c
index 6eee4cd..8ea3a61 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -100,7 +100,7 @@ int hw_fillrect(struct lynx_accel *accel,
{
/* int time wait and always busy,seems hardware
 * got something error */
-   pr_debug(%s:De engine always bussy\n, __func__);
+   pr_debug(De engine always busy\n);
return -1;
}
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: sm750fb: convert pr_err to pr_info

2015-06-24 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 22, 2015 at 06:15:06PM +0300, Dan Carpenter wrote:
 On Thu, Jun 18, 2015 at 12:56:54PM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  This patch modifies few debug prints from pr_err() to pr_info() as they
  fall under that category.
  
 
 They should be dbg or removed.
 
 regards,
 dan carpenter
 

Dan,Greg has already merged this patch.Should I now send another patch
to convert this from pr_info() to pr_dbg() ?

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


Re: [PATCH v2 07/10] staging: wilc1000: remove ununsed variable

2015-06-24 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 23, 2015 at 11:49:24AM +0300, Dan Carpenter wrote:
 On Mon, Jun 22, 2015 at 01:13:58PM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  This patch removes ununsed variable 'len'
  
  Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This doesn't work because it's not in the same thread as the original
 email.  You need to use the --in-reply-to option or Greg will not be
 able to find it.
 
 regards,
 dan carpenter
 

Thanks Dan,Ok I use mutt. I will have to figure out how to get this done
using Mutt.Also,if any one patch is being dropped,should i resend the
entire patch set as the numbers will differ.

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


Re: [PATCH] staging: dgnc: free memory allocated

2015-06-23 Thread Gujulan Elango, Hari Prasath (H.)


On Monday 22 June 2015 10:45 PM, Dan Carpenter wrote:
 You should have CC'd Mark on these.  Use ./scripts/get_maintainer.pl
 
 regards,
 dan carpenter
 

Thanks Dan.I did use the get_maintainer.pl as I do always. I missed
Marks email ID. It was my mistake.Thanks for adding him.Greg has already
added this patch.I will ensure not to miss him next time.

 On Thu, Jun 18, 2015 at 01:27:28PM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com

 The memory allocated in dgnc_tty_register() for two objects is not freed
 anywhere.This patch addresses this by freeing the memory in
 dgnc_tty_uninit.

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

 diff --git a/drivers/staging/dgnc/dgnc_tty.c 
 b/drivers/staging/dgnc/dgnc_tty.c
 index 5c5c4b7..fbfe79a 100644
 --- a/drivers/staging/dgnc/dgnc_tty.c
 +++ b/drivers/staging/dgnc/dgnc_tty.c
 @@ -422,8 +422,12 @@ void dgnc_tty_uninit(struct dgnc_board *brd)
  
  kfree(brd-SerialDriver.ttys);
  brd-SerialDriver.ttys = NULL;
 +kfree(brd-SerialDriver.termios);
 +brd-SerialDriver.termios = NULL;
  kfree(brd-PrintDriver.ttys);
  brd-PrintDriver.ttys = NULL;
 +kfree(brd-PrintDriver.termios);
 +brd-PrintDriver.termios = NULL;
  }
  
  /*===
 -- 
 1.9.1
 ___
 devel mailing list
 de...@linuxdriverproject.org
 http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
 


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


Re: [PATCH] staging: sm750fb: convert pr_err to pr_info

2015-06-23 Thread Gujulan Elango, Hari Prasath (H.)


On Monday 22 June 2015 08:46 PM, Dan Carpenter wrote:
 On Thu, Jun 18, 2015 at 12:56:54PM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com

 This patch modifies few debug prints from pr_err() to pr_info() as they
 fall under that category.

 
 They should be dbg or removed.
 
 regards,
 dan carpenter
 
 


Thanks Dan.I shall send a v2 addressing the same.

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


Re: [PATCH 2/2] staging: sm750fb: fix typo in debug statement

2015-06-23 Thread Gujulan Elango, Hari Prasath (H.)


On Tuesday 23 June 2015 02:07 PM, Dan Carpenter wrote:
 On Mon, Jun 22, 2015 at 04:48:01AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com

 This patch fixes a typo in the debug statement

 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 ---
 
 Fold these together.  It's a one line change to the same line...
 
 regards,
 dan carpenter
 
 

sorry,I went by the 'Do one thing per patch' rule.I was actually
confused while sending this.I shall resend both as single patch.
Thanks for the review.

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


Re: [PATCH] staging: sm750fb: remove unused variables

2015-06-23 Thread Gujulan Elango, Hari Prasath (H.)


On Tuesday 23 June 2015 02:16 PM, Dan Carpenter wrote:
 On Mon, Jun 22, 2015 at 07:26:25AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
 @@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
  * Sometime, the chip cannot set up the exact clock required by 
 User.
  * Return value from calcPllValue() gives the actual possible 
 clock.
  */
 -ulActualMxClk = calcPllValue(frequency, pll);
 +calcPllValue(frequency, pll);
 
 Should we get rid of calcPllValue() as well?  I guess I would prefer to
 leave the warnings until someone has the answer to this.
 
 Warnings are good because they show where the bugs are.  It's not always
 the right thing to silence them.
 
 regards,
 dan carpenter
 
 

Okay.Let us drop this patch and leave the warning as it is. Sudip,I saw
your e-mail on the same topic. Thank you both for reviewing.


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


[PATCH 04/10] staging: wilc1000: remove ununsed variable corresponding lines

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes a couple of ununsed variable.The lines in which these
variables are assigned are also removed as they are not necessary.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/linux_mon.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index f5296f5..9a38d76 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -237,14 +237,12 @@ static void mgmt_tx_complete(void *priv, int status)
 }
 static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 {
-   linux_wlan_t *nic;
struct tx_complete_mon_data *mgmt_tx = NULL;
 
if (dev == NULL) {
PRINT_D(HOSTAPD_DBG, ERROR: dev == NULL\n);
return WILC_FAIL;
}
-   nic = netdev_priv(dev);
 
netif_stop_queue(dev);
mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC);
@@ -298,7 +296,6 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 
*buf, size_t len)
 static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 struct net_device *dev)
 {
-   struct ieee80211_radiotap_header *rtap_hdr;
u32 rtap_len, i, ret = 0;
struct WILC_WFI_mon_priv  *mon_priv;
 
@@ -318,7 +315,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
return WILC_FAIL;
}
 
-   rtap_hdr = (struct ieee80211_radiotap_header *)skb-data;
 
rtap_len = ieee80211_get_radiotap_len(skb-data);
if (skb-len  rtap_len) {
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/10] staging: wilc1000: remove ununsed variable

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes ununsed variable 'ret'.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wlan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index d28c410..def72fd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -118,11 +118,10 @@ static void wilc_debug(uint32_t flag, char *fmt, ...)
 {
char buf[256];
va_list args;
-   int len;
 
if (flag  dbgflag) {
va_start(args, fmt);
-   len = vsprintf(buf, fmt, args);
+   vsprintf(buf, fmt, args);
va_end(args);
 
if (g_wlan.os_func.os_debug)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/10] staging: wilc1000: remove redundant assignment of variable

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch the removes the redundant assignement of the variable ret as
its being overwritren before being used anywhere.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 3af91f7..d28c410 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1782,7 +1782,7 @@ static int wilc_wlan_stop(void)
 
/**/
reg = ((1  0) | (1  1) | (1  2) | (1  3) | (1  8) | (1  9) 
| (1  26) | (1  29) | (1  30) | (1  31)); /**/
/**/
-   ret = p-hif_func.hif_write_reg(WILC_GLB_RESET_0, reg); 
/**/
+   p-hif_func.hif_write_reg(WILC_GLB_RESET_0, reg);   
  /**/
reg = ~(1  10);   
/**/
/**/
ret = p-hif_func.hif_write_reg(WILC_GLB_RESET_0, reg); 
/**/
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/10] staging: wilc1000: remove unused variable

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes a unused variable timeout and the associated code.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/linux_wlan.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index b352c50..5a794df 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -868,7 +868,6 @@ static int linux_wlan_txq_task(void *vp)
 #define TX_BACKOFF_WEIGHT_MIN (0)
 #define TX_BACKOFF_WEIGHT_UNIT_MS (10)
int backoff_weight = TX_BACKOFF_WEIGHT_MIN;
-   signed long timeout;
 #endif
 
/* inform wilc1000_wlan_init that TXQ task is started. */
@@ -906,7 +905,6 @@ static int linux_wlan_txq_task(void *vp)
}
 
if (ret == WILC_TX_ERR_NO_BUF) { /* failed to allocate 
buffers in chip. */
-   timeout = 
msecs_to_jiffies(TX_BACKOFF_WEIGHT_UNIT_MS  backoff_weight);
do {
/* Back off from sending packets for 
some time. */
/* schedule_timeout will allow RX task 
to run and free buffers.*/
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/10] staging: wilc1000: remove ununsed if..else.. code blocks

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes ununsed if..else... code blocks. Its actually some
dead code.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/coreconfigurator.c | 22 --
 1 file changed, 22 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index eb685fe..b069614 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -1568,14 +1568,6 @@ s32 further_process_response(u8 *resp,
case WID_STR:
WILC_memcpy(cfg_str, resp + idx, cfg_len);
/* cfg_str[cfg_len] = '\0'; //mostafa: no need currently for 
NULL termination */
-   if (process_wid_num) {
-   /*fprintf(out_file,0x%4.4x = %s\n,g_wid_num,
-*  cfg_str);*/
-   } else {
-   /*fprintf(out_file,%s = 
%s\n,gastrWIDs[cnt].cfg_switch,
-*   cfg_str);*/
-   }
-
if (pstrWIDresult-s32ValueSize = cfg_len) {
WILC_memcpy(pstrWIDresult-ps8WidVal, cfg_str, 
cfg_len); /* mostafa: no need currently for the extra NULL byte */
pstrWIDresult-s32ValueSize = cfg_len;
@@ -1591,13 +1583,6 @@ s32 further_process_response(u8 *resp,
 
WILC_strncpy(pstrWIDresult-ps8WidVal, cfg_str, 
WILC_strlen(cfg_str));
pstrWIDresult-ps8WidVal[WILC_strlen(cfg_str)] = '\0';
-   if (process_wid_num) {
-   /*fprintf(out_file,0x%4.4x = %s\n,g_wid_num,
-*  cfg_str);*/
-   } else {
-   /*fprintf(out_file,%s = 
%s\n,gastrWIDs[cnt].cfg_switch,
-*   cfg_str);*/
-   }
break;
 
case WID_IP:
@@ -1606,13 +1591,6 @@ s32 further_process_response(u8 *resp,
MAKE_WORD16(resp[idx + 2], resp[idx + 3])
);
conv_int_to_ip(cfg_str, cfg_int);
-   if (process_wid_num) {
-   /*fprintf(out_file,0x%4.4x = %s\n,g_wid_num,
-*  cfg_str);*/
-   } else {
-   /*fprintf(out_file,%s = 
%s\n,gastrWIDs[cnt].cfg_switch,
-*   cfg_str);*/
-   }
break;
 
case WID_BIN_DATA:
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/10] staging: wilc1000: remove ununsed variable and associated line

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes a unused variable 'u16RespLen' that is assigned a
value that is never used. The line that does the assignment is also
removed.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/coreconfigurator.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index ed6ac45..67cffc3c 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -1739,7 +1739,6 @@ s32 ParseResponse(u8 *resp, tstrWID *pstrWIDcfgResult)
 s32 ParseWriteResponse(u8 *pu8RespBuffer)
 {
s32 s32Error = WILC_FAIL;
-   u16 u16RespLen   = 0;
u16 u16WIDtype = (u16)WID_NIL;
 
/* Check whether the received frame is a valid response */
@@ -1748,9 +1747,6 @@ s32 ParseWriteResponse(u8 *pu8RespBuffer)
return WILC_FAIL;
}
 
-   /* Extract Response Length */
-   u16RespLen = MAKE_WORD16(pu8RespBuffer[2], pu8RespBuffer[3]);
-
u16WIDtype = MAKE_WORD16(pu8RespBuffer[4], pu8RespBuffer[5]);
 
/* Check for WID_STATUS ID and then check the length and status value */
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/10] staging: wilc1000: remove unused variable msg_len

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes a ununsed variable msg_len and its associated code.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c 
b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 3cffe55..04d0327 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -513,7 +513,6 @@ static int wilc_wlan_cfg_indicate_rx(uint8_t *frame, int 
size, wilc_cfg_rsp_t *r
int ret = 1;
uint8_t msg_type;
uint8_t msg_id;
-   uint16_t msg_len;
#ifdef WILC_FULLY_HOSTING_AP
u32 *ptru32Frame;
bool bStatus = frame[2];
@@ -528,11 +527,6 @@ static int wilc_wlan_cfg_indicate_rx(uint8_t *frame, int 
size, wilc_cfg_rsp_t *r
 
msg_type = frame[0];
msg_id = frame[1];  /* seq no */
-#ifdef BIG_ENDIAN
-   msg_len = (frame[2]  8) | frame[3];
-#else
-   msg_len = (frame[3]  8) | frame[2];
-#endif
frame += 4;
size -= 4;
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/10] staging: wilc1000: remove ununsed variable associated code

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the ununsed variable 'priv' at multiple instances and
all its associated code where its assigned a value.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 92064db..28b1764 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -144,9 +144,7 @@ bool g_wep_keys_saved = false;
 
 void clear_shadow_scan(void *pUserVoid)
 {
-   struct WILC_WFI_priv *priv;
int i;
-   priv = (struct WILC_WFI_priv *)pUserVoid;
if (op_ifcs == 0) {
WILC_TimerDestroy(hAgingTimer, NULL);
PRINT_INFO(CORECONFIG_DBG, destroy aging timer\n);
@@ -219,9 +217,7 @@ void refresh_scan(void *pUserVoid, uint8_t all, bool 
bDirectScan)
 
 void reset_shadow_found(void *pUserVoid)
 {
-   struct WILC_WFI_priv *priv;
int i;
-   priv = (struct WILC_WFI_priv *)pUserVoid;
for (i = 0; i  u32LastScannedNtwrksCountShadow; i++) {
astrLastScannedNtwrksShadow[i].u8Found = 0;
 
@@ -230,9 +226,7 @@ void reset_shadow_found(void *pUserVoid)
 
 void update_scan_time(void *pUserVoid)
 {
-   struct WILC_WFI_priv *priv;
int i;
-   priv = (struct WILC_WFI_priv *)pUserVoid;
for (i = 0; i  u32LastScannedNtwrksCountShadow; i++) {
astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan = jiffies;
}
@@ -240,11 +234,9 @@ void update_scan_time(void *pUserVoid)
 
 void remove_network_from_shadow(void *pUserVoid)
 {
-   struct WILC_WFI_priv *priv;
unsigned long now = jiffies;
int i, j;
 
-   priv = (struct WILC_WFI_priv *)pUserVoid;
 
for (i = 0; i  u32LastScannedNtwrksCountShadow; i++) {
if (time_after(now, 
astrLastScannedNtwrksShadow[i].u32TimeRcvdInScan + (unsigned 
long)(SCAN_RESULT_EXPIRE))) {
@@ -281,11 +273,9 @@ void clear_duringIP(void *pUserVoid)
 
 int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 {
-   struct WILC_WFI_priv *priv;
int8_t state = -1;
int i;
 
-   priv = (struct WILC_WFI_priv *)pUserVoid;
if (u32LastScannedNtwrksCountShadow == 0) {
PRINT_D(CFG80211_DBG, Starting Aging timer\n);
WILC_TimerStart((hAgingTimer), AGING_TIME, pUserVoid, NULL);
@@ -305,11 +295,9 @@ int8_t is_network_in_shadow(tstrNetworkInfo 
*pstrNetworkInfo, void *pUserVoid)
 
 void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, 
void *pJoinParams)
 {
-   struct WILC_WFI_priv *priv;
int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
uint32_t ap_index = 0;
uint8_t rssi_index = 0;
-   priv = (struct WILC_WFI_priv *)pUserVoid;
 
if (u32LastScannedNtwrksCountShadow = MAX_NUM_SCANNED_NETWORKS_SHADOW) 
{
PRINT_D(CFG80211_DBG, Shadow network reached its maximum 
limit\n);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/10] staging: wilc1000: use BIT macro

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch addresses the checkpatch warning advising the usage of the
BIT macro for Bit shift operation.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 8ed51e3..8735a6a 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -43,8 +43,8 @@
  /
 
 #define HIF_SDIO   (0)
-#define HIF_SPI(1  0)
-#define HIF_SDIO_GPIO_IRQ  (1  2)
+#define HIF_SPIBIT(0)
+#define HIF_SDIO_GPIO_IRQ  BIT(2)
 
 
 /
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: sm750fb: remove unused variables

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes unused variables as reported by cppcheck

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/sm750fb/ddk750_chip.c   | 3 +--
 drivers/staging/sm750fb/ddk750_mode.c   | 3 +--
 drivers/staging/sm750fb/ddk750_sii164.c | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c 
b/drivers/staging/sm750fb/ddk750_chip.c
index f4975d2..e8ac6e6 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -103,7 +103,6 @@ unsigned int getChipClock(void)
 void setChipClock(unsigned int frequency)
 {
pll_value_t pll;
-   unsigned int ulActualMxClk;
 #if 1
/* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
if (getChipType() == SM750LE)
@@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
* Sometime, the chip cannot set up the exact clock required by 
User.
* Return value from calcPllValue() gives the actual possible 
clock.
*/
-   ulActualMxClk = calcPllValue(frequency, pll);
+   calcPllValue(frequency, pll);
 
/* Master Clock Control: MXCLK_PLL */
POKE32(MXCLK_PLL_CTRL, formatPllReg(pll));
diff --git a/drivers/staging/sm750fb/ddk750_mode.c 
b/drivers/staging/sm750fb/ddk750_mode.c
index 74313ff..e67e1e9 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -188,11 +188,10 @@ static int programModeRegisters(mode_parameter_t 
*pModeParam, pll_value_t *pll)
 int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock)
 {
pll_value_t pll;
-   unsigned int uiActualPixelClk;
pll.inputFreq = DEFAULT_INPUT_CLOCK;
pll.clockType = clock;
 
-   uiActualPixelClk = calcPllValue(parm-pixel_clock, pll);
+   calcPllValue(parm-pixel_clock, pll);
if(getChipType() == SM750LE){
/* set graphic mode via IO method */
outb_p(0x88, 0x3d4);
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index b6395b8..2ac3470 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -345,8 +345,7 @@ void sii164EnableHotPlugDetection(
 unsigned char enableHotPlug
 )
 {
-unsigned char detectReg;
-detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
+i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
 
 /* Depending on each DVI controller, need to enable the hot plug based on 
each
individual chip design. */
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 07/10] staging: wilc1000: remove ununsed variable

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 22, 2015 at 06:12:11PM +0530, Sudip Mukherjee wrote:
 On Mon, Jun 22, 2015 at 07:05:04AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  This patch removes ununsed variable 'ret'.
 ret or len? :)
 
 regards
 sudip

yes,it's len and not 'ret'. Thanks for the check.I will send a v2.Should
I send v2 only for this patch ? I will better wait for review comments
for my other patches and then send this one.

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


[PATCH v2 07/10] staging: wilc1000: remove ununsed variable

2015-06-22 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes ununsed variable 'len'

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wlan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index d28c410..def72fd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -118,11 +118,10 @@ static void wilc_debug(uint32_t flag, char *fmt, ...)
 {
char buf[256];
va_list args;
-   int len;
 
if (flag  dbgflag) {
va_start(args, fmt);
-   len = vsprintf(buf, fmt, args);
+   vsprintf(buf, fmt, args);
va_end(args);
 
if (g_wlan.os_func.os_debug)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: sm750fb: fix typo in debug statement

2015-06-21 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch fixes a typo in the debug statement

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/sm750fb/sm750_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750_accel.c 
b/drivers/staging/sm750fb/sm750_accel.c
index bf62003..8ea3a61 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -100,7 +100,7 @@ int hw_fillrect(struct lynx_accel *accel,
{
/* int time wait and always busy,seems hardware
 * got something error */
-   pr_debug(De engine always bussy\n);
+   pr_debug(De engine always busy\n);
return -1;
}
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: sm750fb: remove redundant __func__ in debug statement

2015-06-21 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the redundant __func__ from dynamic debug prints as
the pr_xxx set of functions can be dynamically controlled to include
function name as well

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/sm750fb/sm750_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750_accel.c 
b/drivers/staging/sm750fb/sm750_accel.c
index 6eee4cd..bf62003 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -100,7 +100,7 @@ int hw_fillrect(struct lynx_accel *accel,
{
/* int time wait and always busy,seems hardware
 * got something error */
-   pr_debug(%s:De engine always bussy\n, __func__);
+   pr_debug(De engine always bussy\n);
return -1;
}
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: lnet: selftest: use min_t in place of min

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch silences the checkpatch warning 'min() should
probably be min_t'

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/lustre/lnet/selftest/rpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c 
b/drivers/staging/lustre/lnet/selftest/rpc.c
index 59cf01f..6ae1331 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -90,7 +90,7 @@ void srpc_set_counters(const srpc_counters_t *cnt)
 static int
 srpc_add_bulk_page(srpc_bulk_t *bk, struct page *pg, int i, int nob)
 {
-   nob = min(nob, (int)PAGE_CACHE_SIZE);
+   nob = min_t(int, nob, PAGE_CACHE_SIZE);
 
LASSERT(nob  0);
LASSERT(i = 0  i  bk-bk_niov);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: sm750fb: convert pr_err to pr_info

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch modifies few debug prints from pr_err() to pr_info() as they
fall under that category.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/sm750fb/sm750.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 6b642d7..3f30bc0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -338,7 +338,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
line_length = var-xres_virtual * var-bits_per_pixel / 8;
line_length = PADDING(crtc-line_pad, line_length);
fix-line_length = line_length;
-   pr_err(fix-line_length = %d\n, fix-line_length);
+   pr_info(fix-line_length = %d\n, fix-line_length);
 
/* var-red,green,blue,transp are need to be set by driver
 * and these data should be set before setcolreg routine
@@ -1021,8 +1021,8 @@ static void sm750fb_setup(struct lynx_share *share, char 
*src)
}
 
while ((opt = strsep(src, :)) != NULL  *opt != 0) {
-   pr_err(opt=%s\n, opt);
-   pr_err(src=%s\n, src);
+   pr_info(opt=%s\n, opt);
+   pr_info(src=%s\n, src);
 
if (!strncmp(opt, swap, strlen(swap)))
swap = 1;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: free memory allocated

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

The memory allocated in dgnc_tty_register() for two objects is not freed
anywhere.This patch addresses this by freeing the memory in
dgnc_tty_uninit.

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

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 5c5c4b7..fbfe79a 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -422,8 +422,12 @@ void dgnc_tty_uninit(struct dgnc_board *brd)
 
kfree(brd-SerialDriver.ttys);
brd-SerialDriver.ttys = NULL;
+   kfree(brd-SerialDriver.termios);
+   brd-SerialDriver.termios = NULL;
kfree(brd-PrintDriver.ttys);
brd-PrintDriver.ttys = NULL;
+   kfree(brd-PrintDriver.termios);
+   brd-PrintDriver.termios = NULL;
 }
 
 /*===
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: fix typo in comments secion

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch fixes a typo in the comments section as warned by
checkpatch.pl

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/dgnc/dgnc_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ebb3439..d04671f 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -72,7 +72,7 @@
 /*
  * Define a local default termios struct. All ports will be created
  * with this termios initially.  This is the same structure that is defined
- * as the default in tty_io.c with the same settings overriden as in serial.c
+ * as the default in tty_io.c with the same settings overridden as in serial.c
  *
  * In short, this should match the internal serial ports' defaults.
  */
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ste_rmi4: remove redundant __func__ from debug prints

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the redundant __func__ from dynamic debug prints as
the pr_xxx set of functions can be dynamically controlled to include
function name as well.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 44 ++-
 1 file changed, 16 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 0f524bb..8935800 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -244,8 +244,8 @@ retry:
if (retval != size) {
if (++retry_count == MAX_RETRY_COUNT)
dev_err(i2c-dev,
-   %s:address 0x%04x size %d failed:%d\n,
-   __func__, address, size, retval);
+   address 0x%04x size %d failed:%d\n,
+   address, size, retval);
else {
synaptics_rmi4_set_page(pdata, address);
goto retry;
@@ -339,8 +339,7 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
finger_registers);
if (retval != finger_registers) {
-   dev_err(client-dev, %s:read status registers failed\n,
-   __func__);
+   dev_err(client-dev, read status registers failed\n);
return 0;
}
/*
@@ -371,8 +370,7 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
data_offset, data,
data_reg_blk_size);
if (retval != data_reg_blk_size) {
-   dev_err(client-dev, %s:read data failed\n,
-   __func__);
+   dev_err(client-dev, read data failed\n);
return 0;
}
x = (data[0]  4) | (data[2]  MASK_4BIT);
@@ -419,8 +417,7 @@ static int synaptics_rmi4_report_device(struct 
synaptics_rmi4_data *pdata,
if (rfi-fn_number != SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM) {
num_error_reports++;
if (num_error_reports  MAX_ERROR_REPORT)
-   dev_err(client-dev, %s:report not supported\n,
-   __func__);
+   dev_err(client-dev, report not supported\n);
} else
touch = synpatics_rmi4_touchpad_report(pdata, rfi);
return touch;
@@ -545,8 +542,7 @@ static int synpatics_rmi4_touchpad_detect(struct 
synaptics_rmi4_data *pdata,
queries,
sizeof(queries));
if (retval != sizeof(queries)) {
-   dev_err(client-dev, %s:read function query registers\n,
-   __func__);
+   dev_err(client-dev, read function query registers\n);
return retval;
}
/*
@@ -670,16 +666,14 @@ static int synaptics_rmi4_touchpad_config(struct 
synaptics_rmi4_data *pdata,
rfi-fn_desc.query_base_addr,
data, QUERY_LEN);
if (retval != QUERY_LEN)
-   dev_err(client-dev, %s:read query registers failed\n,
-   __func__);
+   dev_err(client-dev, read query registers failed\n);
else {
retval = synaptics_rmi4_i2c_block_read(pdata,
rfi-fn_desc.ctrl_base_addr,
data, DATA_BUF_LEN);
if (retval != DATA_BUF_LEN) {
dev_err(client-dev,
-   %s:read control registers failed\n,
-   __func__);
+   read control registers failed\n);
return retval;
}
/* Store these for use later*/
@@ -727,7 +721,7 @@ static int synaptics_rmi4_i2c_query_device(struct 
synaptics_rmi4_data *pdata)
sizeof(rmi_fd));
if (retval != sizeof(rmi_fd)) {
/* failed to read next PDT entry */
-   dev_err(client-dev, %s: read error\n, __func__

Re: [PATCH] staging: wlan-ng: remove unused debug macro

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, Jun 17, 2015 at 09:40:42PM -0700, gre...@linuxfoundation.org wrote:
 On Tue, Jun 16, 2015 at 05:09:35AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote:
   On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath 
   (H.) wrote:
From: Hari Prasath Gujulan Elango hguju...@visteon.com

Thi patch removes ununsed debug macro and its references in this
file.The macro is used around pr_debug which itself can be dynamically
enabled/disabled.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wlan-ng/p80211wep.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c 
b/drivers/staging/wlan-ng/p80211wep.c
index c4fabad..f1afd0e 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -53,7 +53,6 @@
 #include linux/random.h
 #include linux/kernel.h
 
-/* #define WEP_DEBUG   */
 
 #include p80211hdr.h
 #include p80211types.h
@@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int 
keynum, u8 *key, int keylen)
if (keynum = NUM_WEPKEYS)
return -1;
 
-#ifdef WEP_DEBUG
pr_debug(WEP key %d len %d = %*phC\n, keynum, keylen,
  8, key);
-#endif
   
   You just added this to the driver now, not what you were saying you were
   doing :(
  
  Greg,if my understanding is correct,do you mean to say that by 
  removing the MACRO WEP_DEBUG which is not defined,this patch adds the
  dynamic debug statements in the driver?
 
 Yes.
 
  As we know that pr_debug is
  something that can be dynamically enable/disable during runtime,then
  why to have a MACRO which can enable/disable statically ?Please 
  correct me I am wrong.
 
 Why not just delete these as obviously they are not being used?
 
 thanks,
 
 greg k-h

Sorry I will send a new patch as title differs.Please drop this one.

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


[PATCH] staging: wlan-ng: Remove ununsed debug print associated macro

2015-06-18 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removed a undefined macro and debug prints associated with
it.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wlan-ng/p80211wep.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c 
b/drivers/staging/wlan-ng/p80211wep.c
index c4fabad..c363456 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -53,7 +53,6 @@
 #include linux/random.h
 #include linux/kernel.h
 
-/* #define WEP_DEBUG   */
 
 #include p80211hdr.h
 #include p80211types.h
@@ -133,10 +132,6 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8 
*key, int keylen)
if (keynum = NUM_WEPKEYS)
return -1;
 
-#ifdef WEP_DEBUG
-   pr_debug(WEP key %d len %d = %*phC\n, keynum, keylen,
- 8, key);
-#endif
 
wlandev-wep_keylens[keynum] = keylen;
memcpy(wlandev-wep_keys[keynum], key, keylen);
@@ -181,10 +176,6 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, 
int key_override,
 
keylen += 3;/* add in IV bytes */
 
-#ifdef WEP_DEBUG
-   pr_debug(D %d: %*ph (%d %d) %*phC\n, len, 3, key,
- keyidx, keylen, 5, key + 3);
-#endif
 
/* set up the RC4 state */
for (i = 0; i  256; i++)
@@ -258,11 +249,6 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, 
u32 len, int keynum,
 
keylen += 3;/* add in IV bytes */
 
-#ifdef WEP_DEBUG
-   pr_debug(E %d (%d/%d %d) %*ph %*phC\n, len,
- iv[3], keynum, keylen, 3, key, 5, key + 3);
-#endif
-
/* set up the RC4 state */
for (i = 0; i  256; i++)
s[i] = i;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wlan-ng: remove unused debug macro

2015-06-17 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, Jun 17, 2015 at 09:40:42PM -0700, gre...@linuxfoundation.org wrote:
 On Tue, Jun 16, 2015 at 05:09:35AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote:
   On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath 
   (H.) wrote:
From: Hari Prasath Gujulan Elango hguju...@visteon.com

Thi patch removes ununsed debug macro and its references in this
file.The macro is used around pr_debug which itself can be dynamically
enabled/disabled.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wlan-ng/p80211wep.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c 
b/drivers/staging/wlan-ng/p80211wep.c
index c4fabad..f1afd0e 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -53,7 +53,6 @@
 #include linux/random.h
 #include linux/kernel.h
 
-/* #define WEP_DEBUG   */
 
 #include p80211hdr.h
 #include p80211types.h
@@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int 
keynum, u8 *key, int keylen)
if (keynum = NUM_WEPKEYS)
return -1;
 
-#ifdef WEP_DEBUG
pr_debug(WEP key %d len %d = %*phC\n, keynum, keylen,
  8, key);
-#endif
   
   You just added this to the driver now, not what you were saying you were
   doing :(
  
  Greg,if my understanding is correct,do you mean to say that by 
  removing the MACRO WEP_DEBUG which is not defined,this patch adds the
  dynamic debug statements in the driver?
 
 Yes.
 
  As we know that pr_debug is
  something that can be dynamically enable/disable during runtime,then
  why to have a MACRO which can enable/disable statically ?Please 
  correct me I am wrong.
 
 Why not just delete these as obviously they are not being used?
 
 thanks,
 
 greg k-h

Thanks Greg.Yes I will remove the macro as well as the debug prints
which aren't used and resend v2.

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


Re: [PATCH] staging: comedi: fix warning to use BIT Macro

2015-06-17 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 16, 2015 at 05:07:22PM +0100, Ian Abbott wrote:
 On 16/06/15 15:22, Gujulan Elango, Hari Prasath (H.) wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch fixes the checkpatch warning that suggests to use the BIT
 macro for the shifting operation.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 ---
   drivers/staging/comedi/comedi.h | 10 +-
   1 file changed, 5 insertions(+), 5 deletions(-)
 
 The comedi.h file is intended to end up in include/uapi/linux/
 eventually, and I don't think the BIT macro is supposed to be used
 there.
 
 -- 
 -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
 -=(  Web: http://www.mev.co.uk/  )=-

Ok.We will drop this one.

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


[PATCH] staging: slicoss: remove unused macro

2015-06-17 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes a couple of ununsed MACRO's in this header file

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/slicoss/slic.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 67a8c9e..00b8af6 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -514,8 +514,6 @@ struct adapter {
 #define FLUSH  true
 #define DONT_FLUSH false
 
-#define SIOCSLICDUMPCARD (SIOCDEVPRIVATE+9)
 #define SIOCSLICSETINTAGG(SIOCDEVPRIVATE+10)
-#define SIOCSLICTRACEDUMP(SIOCDEVPRIVATE+11)
 
 #endif /*  __SLIC_DRIVER_H__ */
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: fix warning to use BIT Macro

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch fixes the checkpatch warning that suggests to use the BIT
macro for the shifting operation.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/comedi/comedi.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 66edda1..169328c 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -72,12 +72,12 @@
 #define CR_AREF(a) (((a)24)0x03)
 
 #define CR_FLAGS_MASK  0xfc00
-#define CR_ALT_FILTER  (126)
+#define CR_ALT_FILTER  BIT(26)
 #define CR_DITHER  CR_ALT_FILTER
 #define CR_DEGLITCHCR_ALT_FILTER
-#define CR_ALT_SOURCE  (127)
-#define CR_EDGE(130)
-#define CR_INVERT  (131)
+#define CR_ALT_SOURCE  BIT(27)
+#define CR_EDGEBIT(30)
+#define CR_INVERT  BIT(31)
 
 #define AREF_GROUND0x00/* analog ref = analog ground */
 #define AREF_COMMON0x01/* analog ref = analog common */
@@ -508,7 +508,7 @@ struct comedi_bufinfo {
 #define RANGE_LENGTH(b)((b)0x)
 
 #define RF_UNIT(flags) ((flags)0xff)
-#define RF_EXTERNAL(18)
+#define RF_EXTERNALBIT(8)
 
 #define UNIT_volt  0
 #define UNIT_mA1
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: use meaningful variable name

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 16, 2015 at 02:04:21PM +0100, Ian Abbott wrote:
 On 16/06/15 06:34, Gujulan Elango, Hari Prasath (H.) wrote:
 On Mon, Jun 15, 2015 at 03:42:07PM +0100, Ian Abbott wrote:
 On 15/06/15 15:01, Gujulan Elango, Hari Prasath (H.) wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch renames the very generic variable name 'todo' to
 num_samples_to_read.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 [snip]
 I don't see anything particularly wrong with the old name, but the
 new name is a bit long.  Most of the comedi drivers seem to use the
 name 'nsamples' for this.
 
 I will leave it to you to decide on this.Should I resend the patch with
 a shorter variable name as 'nsamples' or leave it undisturbed and drop
 this patch.
 
 I'm happy either way, but if you're going to repost it, please
 improve the subject line as well to localize the patch better.
 Maybe something like:
 
 staging: comedi: amplc_pci230: rename 'todo' variable
 
 -- 
 -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
 -=(  Web: http://www.mev.co.uk/  )=-

Sorry that won't be a v2.It will be a new patch as subject line
changes.Please discard this one.

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


Re: [PATCH] staging: comedi: use meaningful variable name

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 16, 2015 at 02:04:21PM +0100, Ian Abbott wrote:
 On 16/06/15 06:34, Gujulan Elango, Hari Prasath (H.) wrote:
 On Mon, Jun 15, 2015 at 03:42:07PM +0100, Ian Abbott wrote:
 On 15/06/15 15:01, Gujulan Elango, Hari Prasath (H.) wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch renames the very generic variable name 'todo' to
 num_samples_to_read.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 [snip]
 I don't see anything particularly wrong with the old name, but the
 new name is a bit long.  Most of the comedi drivers seem to use the
 name 'nsamples' for this.
 
 I will leave it to you to decide on this.Should I resend the patch with
 a shorter variable name as 'nsamples' or leave it undisturbed and drop
 this patch.
 
 I'm happy either way, but if you're going to repost it, please
 improve the subject line as well to localize the patch better.
 Maybe something like:
 
 staging: comedi: amplc_pci230: rename 'todo' variable
 
 -- 
 -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
 -=(  Web: http://www.mev.co.uk/  )=-

To keep myself also happy,I will send a v2 with subject line changed as
you suggested.

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


[PATCH] staging: comedi: amplc_pci230: rename 'todo' variable

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch renames the very generic variable name 'todo' to
nsamples.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
Subject line modified and variable name kept short as per
suggestion from Ian Abbott.
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
b/drivers/staging/comedi/drivers/amplc_pci230.c
index 20d5920..42e4923 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -2011,17 +2011,17 @@ static void pci230_handle_ai(struct comedi_device *dev,
struct comedi_cmd *cmd = async-cmd;
unsigned int status_fifo;
unsigned int i;
-   unsigned int todo;
+   unsigned int nsamples;
unsigned int fifoamount;
unsigned short val;
 
/* Determine number of samples to read. */
-   todo = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
-   if (todo == 0)
+   nsamples = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
+   if (nsamples == 0)
return;
 
fifoamount = 0;
-   for (i = 0; i  todo; i++) {
+   for (i = 0; i  nsamples; i++) {
if (fifoamount == 0) {
/* Read FIFO state. */
status_fifo = inw(devpriv-daqio + PCI230_ADCCON);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: use BIT macro for bit shift operation

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch silences the Checkpatch.pl warning 'Prefer using the
BIT macro'

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/comedi/comedidev.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index 28f2606..28a5d3a 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -227,12 +227,12 @@ struct comedi_async {
  * @COMEDI_CB_ERROR_MASK:  events that indicate an error has occurred
  * @COMEDI_CB_CANCEL_MASK: events that will cancel an async command
  */
-#define COMEDI_CB_EOS  (1  0)
-#define COMEDI_CB_EOA  (1  1)
-#define COMEDI_CB_BLOCK(1  2)
-#define COMEDI_CB_EOBUF(1  3)
-#define COMEDI_CB_ERROR(1  4)
-#define COMEDI_CB_OVERFLOW (1  5)
+#define COMEDI_CB_EOS  BIT(0)
+#define COMEDI_CB_EOA  BIT(1)
+#define COMEDI_CB_BLOCKBIT(2)
+#define COMEDI_CB_EOBUFBIT(3)
+#define COMEDI_CB_ERRORBIT(4)
+#define COMEDI_CB_OVERFLOW BIT(5)
 
 #define COMEDI_CB_ERROR_MASK   (COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW)
 #define COMEDI_CB_CANCEL_MASK  (COMEDI_CB_EOA | COMEDI_CB_ERROR_MASK)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: wilc1000: remove unwanted code

2015-06-16 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes SIOCDEVPRIVATE + 1 ioctl.  It currently is just a
stub which does some useless printks and returns.  In the original code,
if the user passes priv_cmd.total_len == 0 then it will Oops.  Also it
leaks memory every time it's called.  In the future, we will implement
this functionality using generic API functions

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
v2: Addressed Dan Carpenters review comments to remove the
entire case statement including the debug print.Also modified the patch
description per his advise.Previously this patch was part of a
patchset,but the other patch got merged.So I am resending this as a
seperate patch as version 2.
---
 drivers/staging/wilc1000/linux_wlan.c | 57 ---
 1 file changed, 57 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index c1e9272..8b755a2 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2393,63 +2393,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq 
*req, int cmd)
#endif
 
switch (cmd) {
-   /* [[ added by tony for SIOCDEVPRIVATE */
-   case SIOCDEVPRIVATE + 1:
-   {
-   android_wifi_priv_cmd priv_cmd;
-
-   PRINT_INFO(GENERIC_DBG, in SIOCDEVPRIVATE+1\n);
-
-   if (copy_from_user(priv_cmd, req-ifr_data, 
sizeof(android_wifi_priv_cmd))) {
-   s32Error = -EFAULT;
-   goto done;
-   }
-
-   buff = kmalloc(priv_cmd.total_len, GFP_KERNEL);
-   if (!buff) {
-   s32Error = -ENOMEM;
-   goto done;
-   }
-
-   if (copy_from_user(buff, priv_cmd.buf, priv_cmd.total_len)) {
-   s32Error = -EFAULT;
-   goto done;
-   }
-
-   PRINT_INFO(GENERIC_DBG, %s: Android private cmd \%s\ on 
%s\n, __FUNCTION__, buff, req-ifr_name);
-
-   if (strncasecmp(buff, SCAN-ACTIVE, strlen(SCAN-ACTIVE)) == 
0) {
-   PRINT_INFO(GENERIC_DBG, %s, SCAN-ACTIVE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, SCAN-PASSIVE, 
strlen(SCAN-PASSIVE)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, SCAN-PASSIVE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-START, 
strlen(RXFILTER-START)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-START command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-STOP, 
strlen(RXFILTER-STOP)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-STOP command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-ADD, 
strlen(RXFILTER-ADD)) == 0)  {
-   int filter_num = *(buff + strlen(RXFILTER-ADD) + 1) - 
'0';
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-ADD command, 
filter_num=%d\n, __FUNCTION__, filter_num);
-   } else if (strncasecmp(buff, RXFILTER-REMOVE, 
strlen(RXFILTER-REMOVE)) == 0)  {
-   int filter_num = *(buff + strlen(RXFILTER-REMOVE) + 
1) - '0';
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-REMOVE command, 
filter_num=%d\n, __FUNCTION__, filter_num);
-   } else if (strncasecmp(buff, BTCOEXSCAN-START, 
strlen(BTCOEXSCAN-START)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXSCAN-START 
command\n, __FUNCTION__);
-   } else if (strncasecmp(buff, BTCOEXSCAN-STOP, 
strlen(BTCOEXSCAN-STOP)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXSCAN-STOP 
command\n, __FUNCTION__);
-   } else if (strncasecmp(buff, BTCOEXMODE, 
strlen(BTCOEXMODE)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXMODE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, SETBAND, strlen(SETBAND)) == 
0)  {
-   uint band = *(buff + strlen(SETBAND) + 1) - '0';
-   PRINT_INFO(GENERIC_DBG, %s, SETBAND command, 
band=%d\n, __FUNCTION__, band);
-   } else if (strncasecmp(buff, GETBAND, strlen(GETBAND)) == 
0)  {
-   PRINT_INFO(GENERIC_DBG, %s, GETBAND command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, COUNTRY, strlen(COUNTRY)) == 
0)  {
-   char *country_code = buff + strlen(COUNTRY) + 1;
-   PRINT_INFO(GENERIC_DBG, %s, COUNTRY command, 
country_code=%s\n, __FUNCTION__, country_code);
-   } else {
-   PRINT_INFO(GENERIC_DBG, %s, Unknown command\n, 
__FUNCTION__);
-   }
-   } break;
 
/* ]] 2013-06-24 */
case SIOCSIWPRIV:
-- 
1.9.1
___
devel mailing list
de

[PATCH] staging: rtl8188eu: fix typo in comments section

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch fixes a typo in the comment section.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/rtl8188eu/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 2e96234..a14e79f 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -773,7 +773,7 @@ void rtw_stop_drv_threads(struct adapter *padapter)
 {
RT_TRACE(_module_os_intfs_c_, _drv_info_, (+rtw_stop_drv_threads\n));
 
-   /* Below is to termindate rtw_cmd_thread  event_thread... */
+   /* Below is to terminate rtw_cmd_thread  event_thread... */
up(padapter-cmdpriv.cmd_queue_sema);
if (padapter-cmdThread)
_rtw_down_sema(padapter-cmdpriv.terminate_cmdthread_sema);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wlan-ng: Replace hard coded values with MACRO's

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch replaces hard coded values with global definitions for the
Ethernet IEEE 802.3 interface defined in standard header file.

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

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index c0e6ac8..49f2ef8 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -129,7 +129,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
} else {
/* step 1: classify ether frame, DIX or 802.3? */
proto = ntohs(e_hdr.type);
-   if (proto = 1500) {
+   if (proto = ETH_DATA_LEN) {
pr_debug(802.3 len: %d\n, skb-len);
/* codes = 1500 reserved for 802.3 lengths */
/* it's 802.3, pass ether payload unchanged,  */
@@ -531,7 +531,7 @@ int p80211_stt_findproto(u16 proto)
   Need to do some testing to confirm.
 */
 
-   if (proto == 0x80f3)/* APPLETALK */
+   if (proto == ETH_P_AARP)/* APPLETALK */
return 1;
 
return 0;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: emxx_udc: remove commented code

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes commented code warned by checkpatch.pl

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/emxx_udc/emxx_udc.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index c19168f..0db6b41 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -32,8 +32,6 @@
 #define UDC_DEBUG_DUMP
 #endif
 
-/* #define USE_INT_COUNT_OVER */
-
 /*- Default define */
 #defineUSE_DMA 1
 #define USE_SUSPEND_WAIT   1
@@ -117,14 +115,6 @@
 #define BIT30  0x4000
 #define BIT31  0x8000
 
-#if 0
-/*--- (0x) USB Control Register */
-#define USBTESTMODE(BIT18+BIT17+BIT16)
-#define TEST_J BIT16
-#define TEST_K BIT17
-#define TEST_SE0_NAK   (BIT17+BIT16)
-#define TEST_PACKETBIT18
-#endif
 #define TEST_FORCE_ENABLE  (BIT18+BIT16)
 
 #define INT_SELBIT10
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: remove commented code

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes commented code.This was a checkpatch warning.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/comedi/comedi_fops.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 146ab00..985d94b 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1085,11 +1085,6 @@ static int do_chaninfo_ioctl(struct comedi_device *dev,
if (put_user(x, it.rangelist + i))
return -EFAULT;
}
-#if 0
-   if (copy_to_user(it.rangelist, s-range_type_list,
-s-n_chan * sizeof(unsigned int)))
-   return -EFAULT;
-#endif
}
 
return 0;
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wlan-ng: remove unused debug macro

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

Thi patch removes ununsed debug macro and its references in this
file.The macro is used around pr_debug which itself can be dynamically
enabled/disabled.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wlan-ng/p80211wep.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c 
b/drivers/staging/wlan-ng/p80211wep.c
index c4fabad..f1afd0e 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -53,7 +53,6 @@
 #include linux/random.h
 #include linux/kernel.h
 
-/* #define WEP_DEBUG   */
 
 #include p80211hdr.h
 #include p80211types.h
@@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8 
*key, int keylen)
if (keynum = NUM_WEPKEYS)
return -1;
 
-#ifdef WEP_DEBUG
pr_debug(WEP key %d len %d = %*phC\n, keynum, keylen,
  8, key);
-#endif
 
wlandev-wep_keylens[keynum] = keylen;
memcpy(wlandev-wep_keys[keynum], key, keylen);
@@ -181,10 +178,8 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, 
int key_override,
 
keylen += 3;/* add in IV bytes */
 
-#ifdef WEP_DEBUG
pr_debug(D %d: %*ph (%d %d) %*phC\n, len, 3, key,
  keyidx, keylen, 5, key + 3);
-#endif
 
/* set up the RC4 state */
for (i = 0; i  256; i++)
@@ -258,10 +253,8 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, 
u32 len, int keynum,
 
keylen += 3;/* add in IV bytes */
 
-#ifdef WEP_DEBUG
pr_debug(E %d (%d/%d %d) %*ph %*phC\n, len,
  iv[3], keynum, keylen, 3, key, 5, key + 3);
-#endif
 
/* set up the RC4 state */
for (i = 0; i  256; i++)
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: use meaningful variable name

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch renames the very generic variable name 'todo' to
num_samples_to_read.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
b/drivers/staging/comedi/drivers/amplc_pci230.c
index 20d5920..b19ab12 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -2011,17 +2011,18 @@ static void pci230_handle_ai(struct comedi_device *dev,
struct comedi_cmd *cmd = async-cmd;
unsigned int status_fifo;
unsigned int i;
-   unsigned int todo;
+   unsigned int num_samples_to_read;
unsigned int fifoamount;
unsigned short val;
 
/* Determine number of samples to read. */
-   todo = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
-   if (todo == 0)
+   num_samples_to_read = comedi_nsamples_left(s,
+   PCI230_ADC_FIFOLEVEL_HALFFULL);
+   if (num_samples_to_read == 0)
return;
 
fifoamount = 0;
-   for (i = 0; i  todo; i++) {
+   for (i = 0; i  num_samples_to_read; i++) {
if (fifoamount == 0) {
/* Read FIFO state. */
status_fifo = inw(devpriv-daqio + PCI230_ADCCON);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: use meaningful variable name

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 15, 2015 at 03:42:07PM +0100, Ian Abbott wrote:
 On 15/06/15 15:01, Gujulan Elango, Hari Prasath (H.) wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch renames the very generic variable name 'todo' to
 num_samples_to_read.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 ---
   drivers/staging/comedi/drivers/amplc_pci230.c | 9 +
   1 file changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
 b/drivers/staging/comedi/drivers/amplc_pci230.c
 index 20d5920..b19ab12 100644
 --- a/drivers/staging/comedi/drivers/amplc_pci230.c
 +++ b/drivers/staging/comedi/drivers/amplc_pci230.c
 @@ -2011,17 +2011,18 @@ static void pci230_handle_ai(struct comedi_device 
 *dev,
  struct comedi_cmd *cmd = async-cmd;
  unsigned int status_fifo;
  unsigned int i;
 -unsigned int todo;
 +unsigned int num_samples_to_read;
  unsigned int fifoamount;
  unsigned short val;
 
  /* Determine number of samples to read. */
 -todo = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
 -if (todo == 0)
 +num_samples_to_read = comedi_nsamples_left(s,
 +PCI230_ADC_FIFOLEVEL_HALFFULL);
 +if (num_samples_to_read == 0)
  return;
 
  fifoamount = 0;
 -for (i = 0; i  todo; i++) {
 +for (i = 0; i  num_samples_to_read; i++) {
  if (fifoamount == 0) {
  /* Read FIFO state. */
  status_fifo = inw(devpriv-daqio + PCI230_ADCCON);
 
 
 I don't see anything particularly wrong with the old name, but the
 new name is a bit long.  Most of the comedi drivers seem to use the
 name 'nsamples' for this.
 
 -- 
 -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
 -=(  Web: http://www.mev.co.uk/  )=-

Thanks for your comments.The name 'todo' was very generic though it does
the job.So I thought of proposing a meaningul name. Yes its bit long

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


Re: [PATCH] staging: comedi: use meaningful variable name

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 15, 2015 at 03:42:07PM +0100, Ian Abbott wrote:
 On 15/06/15 15:01, Gujulan Elango, Hari Prasath (H.) wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch renames the very generic variable name 'todo' to
 num_samples_to_read.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 ---
   drivers/staging/comedi/drivers/amplc_pci230.c | 9 +
   1 file changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
 b/drivers/staging/comedi/drivers/amplc_pci230.c
 index 20d5920..b19ab12 100644
 --- a/drivers/staging/comedi/drivers/amplc_pci230.c
 +++ b/drivers/staging/comedi/drivers/amplc_pci230.c
 @@ -2011,17 +2011,18 @@ static void pci230_handle_ai(struct comedi_device 
 *dev,
  struct comedi_cmd *cmd = async-cmd;
  unsigned int status_fifo;
  unsigned int i;
 -unsigned int todo;
 +unsigned int num_samples_to_read;
  unsigned int fifoamount;
  unsigned short val;
 
  /* Determine number of samples to read. */
 -todo = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
 -if (todo == 0)
 +num_samples_to_read = comedi_nsamples_left(s,
 +PCI230_ADC_FIFOLEVEL_HALFFULL);
 +if (num_samples_to_read == 0)
  return;
 
  fifoamount = 0;
 -for (i = 0; i  todo; i++) {
 +for (i = 0; i  num_samples_to_read; i++) {
  if (fifoamount == 0) {
  /* Read FIFO state. */
  status_fifo = inw(devpriv-daqio + PCI230_ADCCON);
 
 
 I don't see anything particularly wrong with the old name, but the
 new name is a bit long.  Most of the comedi drivers seem to use the
 name 'nsamples' for this.
 
 -- 
 -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
 -=(  Web: http://www.mev.co.uk/  )=-

I will leave it to you to decide on this.Should I resend the patch with
a shorter variable name as 'nsamples' or leave it undisturbed and drop
this patch.

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


Re: [PATCH] staging: wlan-ng: remove unused debug macro

2015-06-15 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 15, 2015 at 09:55:15PM -0700, gre...@linuxfoundation.org wrote:
 On Mon, Jun 15, 2015 at 11:44:24AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  Thi patch removes ununsed debug macro and its references in this
  file.The macro is used around pr_debug which itself can be dynamically
  enabled/disabled.
  
  Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
  ---
   drivers/staging/wlan-ng/p80211wep.c | 7 ---
   1 file changed, 7 deletions(-)
  
  diff --git a/drivers/staging/wlan-ng/p80211wep.c 
  b/drivers/staging/wlan-ng/p80211wep.c
  index c4fabad..f1afd0e 100644
  --- a/drivers/staging/wlan-ng/p80211wep.c
  +++ b/drivers/staging/wlan-ng/p80211wep.c
  @@ -53,7 +53,6 @@
   #include linux/random.h
   #include linux/kernel.h
   
  -/* #define WEP_DEBUG   */
   
   #include p80211hdr.h
   #include p80211types.h
  @@ -133,10 +132,8 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, 
  u8 *key, int keylen)
  if (keynum = NUM_WEPKEYS)
  return -1;
   
  -#ifdef WEP_DEBUG
  pr_debug(WEP key %d len %d = %*phC\n, keynum, keylen,
8, key);
  -#endif
 
 You just added this to the driver now, not what you were saying you were
 doing :(

Greg,if my understanding is correct,do you mean to say that by 
removing the MACRO WEP_DEBUG which is not defined,this patch adds the
dynamic debug statements in the driver? As we know that pr_debug is
something that can be dynamically enable/disable during runtime,then
why to have a MACRO which can enable/disable statically ?Please 
correct me I am wrong.

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


[PATCH] staging: wilc1000: remove timer related OS wrapper functions

2015-06-11 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the timer related wrapper functions
WILC_TimerCreate(),WILC_TimerStart(),WILC_TimerStop() and
WILC_TimerDestroy() and uses kernel API's directly.In the process,the
unused variables,files are also deleted.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/Makefile |   2 +-
 drivers/staging/wilc1000/host_interface.c | 102 ++
 drivers/staging/wilc1000/host_interface.h |   6 +-
 drivers/staging/wilc1000/linux_wlan.c |   4 +-
 drivers/staging/wilc1000/wilc_oswrapper.h |   3 -
 drivers/staging/wilc1000/wilc_platform.h  |   2 -
 drivers/staging/wilc1000/wilc_timer.c |  45 
 drivers/staging/wilc1000/wilc_timer.h | 126 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  29 +++--
 9 files changed, 55 insertions(+), 264 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_timer.c
 delete mode 100644 drivers/staging/wilc1000/wilc_timer.h

diff --git a/drivers/staging/wilc1000/Makefile 
b/drivers/staging/wilc1000/Makefile
index a78c4d5..39e2a3e2 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -27,7 +27,7 @@ ccflags-$(CONFIG_WILC1000_DYNAMICALLY_ALLOCATE_MEMROY) += 
-DWILC_NORMAL_ALLOC
 
 wilc1000-objs := wilc_wfi_netdevice.o wilc_wfi_cfgoperations.o linux_wlan.o 
linux_mon.o \
wilc_memory.o wilc_msgqueue.o wilc_sleep.o 
wilc_strutils.o \
-   wilc_timer.o coreconfigurator.o host_interface.o \
+   coreconfigurator.o host_interface.o \
fifo_buffer.o wilc_sdio.o wilc_spi.o wilc_wlan_cfg.o 
wilc_debugfs.o
 
 wilc1000-$(CONFIG_WILC1000_SDIO) += linux_wlan_sdio.o
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1ecb373..93e86d4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -8,7 +8,7 @@ extern WILC_Sint32 TransportDeInit(void);
 extern u8 connecting;
 
 #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
-extern WILC_TimerHandle hDuringIpTimer;
+extern struct timer_list hDuringIpTimer;
 #endif
 
 extern WILC_Bool bEnablePS;
@@ -550,7 +550,7 @@ static struct semaphore hSemHostIFthrdEnd;
 struct semaphore hSemDeinitDrvHandle;
 static struct semaphore hWaitResponse;
 struct semaphore hSemHostIntDeinit;
-WILC_TimerHandle g_hPeriodicRSSI;
+struct timer_list g_hPeriodicRSSI;
 
 
 
@@ -1383,7 +1383,7 @@ static WILC_Sint32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFs
 
WILC_CATCH(s32Error)
{
-   WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
+   del_timer((pstrWFIDrv-hScanTimer));
/*if there is an ongoing scan request*/
Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
}
@@ -2004,7 +2004,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrH
{
tstrConnectInfo strConnectInfo;
 
-   WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
+   del_timer((pstrWFIDrv-hConnectTimer));
 
PRINT_D(HOSTINF_DBG, could not start connecting to the 
required network\n);
 
@@ -2518,7 +2518,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
}
 
 
-   WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
+   del_timer((pstrWFIDrv-hConnectTimer));

pstrWFIDrv-strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
   
strConnectInfo,
   
u8MacStatus,
@@ -2542,7 +2542,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
PRINT_D(GENERIC_DBG, Obtaining an IP, Disable 
Scan\n);
g_obtainingIP = WILC_TRUE;
-   WILC_TimerStart(hDuringIpTimer, 1, NULL, 
NULL);
+   mod_timer(hDuringIpTimer, (jiffies + 
msecs_to_jiffies(1)));
#endif
 
#ifdef WILC_PARSE_SCAN_IN_HOST
@@ -2597,7 +2597,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
 
if (pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult) {
PRINT_D(HOSTINF_DBG, \n\n Abort the running 
OBSS Scan  \n\n);
-   WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
+   del_timer((pstrWFIDrv-hScanTimer

Re: [PATCH] staging: wilc1000: remove timer related OS wrapper functions

2015-06-11 Thread Gujulan Elango, Hari Prasath (H.)
On Thu, Jun 11, 2015 at 12:35:48PM +, Gujulan Elango, Hari Prasath (H.) 
wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com
 
 This patch removes the timer related wrapper functions
 WILC_TimerCreate(),WILC_TimerStart(),WILC_TimerStop() and
 WILC_TimerDestroy() and uses kernel API's directly.In the process,the
 unused variables,files are also deleted.
 
 Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
 ---
  drivers/staging/wilc1000/host_interface.c | 102 ++
  drivers/staging/wilc1000/host_interface.h |   6 +-
  drivers/staging/wilc1000/linux_wlan.c |   4 +-
  drivers/staging/wilc1000/wilc_oswrapper.h |   3 -
  drivers/staging/wilc1000/wilc_platform.h  |   2 -
  drivers/staging/wilc1000/wilc_timer.c |  45 
  drivers/staging/wilc1000/wilc_timer.h | 126 
 --
  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  29 +++--
  8 files changed, 54 insertions(+), 263 deletions(-)
  delete mode 100644 drivers/staging/wilc1000/wilc_timer.c
  delete mode 100644 drivers/staging/wilc1000/wilc_timer.h
 
 diff --git a/drivers/staging/wilc1000/host_interface.c 
 b/drivers/staging/wilc1000/host_interface.c
 index 1ecb373..93e86d4 100644
 --- a/drivers/staging/wilc1000/host_interface.c
 +++ b/drivers/staging/wilc1000/host_interface.c
 @@ -8,7 +8,7 @@ extern WILC_Sint32 TransportDeInit(void);
  extern u8 connecting;
  
  #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
 -extern WILC_TimerHandle hDuringIpTimer;
 +extern struct timer_list hDuringIpTimer;
  #endif
  
  extern WILC_Bool bEnablePS;
 @@ -550,7 +550,7 @@ static struct semaphore hSemHostIFthrdEnd;
  struct semaphore hSemDeinitDrvHandle;
  static struct semaphore hWaitResponse;
  struct semaphore hSemHostIntDeinit;
 -WILC_TimerHandle g_hPeriodicRSSI;
 +struct timer_list g_hPeriodicRSSI;
  
  
  
 @@ -1383,7 +1383,7 @@ static WILC_Sint32 Handle_Scan(void *drvHandler, 
 tstrHostIFscanAttr *pstrHostIFs
  
   WILC_CATCH(s32Error)
   {
 - WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
 + del_timer((pstrWFIDrv-hScanTimer));
   /*if there is an ongoing scan request*/
   Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
   }
 @@ -2004,7 +2004,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, 
 tstrHostIFconnectAttr *pstrH
   {
   tstrConnectInfo strConnectInfo;
  
 - WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
 + del_timer((pstrWFIDrv-hConnectTimer));
  
   PRINT_D(HOSTINF_DBG, could not start connecting to the 
 required network\n);
  
 @@ -2518,7 +2518,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
 *drvHandler, tstrRcvdGnrlAsyncI
   }
  
  
 - WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
 + del_timer((pstrWFIDrv-hConnectTimer));
   
 pstrWFIDrv-strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
  
 strConnectInfo,
  
 u8MacStatus,
 @@ -2542,7 +2542,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
 *drvHandler, tstrRcvdGnrlAsyncI
   #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
   PRINT_D(GENERIC_DBG, Obtaining an IP, Disable 
 Scan\n);
   g_obtainingIP = WILC_TRUE;
 - WILC_TimerStart(hDuringIpTimer, 1, NULL, 
 NULL);
 + mod_timer(hDuringIpTimer, (jiffies + 
 msecs_to_jiffies(1)));
   #endif
  
   #ifdef WILC_PARSE_SCAN_IN_HOST
 @@ -2597,7 +2597,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
 *drvHandler, tstrRcvdGnrlAsyncI
  
   if (pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult) {
   PRINT_D(HOSTINF_DBG, \n\n Abort the running 
 OBSS Scan  \n\n);
 - WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
 + del_timer((pstrWFIDrv-hScanTimer));
   Handle_ScanDone((void *)pstrWFIDrv, 
 SCAN_EVENT_ABORTED);
   }
  
 @@ -2674,7 +2674,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
 *drvHandler, tstrRcvdGnrlAsyncI
   PRINT_D(HOSTINF_DBG, Received MAC_DISCONNECTED from 
 the FW while scanning\n);
   PRINT_D(HOSTINF_DBG, \n\n Abort the running Scan  
 \n\n);
   /*Abort the running scan*/
 - WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
 + del_timer((pstrWFIDrv-hScanTimer));
   if (pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult) {
   Handle_ScanDone((void *)pstrWFIDrv

[PATCH] staging: wilc1000: remove timer related OS wrapper functions

2015-06-11 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes the timer related wrapper functions
WILC_TimerCreate(),WILC_TimerStart(),WILC_TimerStop() and
WILC_TimerDestroy() and uses kernel API's directly.In the process,the
unused variables,files are also deleted.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/host_interface.c | 102 ++
 drivers/staging/wilc1000/host_interface.h |   6 +-
 drivers/staging/wilc1000/linux_wlan.c |   4 +-
 drivers/staging/wilc1000/wilc_oswrapper.h |   3 -
 drivers/staging/wilc1000/wilc_platform.h  |   2 -
 drivers/staging/wilc1000/wilc_timer.c |  45 
 drivers/staging/wilc1000/wilc_timer.h | 126 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  29 +++--
 8 files changed, 54 insertions(+), 263 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_timer.c
 delete mode 100644 drivers/staging/wilc1000/wilc_timer.h

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1ecb373..93e86d4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -8,7 +8,7 @@ extern WILC_Sint32 TransportDeInit(void);
 extern u8 connecting;
 
 #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
-extern WILC_TimerHandle hDuringIpTimer;
+extern struct timer_list hDuringIpTimer;
 #endif
 
 extern WILC_Bool bEnablePS;
@@ -550,7 +550,7 @@ static struct semaphore hSemHostIFthrdEnd;
 struct semaphore hSemDeinitDrvHandle;
 static struct semaphore hWaitResponse;
 struct semaphore hSemHostIntDeinit;
-WILC_TimerHandle g_hPeriodicRSSI;
+struct timer_list g_hPeriodicRSSI;
 
 
 
@@ -1383,7 +1383,7 @@ static WILC_Sint32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFs
 
WILC_CATCH(s32Error)
{
-   WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
+   del_timer((pstrWFIDrv-hScanTimer));
/*if there is an ongoing scan request*/
Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
}
@@ -2004,7 +2004,7 @@ static WILC_Sint32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrH
{
tstrConnectInfo strConnectInfo;
 
-   WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
+   del_timer((pstrWFIDrv-hConnectTimer));
 
PRINT_D(HOSTINF_DBG, could not start connecting to the 
required network\n);
 
@@ -2518,7 +2518,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
}
 
 
-   WILC_TimerStop((pstrWFIDrv-hConnectTimer), NULL);
+   del_timer((pstrWFIDrv-hConnectTimer));

pstrWFIDrv-strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
   
strConnectInfo,
   
u8MacStatus,
@@ -2542,7 +2542,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
PRINT_D(GENERIC_DBG, Obtaining an IP, Disable 
Scan\n);
g_obtainingIP = WILC_TRUE;
-   WILC_TimerStart(hDuringIpTimer, 1, NULL, 
NULL);
+   mod_timer(hDuringIpTimer, (jiffies + 
msecs_to_jiffies(1)));
#endif
 
#ifdef WILC_PARSE_SCAN_IN_HOST
@@ -2597,7 +2597,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
 
if (pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult) {
PRINT_D(HOSTINF_DBG, \n\n Abort the running 
OBSS Scan  \n\n);
-   WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
+   del_timer((pstrWFIDrv-hScanTimer));
Handle_ScanDone((void *)pstrWFIDrv, 
SCAN_EVENT_ABORTED);
}
 
@@ -2674,7 +2674,7 @@ static WILC_Sint32 Handle_RcvdGnrlAsyncInfo(void 
*drvHandler, tstrRcvdGnrlAsyncI
PRINT_D(HOSTINF_DBG, Received MAC_DISCONNECTED from 
the FW while scanning\n);
PRINT_D(HOSTINF_DBG, \n\n Abort the running Scan  
\n\n);
/*Abort the running scan*/
-   WILC_TimerStop((pstrWFIDrv-hScanTimer), NULL);
+   del_timer((pstrWFIDrv-hScanTimer));
if (pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult) {
Handle_ScanDone((void *)pstrWFIDrv, 
SCAN_EVENT_ABORTED);
 
@@ -3110,7 +3110,7 @@ static void Handle_Disconnect(void *drvHandler

[PATCH 1/2] staging: wilc1000: use memdup_user

2015-06-11 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch replaces the kmalloc followed by copy_from_user by the
wrapper routine memdup_user.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/linux_wlan.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index e92ba59..173b958 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2459,16 +2459,10 @@ int mac_ioctl(struct net_device *ndev, struct ifreq 
*req, int cmd)
size = wrq-u.data.length;
 
if (size  wrq-u.data.pointer) {
-   buff = kmalloc(size, GFP_KERNEL);
-   if (!buff) {
-   s32Error = -ENOMEM;
-   goto done;
-   }
 
-   if (copy_from_user
-   (buff, wrq-u.data.pointer,
-   wrq-u.data.length)) {
-   s32Error = -EFAULT;
+   buff = memdup_user(wrq-u.data.pointer, 
wrq-u.data.length);
+   if (IS_ERR(buff)) {
+   s32Error = PTR_ERR(buff);
goto done;
}
 
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: wilc1000: remove unwanted code

2015-06-11 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch removes code that is unused for any functionality in the
ioctl SIOCDEVPRIVATE + 1.But since it is mentioned in the TODO
list that it needs to be replaced with generic API functions,the
debug print alone is left as it is.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/linux_wlan.c | 53 ---
 1 file changed, 53 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 173b958..fa768f8 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2373,7 +2373,6 @@ int mac_close(struct net_device *ndev)
 
 int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
 {
-
u8 *buff = NULL;
WILC_Sint8 rssi;
WILC_Uint32 size = 0, length = 0;
@@ -2396,59 +2395,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq 
*req, int cmd)
/* [[ added by tony for SIOCDEVPRIVATE */
case SIOCDEVPRIVATE + 1:
{
-   android_wifi_priv_cmd priv_cmd;
-
PRINT_INFO(GENERIC_DBG, in SIOCDEVPRIVATE+1\n);
-
-   if (copy_from_user(priv_cmd, req-ifr_data, 
sizeof(android_wifi_priv_cmd))) {
-   s32Error = -EFAULT;
-   goto done;
-   }
-
-   buff = kmalloc(priv_cmd.total_len, GFP_KERNEL);
-   if (!buff) {
-   s32Error = -ENOMEM;
-   goto done;
-   }
-
-   if (copy_from_user(buff, priv_cmd.buf, priv_cmd.total_len)) {
-   s32Error = -EFAULT;
-   goto done;
-   }
-
-   PRINT_INFO(GENERIC_DBG, %s: Android private cmd \%s\ on 
%s\n, __FUNCTION__, buff, req-ifr_name);
-
-   if (strncasecmp(buff, SCAN-ACTIVE, strlen(SCAN-ACTIVE)) == 
0) {
-   PRINT_INFO(GENERIC_DBG, %s, SCAN-ACTIVE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, SCAN-PASSIVE, 
strlen(SCAN-PASSIVE)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, SCAN-PASSIVE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-START, 
strlen(RXFILTER-START)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-START command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-STOP, 
strlen(RXFILTER-STOP)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-STOP command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, RXFILTER-ADD, 
strlen(RXFILTER-ADD)) == 0)  {
-   int filter_num = *(buff + strlen(RXFILTER-ADD) + 1) - 
'0';
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-ADD command, 
filter_num=%d\n, __FUNCTION__, filter_num);
-   } else if (strncasecmp(buff, RXFILTER-REMOVE, 
strlen(RXFILTER-REMOVE)) == 0)  {
-   int filter_num = *(buff + strlen(RXFILTER-REMOVE) + 
1) - '0';
-   PRINT_INFO(GENERIC_DBG, %s, RXFILTER-REMOVE command, 
filter_num=%d\n, __FUNCTION__, filter_num);
-   } else if (strncasecmp(buff, BTCOEXSCAN-START, 
strlen(BTCOEXSCAN-START)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXSCAN-START 
command\n, __FUNCTION__);
-   } else if (strncasecmp(buff, BTCOEXSCAN-STOP, 
strlen(BTCOEXSCAN-STOP)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXSCAN-STOP 
command\n, __FUNCTION__);
-   } else if (strncasecmp(buff, BTCOEXMODE, 
strlen(BTCOEXMODE)) == 0)  {
-   PRINT_INFO(GENERIC_DBG, %s, BTCOEXMODE command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, SETBAND, strlen(SETBAND)) == 
0)  {
-   uint band = *(buff + strlen(SETBAND) + 1) - '0';
-   PRINT_INFO(GENERIC_DBG, %s, SETBAND command, 
band=%d\n, __FUNCTION__, band);
-   } else if (strncasecmp(buff, GETBAND, strlen(GETBAND)) == 
0)  {
-   PRINT_INFO(GENERIC_DBG, %s, GETBAND command\n, 
__FUNCTION__);
-   } else if (strncasecmp(buff, COUNTRY, strlen(COUNTRY)) == 
0)  {
-   char *country_code = buff + strlen(COUNTRY) + 1;
-   PRINT_INFO(GENERIC_DBG, %s, COUNTRY command, 
country_code=%s\n, __FUNCTION__, country_code);
-   } else {
-   PRINT_INFO(GENERIC_DBG, %s, Unknown command\n, 
__FUNCTION__);
-   }
} break;
 
/* ]] 2013-06-24 */
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 1/2] staging: dgap: cleanup driver module exit and remove function

2015-06-10 Thread Gujulan Elango, Hari Prasath (H.)
On Wed, Jun 10, 2015 at 10:11:37AM +0300, Dan Carpenter wrote:
 I mean, yes, it doesn't seem to make much sense to continue polling
 after all the hardware has been removed.  The problem is that we pass a
 pci_dev pointer to dgap_remove_one() and it ignores it and removes
 everything.
 
 Otherwise, I would probably suggest that it start polling when the first
 hardware is probed and stop when all the hardware is removed.
 
 Also this driver has active maintainers but somehow we have CC'd the
 ATMEL people who maintain a different staging driver...

That was a mistake on my part.I was sending patches to the wilc1000
driver and thats how atmel guys were CC'd by mistake.Thanks Dan for
pointing this out and thanks sudip for copying the correct maintainers.

I will take some time to go through the code/review comments and send
out another version.

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


[PATCH] staging: dgap: do cleanup on module exit

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

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 hguju...@visteon.com
---
 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);
-- 
1.9.1
___
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.)
hguju...@visteon.com wrote:
 From: Hari Prasath Gujulan Elango hguju...@visteon.com

 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 hguju...@visteon.com
 ---
  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: dgnc: do cleanup on module exit

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

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 hguju...@visteon.com
---
 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);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 1/2] staging: dgnc: delete all references to 'flipbuf'

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
On Mon, Jun 08, 2015 at 01:29:30PM -0700, gre...@linuxfoundation.org wrote:
 On Mon, Jun 01, 2015 at 01:06:15PM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  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: Hari Prasath Gujulan Elango hguju...@visteon.com
  ---
   drivers/staging/dgnc/dgnc_driver.c | 9 -
   drivers/staging/dgnc/dgnc_driver.h | 1 -
   2 files changed, 10 deletions(-)
 
 Does not apply :(

Greg I have got a note saying that the same patch I had sent
seperately(this one is part of patchset) got added into staging-next.
Should I discard this.I did a git pull and able to see these changes.

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


[PATCH] staging: wilc1000: fix build warning related to time_after_eq macro

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

This patch fixes a build warning related to the use of the time_after_eq
macro.Adding a typecast to the second argument suppresses the
warning.This warning was created by one my previous patch.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 0db7f3d..0441d7b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -2252,7 +2252,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t 
*buff, uint32_t size)
if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
PRINT_D(GENERIC_DBG, Rx Action Frame Type: %x %x\n, 
buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
-   if (priv-bCfgScanning == WILC_TRUE  
time_after_eq(jiffies, pstrWFIDrv-u64P2p_MgmtTimeout)) {
+   if (priv-bCfgScanning == WILC_TRUE  
time_after_eq(jiffies, (unsigned long)pstrWFIDrv-u64P2p_MgmtTimeout)) {
PRINT_D(GENERIC_DBG, Receiving action frames 
from wrong channels\n);
return;
}
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: move cleanup function to avoid redundancy

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 09, 2015 at 04:51:02PM +0300, Dan Carpenter wrote:
 No.  See my other email.
 
 Also this is super ugly and your instinct should have told you that ugly
 things are normally wrong.
 
 regards,
 dan carpenter
 

Dan,I guess functionality wise this also does the job.Maybe this is
uglier way of doing things.I read your other email and it sounds better
of way cleaning up.Thanks for your comments.I would have to send a new
patch anyways.

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


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

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 09, 2015 at 04:41:33PM +0300, Dan Carpenter wrote:
 On Tue, Jun 09, 2015 at 10:54:02AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  On Tue, Jun 09, 2015 at 03:32:20PM +0530, Sudip Mukherjee wrote:
   On Tue, Jun 09, 2015 at 09:27:22AM +, Gujulan Elango, Hari Prasath 
   (H.) wrote:
From: Hari Prasath Gujulan Elango hguju...@visteon.com

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.
   No. this is wrong. The same thing what dgap_stop() does is being done in
   dgap_remove_one() which is the remove callback. So your patch is trying
   to destroy and unregister something which does not exist at the time 
   dgap_stop()
   will be called.
   
   regards
   sudip

  
  sudip,thanks for your comments.while I agree that my patch does the 
  same thing twice,I see that a similar thing is being done in the 
  failure path of the dgap_init_module().I am referring to the 
  goto err_unregister path where the pci_unregister_driver() and 
  dgap_stop() are invoked in succession.Going by your argument,should we 
  remove the redundant cleanup done in the dgap_stop() function.
 
 dgap_init_module() is done correctly.
 
 The module_exit should mirror the module_init.  dgap_remove_one() should
 mirror dgap_init_one() but instead it removes bits of everything.
 

Currently the module_exit doesn't mirror the module_init.I will address
that.

 /*
  * dgap_cleanup_module()
  *
  * Module unload.  This is where it all ends.
  */
 
 These comments are obvious.  Delete.

Okay I will delete this comment.
 
 static void dgap_cleanup_module(void)
 {
   dgap_remove_driver_sysfiles(dgap_driver);
   pci_unregister_driver(dgap_driver);
   dgap_stop();
 }
 

This piece of code  mirrors the module_init completely.
 But dgap_remove_one() is all kinds of terrible.
 
I will review this function.
 regards,
 dan carpenter
 

My original intent of sending this patch is to remove the cleanup
related stuff that are done twice,once in the driver remove function and
in the module exit.IMHO,the resources that are allocate in the driver
module init function should be cleaned up in the driver exit and it
should be the only place.

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


[PATCH 2/2] staging: dgap: delete obvious comments

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

Deleting obvious comments

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/dgap/dgap.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 185e9e5..03153d8 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7104,8 +7104,6 @@ static void dgap_stop(void)
 
 /*
  * init_module()
- *
- * Module load.  This is where it all starts.
  */
 static int dgap_init_module(void)
 {
@@ -7139,8 +7137,6 @@ err_stop:
 
 /*
  * dgap_cleanup_module()
- *
- * Module unload.  This is where it all ends.
  */
 static void dgap_cleanup_module(void)
 {
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: fix build warning related to time_after_eq macro

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
On Tue, Jun 09, 2015 at 10:41:18AM -0700, gre...@linuxfoundation.org wrote:
 On Tue, Jun 09, 2015 at 06:43:59AM +, Gujulan Elango, Hari Prasath (H.) 
 wrote:
  From: Hari Prasath Gujulan Elango hguju...@visteon.com
  
  This patch fixes a build warning related to the use of the time_after_eq
  macro.Adding a typecast to the second argument suppresses the
  warning.This warning was created by one my previous patch.
  
  Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
  ---
   drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
  b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
  index 0db7f3d..0441d7b 100644
  --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
  +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
  @@ -2252,7 +2252,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t 
  *buff, uint32_t size)
  if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
  PRINT_D(GENERIC_DBG, Rx Action Frame Type: %x %x\n, 
  buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
  -   if (priv-bCfgScanning == WILC_TRUE  
  time_after_eq(jiffies, pstrWFIDrv-u64P2p_MgmtTimeout)) {
  +   if (priv-bCfgScanning == WILC_TRUE  
  time_after_eq(jiffies, (unsigned long)pstrWFIDrv-u64P2p_MgmtTimeout)) {
  PRINT_D(GENERIC_DBG, Receiving action frames 
  from wrong channels\n);
  return;
  }
 
 This patch is corrupted and can not be applied :(
 
 Please fix up and resend.
 
 thanks,
 
 greg k-h

sorry about that Greg.I will check that and send a v2.

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


[PATCH 1/2] staging: dgap: cleanup driver module exit and remove function

2015-06-09 Thread Gujulan Elango, Hari Prasath (H.)
From: Hari Prasath Gujulan Elango hguju...@visteon.com

The driver remove function is not the right place to cleanup resources
allocated in the driver module init.The cleanup is moved from remove
function to module exit as appropriate.

Signed-off-by: Hari Prasath Gujulan Elango hguju...@visteon.com
---
 drivers/staging/dgap/dgap.c | 17 ++---
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 26b0446..185e9e5 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7007,21 +7007,6 @@ static void dgap_cleanup_board(struct board_t *brd)
 static void dgap_remove_one(struct pci_dev *dev)
 {
unsigned int i;
-   ulong lock_flags;
-   struct pci_driver *drv = to_pci_driver(dev-dev.driver);
-
-   spin_lock_irqsave(dgap_poll_lock, lock_flags);
-   dgap_poll_stop = 1;
-   spin_unlock_irqrestore(dgap_poll_lock, lock_flags);
-
-   /* Turn off poller right away. */
-   del_timer_sync(dgap_poll_timer);
-
-   dgap_remove_driver_sysfiles(drv);
-
-   device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
-   class_destroy(dgap_class);
-   unregister_chrdev(DIGI_DGAP_MAJOR, dgap);
 
for (i = 0; i  dgap_numboards; ++i) {
dgap_remove_ports_sysfiles(dgap_board[i]);
@@ -7159,8 +7144,10 @@ err_stop:
  */
 static void dgap_cleanup_module(void)
 {
+   dgap_remove_driver_sysfiles(dgap_driver);
if (dgap_numboards)
pci_unregister_driver(dgap_driver);
+   dgap_stop();
 }
 
 module_init(dgap_init_module);
-- 
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   3   >