All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 12:39 ` anish
  0 siblings, 0 replies; 26+ messages in thread
From: anish @ 2011-06-07 12:39 UTC (permalink / raw)
  To: gregkh, jic23, manuel.stahl, lucas.demarchi
  Cc: devel, linux-kernel, linux-iio

From: anish kumar <anish198519851985@gmail.com>

replaced kmalloc with local variable as I2C(in this case) doesn't require
kmalloc memory it can do with stack memory.

Signed-off-by: anish kumar <anish198519851985@gmail.com>
---
 drivers/staging/iio/adc/max1363_core.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 1037087..9462230 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
 				      unsigned char d2)
 {
 	int ret;
-	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
+	u8 tx_buf[2];
 
-	if (!tx_buf)
-		return -ENOMEM;
 	tx_buf[0] = d1;
 	tx_buf[1] = d2;
 
 	ret = i2c_master_send(client, tx_buf, 2);
-	kfree(tx_buf);
 
 	return (ret > 0) ? 0 : ret;
 }
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 12:39 ` anish
  0 siblings, 0 replies; 26+ messages in thread
From: anish @ 2011-06-07 12:39 UTC (permalink / raw)
  To: gregkh, jic23, manuel.stahl, lucas.demarchi
  Cc: devel, linux-kernel, linux-iio

From: anish kumar <anish198519851985@gmail.com>

replaced kmalloc with local variable as I2C(in this case) doesn't require
kmalloc memory it can do with stack memory.

Signed-off-by: anish kumar <anish198519851985@gmail.com>
---
 drivers/staging/iio/adc/max1363_core.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 1037087..9462230 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
 				      unsigned char d2)
 {
 	int ret;
-	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
+	u8 tx_buf[2];
 
-	if (!tx_buf)
-		return -ENOMEM;
 	tx_buf[0] = d1;
 	tx_buf[1] = d2;
 
 	ret = i2c_master_send(client, tx_buf, 2);
-	kfree(tx_buf);
 
 	return (ret > 0) ? 0 : ret;
 }
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-07 12:39 ` anish
@ 2011-06-07 13:00   ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-07 13:00 UTC (permalink / raw)
  To: anish
  Cc: gregkh, manuel.stahl, lucas.demarchi, devel, linux-kernel,
	linux-iio, Linux I2C

On 06/07/11 13:39, anish wrote:
> From: anish kumar <anish198519851985@gmail.com>
> 
> replaced kmalloc with local variable as I2C(in this case) doesn't require
> kmalloc memory it can do with stack memory.
I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
dma safe buffers bit...
> 
> Signed-off-by: anish kumar <anish198519851985@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> index 1037087..9462230 100644
> --- a/drivers/staging/iio/adc/max1363_core.c
> +++ b/drivers/staging/iio/adc/max1363_core.c
> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
>  				      unsigned char d2)
>  {
>  	int ret;
> -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
> +	u8 tx_buf[2];
>  
> -	if (!tx_buf)
> -		return -ENOMEM;
>  	tx_buf[0] = d1;
>  	tx_buf[1] = d2;
>  
>  	ret = i2c_master_send(client, tx_buf, 2);
> -	kfree(tx_buf);
>  
>  	return (ret > 0) ? 0 : ret;
>  }


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 13:00   ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-07 13:00 UTC (permalink / raw)
  To: anish
  Cc: gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On 06/07/11 13:39, anish wrote:
> From: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> replaced kmalloc with local variable as I2C(in this case) doesn't require
> kmalloc memory it can do with stack memory.
I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
dma safe buffers bit...
> 
> Signed-off-by: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
> ---
>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> index 1037087..9462230 100644
> --- a/drivers/staging/iio/adc/max1363_core.c
> +++ b/drivers/staging/iio/adc/max1363_core.c
> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
>  				      unsigned char d2)
>  {
>  	int ret;
> -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
> +	u8 tx_buf[2];
>  
> -	if (!tx_buf)
> -		return -ENOMEM;
>  	tx_buf[0] = d1;
>  	tx_buf[1] = d2;
>  
>  	ret = i2c_master_send(client, tx_buf, 2);
> -	kfree(tx_buf);
>  
>  	return (ret > 0) ? 0 : ret;
>  }

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 13:41     ` Ben Dooks
  0 siblings, 0 replies; 26+ messages in thread
From: Ben Dooks @ 2011-06-07 13:41 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: anish, gregkh, manuel.stahl, lucas.demarchi, devel, linux-kernel,
	linux-iio, Linux I2C

On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
> On 06/07/11 13:39, anish wrote:
> > From: anish kumar <anish198519851985@gmail.com>
> > 
> > replaced kmalloc with local variable as I2C(in this case) doesn't require
> > kmalloc memory it can do with stack memory.
> I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
> dma safe buffers bit...

No, it is down to the i2c driver, and from recollection dma from stack is
not recommended, due to things like cache line alignment. Please do not
do this.
 
> > Signed-off-by: anish kumar <anish198519851985@gmail.com>
> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> > ---
> >  drivers/staging/iio/adc/max1363_core.c |    5 +----
> >  1 files changed, 1 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> > index 1037087..9462230 100644
> > --- a/drivers/staging/iio/adc/max1363_core.c
> > +++ b/drivers/staging/iio/adc/max1363_core.c
> > @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
> >  				      unsigned char d2)
> >  {
> >  	int ret;
> > -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
> > +	u8 tx_buf[2];
> >  
> > -	if (!tx_buf)
> > -		return -ENOMEM;
> >  	tx_buf[0] = d1;
> >  	tx_buf[1] = d2;
> >  
> >  	ret = i2c_master_send(client, tx_buf, 2);
> > -	kfree(tx_buf);
> >  
> >  	return (ret > 0) ? 0 : ret;
> >  }
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Dooks, ben@fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 13:41     ` Ben Dooks
  0 siblings, 0 replies; 26+ messages in thread
From: Ben Dooks @ 2011-06-07 13:41 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: anish, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
> On 06/07/11 13:39, anish wrote:
> > From: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > replaced kmalloc with local variable as I2C(in this case) doesn't require
> > kmalloc memory it can do with stack memory.
> I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
> dma safe buffers bit...

No, it is down to the i2c driver, and from recollection dma from stack is
not recommended, due to things like cache line alignment. Please do not
do this.
 
> > Signed-off-by: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
> > ---
> >  drivers/staging/iio/adc/max1363_core.c |    5 +----
> >  1 files changed, 1 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> > index 1037087..9462230 100644
> > --- a/drivers/staging/iio/adc/max1363_core.c
> > +++ b/drivers/staging/iio/adc/max1363_core.c
> > @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
> >  				      unsigned char d2)
> >  {
> >  	int ret;
> > -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
> > +	u8 tx_buf[2];
> >  
> > -	if (!tx_buf)
> > -		return -ENOMEM;
> >  	tx_buf[0] = d1;
> >  	tx_buf[1] = d2;
> >  
> >  	ret = i2c_master_send(client, tx_buf, 2);
> > -	kfree(tx_buf);
> >  
> >  	return (ret > 0) ? 0 : ret;
> >  }
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Dooks, ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 13:54       ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-07 13:54 UTC (permalink / raw)
  To: Ben Dooks
  Cc: anish, gregkh, manuel.stahl, lucas.demarchi, devel, linux-kernel,
	linux-iio, Linux I2C

On 06/07/11 14:41, Ben Dooks wrote:
> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>> On 06/07/11 13:39, anish wrote:
>>> From: anish kumar <anish198519851985@gmail.com>
>>>
>>> replaced kmalloc with local variable as I2C(in this case) doesn't require
>>> kmalloc memory it can do with stack memory.
>> I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
>> dma safe buffers bit...
> 
> No, it is down to the i2c driver, and from recollection dma from stack is
> not recommended, due to things like cache line alignment. Please do not
> do this.
Then lets drop this.  Sorry Anish, seems I led you down the garden path.
I'll check all my i2c drivers don't do this...
>  
>>> Signed-off-by: anish kumar <anish198519851985@gmail.com>
>> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
>>> ---
>>>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
>>> index 1037087..9462230 100644
>>> --- a/drivers/staging/iio/adc/max1363_core.c
>>> +++ b/drivers/staging/iio/adc/max1363_core.c
>>> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
>>>  				      unsigned char d2)
>>>  {
>>>  	int ret;
>>> -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
>>> +	u8 tx_buf[2];
>>>  
>>> -	if (!tx_buf)
>>> -		return -ENOMEM;
>>>  	tx_buf[0] = d1;
>>>  	tx_buf[1] = d2;
>>>  
>>>  	ret = i2c_master_send(client, tx_buf, 2);
>>> -	kfree(tx_buf);
>>>  
>>>  	return (ret > 0) ? 0 : ret;
>>>  }
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 13:54       ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-07 13:54 UTC (permalink / raw)
  To: Ben Dooks
  Cc: anish, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On 06/07/11 14:41, Ben Dooks wrote:
> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>> On 06/07/11 13:39, anish wrote:
>>> From: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>
>>> replaced kmalloc with local variable as I2C(in this case) doesn't require
>>> kmalloc memory it can do with stack memory.
>> I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
>> dma safe buffers bit...
> 
> No, it is down to the i2c driver, and from recollection dma from stack is
> not recommended, due to things like cache line alignment. Please do not
> do this.
Then lets drop this.  Sorry Anish, seems I led you down the garden path.
I'll check all my i2c drivers don't do this...
>  
>>> Signed-off-by: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Acked-by: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
>>> ---
>>>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
>>> index 1037087..9462230 100644
>>> --- a/drivers/staging/iio/adc/max1363_core.c
>>> +++ b/drivers/staging/iio/adc/max1363_core.c
>>> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct i2c_client *client,
>>>  				      unsigned char d2)
>>>  {
>>>  	int ret;
>>> -	u8 *tx_buf = kmalloc(2, GFP_KERNEL);
>>> +	u8 tx_buf[2];
>>>  
>>> -	if (!tx_buf)
>>> -		return -ENOMEM;
>>>  	tx_buf[0] = d1;
>>>  	tx_buf[1] = d2;
>>>  
>>>  	ret = i2c_master_send(client, tx_buf, 2);
>>> -	kfree(tx_buf);
>>>  
>>>  	return (ret > 0) ? 0 : ret;
>>>  }
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 14:02       ` Jean Delvare
  0 siblings, 0 replies; 26+ messages in thread
From: Jean Delvare @ 2011-06-07 14:02 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Jonathan Cameron, anish, gregkh, manuel.stahl, lucas.demarchi,
	devel, linux-kernel, linux-iio, Linux I2C

On Tue, 7 Jun 2011 14:41:35 +0100, Ben Dooks wrote:
> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
> > On 06/07/11 13:39, anish wrote:
> > > From: anish kumar <anish198519851985@gmail.com>
> > > 
> > > replaced kmalloc with local variable as I2C(in this case) doesn't require
> > > kmalloc memory it can do with stack memory.
> > I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
> > dma safe buffers bit...
> 
> No, it is down to the i2c driver, and from recollection dma from stack is
> not recommended, due to things like cache line alignment. Please do not
> do this.

To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
device driver. So the patch is correct.

Keep in mind that not all I2C/SMBus controllers care about DMA. In fact,
most don't (at least in the set I am maintaining - might be different
an embedded.) So calling kmalloc for every transfer in every I2C device
driver "just in case" is very much counterproductive.

And, if a controller does DMA and needs well-aligned, dynamically
allocated buffer, its driver would hopefully allocate the buffer ONCE
and keep it around, rather than reallocating it for every transfer.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 14:02       ` Jean Delvare
  0 siblings, 0 replies; 26+ messages in thread
From: Jean Delvare @ 2011-06-07 14:02 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Jonathan Cameron, anish, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On Tue, 7 Jun 2011 14:41:35 +0100, Ben Dooks wrote:
> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
> > On 06/07/11 13:39, anish wrote:
> > > From: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > 
> > > replaced kmalloc with local variable as I2C(in this case) doesn't require
> > > kmalloc memory it can do with stack memory.
> > I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't need
> > dma safe buffers bit...
> 
> No, it is down to the i2c driver, and from recollection dma from stack is
> not recommended, due to things like cache line alignment. Please do not
> do this.

To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
device driver. So the patch is correct.

Keep in mind that not all I2C/SMBus controllers care about DMA. In fact,
most don't (at least in the set I am maintaining - might be different
an embedded.) So calling kmalloc for every transfer in every I2C device
driver "just in case" is very much counterproductive.

And, if a controller does DMA and needs well-aligned, dynamically
allocated buffer, its driver would hopefully allocate the buffer ONCE
and keep it around, rather than reallocating it for every transfer.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 14:04         ` Hennerich, Michael
  0 siblings, 0 replies; 26+ messages in thread
From: Hennerich, Michael @ 2011-06-07 14:04 UTC (permalink / raw)
  To: Jonathan Cameron, Ben Dooks
  Cc: anish, gregkh, manuel.stahl, lucas.demarchi, devel, linux-kernel,
	linux-iio, Linux I2C

Jonathan Cameron wrote on 2011-06-07:
> On 06/07/11 14:41, Ben Dooks wrote:
>> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>>> On 06/07/11 13:39, anish wrote:
>>>> From: anish kumar <anish198519851985@gmail.com>
>>>>
>>>> replaced kmalloc with local variable as I2C(in this case) doesn't
>>>> require kmalloc memory it can do with stack memory.
>>> I've cc'd linux-i2c just to check I'm right about the whole i2c
>>> doesn't need dma safe buffers bit...
>>
>> No, it is down to the i2c driver, and from recollection dma from stack
>> is not recommended, due to things like cache line alignment. Please do
>> not do this.
> Then lets drop this.  Sorry Anish, seems I led you down the garden path.
> I'll check all my i2c drivers don't do this...

Can you point to a i2c bus driver that does dma and uses the buffer from the
client directly?

>>
>>>> Signed-off-by: anish kumar <anish198519851985@gmail.com> Acked-by:
>>>> Jonathan Cameron <jic23@cam.ac.uk> ---
>>>>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>>>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>>> diff --git a/drivers/staging/iio/adc/max1363_core.c
>>>> b/drivers/staging/iio/adc/max1363_core.c
>>>> index 1037087..9462230 100644
>>>> --- a/drivers/staging/iio/adc/max1363_core.c
>>>> +++ b/drivers/staging/iio/adc/max1363_core.c
>>>> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct
> i2c_client *client,
>>>>                                  unsigned char d2)
>>>>  {
>>>>    int ret;
>>>> -  u8 *tx_buf = kmalloc(2, GFP_KERNEL);
>>>> +  u8 tx_buf[2];
>>>>
>>>> -  if (!tx_buf)
>>>> -          return -ENOMEM;
>>>>    tx_buf[0] = d1;
>>>>    tx_buf[1] = d2;
>>>>
>>>>    ret = i2c_master_send(client, tx_buf, 2);
>>>> -  kfree(tx_buf);
>>>>
>>>>    return (ret > 0) ? 0 : ret;
>>>>  }
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-i2c"
>>> in the body of a message to majordomo@vger.kernel.org More
>>> majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif




^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 14:04         ` Hennerich, Michael
  0 siblings, 0 replies; 26+ messages in thread
From: Hennerich, Michael @ 2011-06-07 14:04 UTC (permalink / raw)
  To: Jonathan Cameron, Ben Dooks
  Cc: anish, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

Jonathan Cameron wrote on 2011-06-07:
> On 06/07/11 14:41, Ben Dooks wrote:
>> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>>> On 06/07/11 13:39, anish wrote:
>>>> From: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>
>>>> replaced kmalloc with local variable as I2C(in this case) doesn't
>>>> require kmalloc memory it can do with stack memory.
>>> I've cc'd linux-i2c just to check I'm right about the whole i2c
>>> doesn't need dma safe buffers bit...
>>
>> No, it is down to the i2c driver, and from recollection dma from stack
>> is not recommended, due to things like cache line alignment. Please do
>> not do this.
> Then lets drop this.  Sorry Anish, seems I led you down the garden path.
> I'll check all my i2c drivers don't do this...

Can you point to a i2c bus driver that does dma and uses the buffer from the
client directly?

>>
>>>> Signed-off-by: anish kumar <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Acked-by:
>>>> Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org> ---
>>>>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>>>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>>> diff --git a/drivers/staging/iio/adc/max1363_core.c
>>>> b/drivers/staging/iio/adc/max1363_core.c
>>>> index 1037087..9462230 100644
>>>> --- a/drivers/staging/iio/adc/max1363_core.c
>>>> +++ b/drivers/staging/iio/adc/max1363_core.c
>>>> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct
> i2c_client *client,
>>>>                                  unsigned char d2)
>>>>  {
>>>>    int ret;
>>>> -  u8 *tx_buf = kmalloc(2, GFP_KERNEL);
>>>> +  u8 tx_buf[2];
>>>>
>>>> -  if (!tx_buf)
>>>> -          return -ENOMEM;
>>>>    tx_buf[0] = d1;
>>>>    tx_buf[1] = d2;
>>>>
>>>>    ret = i2c_master_send(client, tx_buf, 2);
>>>> -  kfree(tx_buf);
>>>>
>>>>    return (ret > 0) ? 0 : ret;
>>>>  }
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-i2c"
>>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
>>> majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-07 14:04         ` Hennerich, Michael
  0 siblings, 0 replies; 26+ messages in thread
From: Hennerich, Michael @ 2011-06-07 14:04 UTC (permalink / raw)
  To: Jonathan Cameron, Ben Dooks
  Cc: anish, gregkh, manuel.stahl, lucas.demarchi, devel, linux-kernel,
	linux-iio, Linux I2C

Jonathan Cameron wrote on 2011-06-07:
> On 06/07/11 14:41, Ben Dooks wrote:
>> On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>>> On 06/07/11 13:39, anish wrote:
>>>> From: anish kumar <anish198519851985@gmail.com>
>>>>
>>>> replaced kmalloc with local variable as I2C(in this case) doesn't
>>>> require kmalloc memory it can do with stack memory.
>>> I've cc'd linux-i2c just to check I'm right about the whole i2c
>>> doesn't need dma safe buffers bit...
>>
>> No, it is down to the i2c driver, and from recollection dma from stack
>> is not recommended, due to things like cache line alignment. Please do
>> not do this.
> Then lets drop this.  Sorry Anish, seems I led you down the garden path.
> I'll check all my i2c drivers don't do this...

Can you point to a i2c bus driver that does dma and uses the buffer from th=
e
client directly?

>>
>>>> Signed-off-by: anish kumar <anish198519851985@gmail.com> Acked-by:
>>>> Jonathan Cameron <jic23@cam.ac.uk> ---
>>>>  drivers/staging/iio/adc/max1363_core.c |    5 +----
>>>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>>> diff --git a/drivers/staging/iio/adc/max1363_core.c
>>>> b/drivers/staging/iio/adc/max1363_core.c
>>>> index 1037087..9462230 100644
>>>> --- a/drivers/staging/iio/adc/max1363_core.c
>>>> +++ b/drivers/staging/iio/adc/max1363_core.c
>>>> @@ -207,15 +207,12 @@ static int max1363_write_basic_config(struct
> i2c_client *client,
>>>>                                  unsigned char d2)
>>>>  {
>>>>    int ret;
>>>> -  u8 *tx_buf =3D kmalloc(2, GFP_KERNEL);
>>>> +  u8 tx_buf[2];
>>>>
>>>> -  if (!tx_buf)
>>>> -          return -ENOMEM;
>>>>    tx_buf[0] =3D d1;
>>>>    tx_buf[1] =3D d2;
>>>>
>>>>    ret =3D i2c_master_send(client, tx_buf, 2);
>>>> -  kfree(tx_buf);
>>>>
>>>>    return (ret > 0) ? 0 : ret;
>>>>  }
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-i2c"
>>> in the body of a message to majordomo@vger.kernel.org More
>>> majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Gesch=
aeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret=
 Seif

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-07 14:02       ` Jean Delvare
  (?)
@ 2011-06-08  5:11       ` anish singh
  2011-06-09  8:23         ` anish singh
  -1 siblings, 1 reply; 26+ messages in thread
From: anish singh @ 2011-06-08  5:11 UTC (permalink / raw)
  To: Jean Delvare, Jonathan Cameron
  Cc: Ben Dooks, gregkh, manuel.stahl, lucas.demarchi, devel,
	linux-kernel, linux-iio, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org> wrote:

> On Tue, 7 Jun 2011 14:41:35 +0100, Ben Dooks wrote:
> > On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
> > > On 06/07/11 13:39, anish wrote:
> > > > From: anish kumar <anish198519851985@gmail.com>
> > > >
> > > > replaced kmalloc with local variable as I2C(in this case) doesn't
> require
> > > > kmalloc memory it can do with stack memory.
> > > I've cc'd linux-i2c just to check I'm right about the whole i2c doesn't
> need
> > > dma safe buffers bit...
> >
> > No, it is down to the i2c driver, and from recollection dma from stack is
> > not recommended, due to things like cache line alignment. Please do not
> > do this.
>
> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
> device driver. So the patch is correct.
>
I think i can take Jean ack on this?If yes then Joanthan kindly apply
this patch and i think you didn't lead me in wrong way as whatever
said by you is corroborated by jean also i.e. it is I2C bus driver
responsiblity
to care about DMA.

>
> Keep in mind that not all I2C/SMBus controllers care about DMA. In fact,
> most don't (at least in the set I am maintaining - might be different
> an embedded.) So calling kmalloc for every transfer in every I2C device
> driver "just in case" is very much counterproductive.
>
> And, if a controller does DMA and needs well-aligned, dynamically
> allocated buffer, its driver would hopefully allocate the buffer ONCE
> and keep it around, rather than reallocating it for every transfer.
>
> --
> Jean Delvare
>

[-- Attachment #2: Type: text/html, Size: 2269 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-08  5:11       ` anish singh
@ 2011-06-09  8:23         ` anish singh
  2011-06-09  8:29             ` Jean Delvare
  0 siblings, 1 reply; 26+ messages in thread
From: anish singh @ 2011-06-09  8:23 UTC (permalink / raw)
  To: Jean Delvare, Jonathan Cameron
  Cc: Ben Dooks, gregkh, manuel.stahl, lucas.demarchi, devel,
	linux-kernel, linux-iio, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 1787 bytes --]

On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985@gmail.com>wrote:

>
>
>  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org> wrote:
>
>> On Tue, 7 Jun 2011 14:41:35 +0100, Ben Dooks wrote:
>> > On Tue, Jun 07, 2011 at 02:00:23PM +0100, Jonathan Cameron wrote:
>> > > On 06/07/11 13:39, anish wrote:
>> > > > From: anish kumar <anish198519851985@gmail.com>
>> > > >
>> > > > replaced kmalloc with local variable as I2C(in this case) doesn't
>> require
>> > > > kmalloc memory it can do with stack memory.
>> > > I've cc'd linux-i2c just to check I'm right about the whole i2c
>> doesn't need
>> > > dma safe buffers bit...
>> >
>> > No, it is down to the i2c driver, and from recollection dma from stack
>> is
>> > not recommended, due to things like cache line alignment. Please do not
>> > do this.
>>
>> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>> device driver. So the patch is correct.
>>
> I think i can take Jean ack on this?If yes then Joanthan kindly apply
> this patch and i think you didn't lead me in wrong way as whatever
> said by you is corroborated by jean also i.e. it is I2C bus driver
> responsiblity
> to care about DMA.
>
Sorry to ping you again.Can i take your ack on this?

>
>> Keep in mind that not all I2C/SMBus controllers care about DMA. In fact,
>> most don't (at least in the set I am maintaining - might be different
>> an embedded.) So calling kmalloc for every transfer in every I2C device
>> driver "just in case" is very much counterproductive.
>>
>> And, if a controller does DMA and needs well-aligned, dynamically
>> allocated buffer, its driver would hopefully allocate the buffer ONCE
>> and keep it around, rather than reallocating it for every transfer.
>>
>> --
>> Jean Delvare
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2902 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09  8:29             ` Jean Delvare
  0 siblings, 0 replies; 26+ messages in thread
From: Jean Delvare @ 2011-06-09  8:29 UTC (permalink / raw)
  To: anish singh
  Cc: Jonathan Cameron, Ben Dooks, gregkh, manuel.stahl,
	lucas.demarchi, devel, linux-kernel, linux-iio, Linux I2C

On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
> On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985@gmail.com>wrote:
> >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org> wrote:
> >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
> >> device driver. So the patch is correct.
> >>
> > I think i can take Jean ack on this?If yes then Joanthan kindly apply
> > this patch and i think you didn't lead me in wrong way as whatever
> > said by you is corroborated by jean also i.e. it is I2C bus driver
> > responsiblity
> > to care about DMA.
> >
> Sorry to ping you again.Can i take your ack on this?

Yes of course.

Acked-by: Jean Delvare <khali@linux-fr.org>

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09  8:29             ` Jean Delvare
  0 siblings, 0 replies; 26+ messages in thread
From: Jean Delvare @ 2011-06-09  8:29 UTC (permalink / raw)
  To: anish singh
  Cc: Jonathan Cameron, Ben Dooks, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
> On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:
> >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
> >> device driver. So the patch is correct.
> >>
> > I think i can take Jean ack on this?If yes then Joanthan kindly apply
> > this patch and i think you didn't lead me in wrong way as whatever
> > said by you is corroborated by jean also i.e. it is I2C bus driver
> > responsiblity
> > to care about DMA.
> >
> Sorry to ping you again.Can i take your ack on this?

Yes of course.

Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-09  8:29             ` Jean Delvare
  (?)
@ 2011-06-09  8:34             ` anish singh
  2011-06-09  8:48                 ` Jonathan Cameron
  -1 siblings, 1 reply; 26+ messages in thread
From: anish singh @ 2011-06-09  8:34 UTC (permalink / raw)
  To: Jean Delvare, Jonathan Cameron
  Cc: Ben Dooks, gregkh, manuel.stahl, lucas.demarchi, devel,
	linux-kernel, linux-iio, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org> wrote:

> On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
> > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <
> anish198519851985@gmail.com>wrote:
> > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org>
> wrote:
> > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
> > >> device driver. So the patch is correct.
> > >>
> > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
> > > this patch and i think you didn't lead me in wrong way as whatever
> > > said by you is corroborated by jean also i.e. it is I2C bus driver
> > > responsiblity
> > > to care about DMA.
> > >
> > Sorry to ping you again.Can i take your ack on this?
>
> Yes of course.
>
> Acked-by: Jean Delvare <khali@linux-fr.org>
>
Thanks a ton.Jonathan kindly apply it now :)

>
> --
> Jean Delvare
>

[-- Attachment #2: Type: text/html, Size: 1612 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09  8:48                 ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09  8:48 UTC (permalink / raw)
  To: anish singh
  Cc: Jean Delvare, Ben Dooks, gregkh, manuel.stahl, lucas.demarchi,
	devel, linux-kernel, linux-iio, Linux I2C

On 06/09/11 09:34, anish singh wrote:
> 
> 
> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>> wrote:
> 
>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985@gmail.com <mailto:anish198519851985@gmail.com>>wrote:
>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>> wrote:
>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>     > >> device driver. So the patch is correct.
>     > >>
>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>     > > this patch and i think you didn't lead me in wrong way as whatever
>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>     > > responsiblity
>     > > to care about DMA.
>     > >
>     > Sorry to ping you again.Can i take your ack on this?
> 
>     Yes of course.
> 
>     Acked-by: Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>>
> 
> Thanks a ton.Jonathan kindly apply it now :)
Greg, I'll send this one on to you with the set I currently have out for review.

Jonathan

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09  8:48                 ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09  8:48 UTC (permalink / raw)
  To: anish singh
  Cc: Jean Delvare, Ben Dooks, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On 06/09/11 09:34, anish singh wrote:
> 
> 
> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>> wrote:
> 
>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mailto:anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>>wrote:
>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>> wrote:
>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>     > >> device driver. So the patch is correct.
>     > >>
>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>     > > this patch and i think you didn't lead me in wrong way as whatever
>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>     > > responsiblity
>     > > to care about DMA.
>     > >
>     > Sorry to ping you again.Can i take your ack on this?
> 
>     Yes of course.
> 
>     Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>>
> 
> Thanks a ton.Jonathan kindly apply it now :)
Greg, I'll send this one on to you with the set I currently have out for review.

Jonathan

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09 10:46                   ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09 10:46 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: anish singh, Jean Delvare, Ben Dooks, gregkh, manuel.stahl,
	lucas.demarchi, devel, linux-kernel, linux-iio, Linux I2C

On 06/09/11 09:48, Jonathan Cameron wrote:
> On 06/09/11 09:34, anish singh wrote:
>>
>>
>> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>> wrote:
>>
>>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985@gmail.com <mailto:anish198519851985@gmail.com>>wrote:
>>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>> wrote:
>>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>>     > >> device driver. So the patch is correct.
>>     > >>
>>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>>     > > this patch and i think you didn't lead me in wrong way as whatever
>>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>>     > > responsiblity
>>     > > to care about DMA.
>>     > >
>>     > Sorry to ping you again.Can i take your ack on this?
>>
>>     Yes of course.
>>
>>     Acked-by: Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org>>
>>
>> Thanks a ton.Jonathan kindly apply it now :)
> Greg, I'll send this one on to you with the set I currently have out for review.
> 
Doh, after all this, I just tried to apply this to find the code in question has already
gone.  Anish, what tree are you working against? Looks like I did an equivalent clean up
(with a load of others) back in May then forgot about it.

Sorry all. I should have actually have checked it was still relevant rather than reviewing
purely on basis of content of patch...

Jonathan

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09 10:46                   ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09 10:46 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: anish singh, Jean Delvare, Ben Dooks, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On 06/09/11 09:48, Jonathan Cameron wrote:
> On 06/09/11 09:34, anish singh wrote:
>>
>>
>> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>> wrote:
>>
>>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mailto:anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>>wrote:
>>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>> wrote:
>>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>>     > >> device driver. So the patch is correct.
>>     > >>
>>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>>     > > this patch and i think you didn't lead me in wrong way as whatever
>>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>>     > > responsiblity
>>     > > to care about DMA.
>>     > >
>>     > Sorry to ping you again.Can i take your ack on this?
>>
>>     Yes of course.
>>
>>     Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>>
>>
>> Thanks a ton.Jonathan kindly apply it now :)
> Greg, I'll send this one on to you with the set I currently have out for review.
> 
Doh, after all this, I just tried to apply this to find the code in question has already
gone.  Anish, what tree are you working against? Looks like I did an equivalent clean up
(with a load of others) back in May then forgot about it.

Sorry all. I should have actually have checked it was still relevant rather than reviewing
purely on basis of content of patch...

Jonathan

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-09 10:46                   ` Jonathan Cameron
  (?)
@ 2011-06-09 14:29                   ` anish singh
  2011-06-09 14:51                       ` Jonathan Cameron
  -1 siblings, 1 reply; 26+ messages in thread
From: anish singh @ 2011-06-09 14:29 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jean Delvare, Ben Dooks, gregkh, manuel.stahl, lucas.demarchi,
	devel, linux-kernel, linux-iio, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]

On Thu, Jun 9, 2011 at 7:46 PM, Jonathan Cameron <jic23@cam.ac.uk> wrote:

>  On 06/09/11 09:48, Jonathan Cameron wrote:
> > On 06/09/11 09:34, anish singh wrote:
> >>
> >>
> >> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org<mailto:
> khali@linux-fr.org>> wrote:
> >>
> >>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
> >>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <
> anish198519851985@gmail.com <mailto:anish198519851985@gmail.com>>wrote:
> >>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <
> khali@linux-fr.org <mailto:khali@linux-fr.org>> wrote:
> >>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT
> the i2c
> >>     > >> device driver. So the patch is correct.
> >>     > >>
> >>     > > I think i can take Jean ack on this?If yes then Joanthan kindly
> apply
> >>     > > this patch and i think you didn't lead me in wrong way as
> whatever
> >>     > > said by you is corroborated by jean also i.e. it is I2C bus
> driver
> >>     > > responsiblity
> >>     > > to care about DMA.
> >>     > >
> >>     > Sorry to ping you again.Can i take your ack on this?
> >>
> >>     Yes of course.
> >>
> >>     Acked-by: Jean Delvare <khali@linux-fr.org <mailto:
> khali@linux-fr.org>>
> >>
> >> Thanks a ton.Jonathan kindly apply it now :)
> > Greg, I'll send this one on to you with the set I currently have out for
> review.
> >
> Doh, after all this, I just tried to apply this to find the code in
> question has already
> gone.  Anish, what tree are you working against?

I am using linux-next.Is it not the right tree for staging?

> Looks like I did an equivalent clean up
> (with a load of others) back in May then forgot about it.
>
> Sorry all. I should have actually have checked it was still relevant rather
> than reviewing
> purely on basis of content of patch...
>
> Jonathan
>

[-- Attachment #2: Type: text/html, Size: 2996 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09 14:51                       ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09 14:51 UTC (permalink / raw)
  To: anish singh
  Cc: Jean Delvare, Ben Dooks, gregkh, manuel.stahl, lucas.demarchi,
	devel, linux-kernel, linux-iio, Linux I2C

On 06/09/11 15:29, anish singh wrote:
> 
> 
> On Thu, Jun 9, 2011 at 7:46 PM, Jonathan Cameron <jic23@cam.ac.uk <mailto:jic23@cam.ac.uk>> wrote:
> 
>     On 06/09/11 09:48, Jonathan Cameron wrote:
>     > On 06/09/11 09:34, anish singh wrote:
>     >>
>     >>
>     >> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org> <mailto:khali@linux-fr.org <mailto:khali@linux-fr.org>>> wrote:
>     >>
>     >>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>     >>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985@gmail.com <mailto:anish198519851985@gmail.com> <mailto:anish198519851985@gmail.com <mailto:anish198519851985@gmail.com>>>wrote:
>     >>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org> <mailto:khali@linux-fr.org <mailto:khali@linux-fr.org>>> wrote:
>     >>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>     >>     > >> device driver. So the patch is correct.
>     >>     > >>
>     >>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>     >>     > > this patch and i think you didn't lead me in wrong way as whatever
>     >>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>     >>     > > responsiblity
>     >>     > > to care about DMA.
>     >>     > >
>     >>     > Sorry to ping you again.Can i take your ack on this?
>     >>
>     >>     Yes of course.
>     >>
>     >>     Acked-by: Jean Delvare <khali@linux-fr.org <mailto:khali@linux-fr.org> <mailto:khali@linux-fr.org <mailto:khali@linux-fr.org>>>
>     >>
>     >> Thanks a ton.Jonathan kindly apply it now :)
>     > Greg, I'll send this one on to you with the set I currently have out for review.
>     >
>     Doh, after all this, I just tried to apply this to find the code in question has already
>     gone.  Anish, what tree are you working against?
> 
> I am using linux-next.Is it not the right tree for staging?
Something curious is going on then because this code is no longer in linux-next either.
> 
>     Looks like I did an equivalent clean up
>     (with a load of others) back in May then forgot about it.
> 
>     Sorry all. I should have actually have checked it was still relevant rather than reviewing
>     purely on basis of content of patch...
> 
>     Jonathan
> 
> 


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
@ 2011-06-09 14:51                       ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2011-06-09 14:51 UTC (permalink / raw)
  To: anish singh
  Cc: Jean Delvare, Ben Dooks, gregkh-l3A5Bk7waGM,
	manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB,
	lucas.demarchi-Y3ZbgMPKUGA34EUeqzHoZw,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Linux I2C

On 06/09/11 15:29, anish singh wrote:
> 
> 
> On Thu, Jun 9, 2011 at 7:46 PM, Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org <mailto:jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>> wrote:
> 
>     On 06/09/11 09:48, Jonathan Cameron wrote:
>     > On 06/09/11 09:34, anish singh wrote:
>     >>
>     >>
>     >> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>>> wrote:
>     >>
>     >>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
>     >>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mailto:anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> <mailto:anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mailto:anish198519851985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>>>wrote:
>     >>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>>> wrote:
>     >>     > >> To be clearer, it is down to the i2c BUS (adapter) driver, NOT the i2c
>     >>     > >> device driver. So the patch is correct.
>     >>     > >>
>     >>     > > I think i can take Jean ack on this?If yes then Joanthan kindly apply
>     >>     > > this patch and i think you didn't lead me in wrong way as whatever
>     >>     > > said by you is corroborated by jean also i.e. it is I2C bus driver
>     >>     > > responsiblity
>     >>     > > to care about DMA.
>     >>     > >
>     >>     > Sorry to ping you again.Can i take your ack on this?
>     >>
>     >>     Yes of course.
>     >>
>     >>     Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org <mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>>>
>     >>
>     >> Thanks a ton.Jonathan kindly apply it now :)
>     > Greg, I'll send this one on to you with the set I currently have out for review.
>     >
>     Doh, after all this, I just tried to apply this to find the code in question has already
>     gone.  Anish, what tree are you working against?
> 
> I am using linux-next.Is it not the right tree for staging?
Something curious is going on then because this code is no longer in linux-next either.
> 
>     Looks like I did an equivalent clean up
>     (with a load of others) back in May then forgot about it.
> 
>     Sorry all. I should have actually have checked it was still relevant rather than reviewing
>     purely on basis of content of patch...
> 
>     Jonathan
> 
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] staging iio: Replace kmalloc with local variable
  2011-06-09 14:51                       ` Jonathan Cameron
  (?)
@ 2011-06-09 15:03                       ` anish singh
  -1 siblings, 0 replies; 26+ messages in thread
From: anish singh @ 2011-06-09 15:03 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jean Delvare, Ben Dooks, gregkh, manuel.stahl, lucas.demarchi,
	devel, linux-kernel, linux-iio, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 2653 bytes --]

On Thu, Jun 9, 2011 at 11:51 PM, Jonathan Cameron <jic23@cam.ac.uk> wrote:

> On 06/09/11 15:29, anish singh wrote:
> >
> >
> > On Thu, Jun 9, 2011 at 7:46 PM, Jonathan Cameron <jic23@cam.ac.uk<mailto:
> jic23@cam.ac.uk>> wrote:
> >
> >     On 06/09/11 09:48, Jonathan Cameron wrote:
> >     > On 06/09/11 09:34, anish singh wrote:
> >     >>
> >     >>
> >     >> On Thu, Jun 9, 2011 at 1:59 PM, Jean Delvare <khali@linux-fr.org<mailto:
> khali@linux-fr.org> <mailto:khali@linux-fr.org <mailto:khali@linux-fr.org>>>
> wrote:
> >     >>
> >     >>     On Thu, 9 Jun 2011 13:53:09 +0530, anish singh wrote:
> >     >>     > On Wed, Jun 8, 2011 at 10:41 AM, anish singh <
> anish198519851985@gmail.com <mailto:anish198519851985@gmail.com> <mailto:
> anish198519851985@gmail.com <mailto:anish198519851985@gmail.com>>>wrote:
> >     >>     > >  On Tue, Jun 7, 2011 at 7:32 PM, Jean Delvare <
> khali@linux-fr.org <mailto:khali@linux-fr.org> <mailto:khali@linux-fr.org<mailto:
> khali@linux-fr.org>>> wrote:
> >     >>     > >> To be clearer, it is down to the i2c BUS (adapter)
> driver, NOT the i2c
> >     >>     > >> device driver. So the patch is correct.
> >     >>     > >>
> >     >>     > > I think i can take Jean ack on this?If yes then Joanthan
> kindly apply
> >     >>     > > this patch and i think you didn't lead me in wrong way as
> whatever
> >     >>     > > said by you is corroborated by jean also i.e. it is I2C
> bus driver
> >     >>     > > responsiblity
> >     >>     > > to care about DMA.
> >     >>     > >
> >     >>     > Sorry to ping you again.Can i take your ack on this?
> >     >>
> >     >>     Yes of course.
> >     >>
> >     >>     Acked-by: Jean Delvare <khali@linux-fr.org <mailto:
> khali@linux-fr.org> <mailto:khali@linux-fr.org <mailto:khali@linux-fr.org
> >>>
> >     >>
> >     >> Thanks a ton.Jonathan kindly apply it now :)
> >     > Greg, I'll send this one on to you with the set I currently have
> out for review.
> >     >
> >     Doh, after all this, I just tried to apply this to find the code in
> question has already
> >     gone.  Anish, what tree are you working against?
> >
> > I am using linux-next.Is it not the right tree for staging?
> Something curious is going on then because this code is no longer in
> linux-next either.
>
Even checked it now it is not there.Will check, thanks.

>  >
> >     Looks like I did an equivalent clean up
> >     (with a load of others) back in May then forgot about it.
> >
> >     Sorry all. I should have actually have checked it was still relevant
> rather than reviewing
> >     purely on basis of content of patch...
> >
> >     Jonathan
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 4533 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-06-09 15:03 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 12:39 [PATCH] staging iio: Replace kmalloc with local variable anish
2011-06-07 12:39 ` anish
2011-06-07 13:00 ` Jonathan Cameron
2011-06-07 13:00   ` Jonathan Cameron
2011-06-07 13:41   ` Ben Dooks
2011-06-07 13:41     ` Ben Dooks
2011-06-07 13:54     ` Jonathan Cameron
2011-06-07 13:54       ` Jonathan Cameron
2011-06-07 14:04       ` Hennerich, Michael
2011-06-07 14:04         ` Hennerich, Michael
2011-06-07 14:04         ` Hennerich, Michael
2011-06-07 14:02     ` Jean Delvare
2011-06-07 14:02       ` Jean Delvare
2011-06-08  5:11       ` anish singh
2011-06-09  8:23         ` anish singh
2011-06-09  8:29           ` Jean Delvare
2011-06-09  8:29             ` Jean Delvare
2011-06-09  8:34             ` anish singh
2011-06-09  8:48               ` Jonathan Cameron
2011-06-09  8:48                 ` Jonathan Cameron
2011-06-09 10:46                 ` Jonathan Cameron
2011-06-09 10:46                   ` Jonathan Cameron
2011-06-09 14:29                   ` anish singh
2011-06-09 14:51                     ` Jonathan Cameron
2011-06-09 14:51                       ` Jonathan Cameron
2011-06-09 15:03                       ` anish singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.