All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm5102: Use put_unaligned_be16
@ 2014-12-26  4:44 Vaishali Thakkar
  2014-12-28 11:05 ` Vaishali Thakkar
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Vaishali Thakkar @ 2014-12-26  4:44 UTC (permalink / raw)
  To: broonie; +Cc: Takashi Iwai, alsa-devel

This patch introduces the use of function put_unaligned_be16.

This is done using Coccinelle and semantic patch used is as follows:

@a@
typedef u16, __be16, uint16_t;
{u16,__be16,uint16_t} e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
@@

- tmp = cpu_to_be16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
+ put_unaligned_be16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_be16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 sound/soc/codecs/wm5102.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index f602349..fec21f9 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -28,6 +28,7 @@
 
 #include <linux/mfd/arizona/core.h>
 #include <linux/mfd/arizona/registers.h>
+#include <asm/unaligned.h>
 
 #include "arizona.h"
 #include "wm5102.h"
@@ -617,11 +618,11 @@ static int wm5102_out_comp_coeff_get(struct snd_kcontrol *kcontrol,
 {
 	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
 	struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
-	uint16_t data;
 
 	mutex_lock(&codec->mutex);
-	data = cpu_to_be16(arizona->dac_comp_coeff);
-	memcpy(ucontrol->value.bytes.data, &data, sizeof(data));
+
+	put_unaligned_be16(arizona->dac_comp_coeff,
+			   ucontrol->value.bytes.data);
 	mutex_unlock(&codec->mutex);
 
 	return 0;
-- 
1.9.1

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-26  4:44 [PATCH] ASoC: wm5102: Use put_unaligned_be16 Vaishali Thakkar
@ 2014-12-28 11:05 ` Vaishali Thakkar
  2014-12-29 15:53   ` Mark Brown
  2015-01-07 10:01 ` Charles Keepax
  2015-01-07 17:45 ` Mark Brown
  2 siblings, 1 reply; 11+ messages in thread
From: Vaishali Thakkar @ 2014-12-28 11:05 UTC (permalink / raw)
  To: broonie; +Cc: Takashi Iwai, alsa-devel

On Fri, Dec 26, 2014 at 10:14 AM, Vaishali Thakkar
<vthakkar1994@gmail.com> wrote:
> This patch introduces the use of function put_unaligned_be16.
>
> This is done using Coccinelle and semantic patch used is as follows:
>
> @a@
> typedef u16, __be16, uint16_t;
> {u16,__be16,uint16_t} e16;
> identifier tmp;
> expression ptr;
> expression y,e;
> type T;
> @@
>
> - tmp = cpu_to_be16(y);
>
> <+... when != tmp
> (
> - memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
> + put_unaligned_be16(y,ptr);
> |
> - memcpy(ptr, (T)&tmp, ...);
> + put_unaligned_be16(y,ptr);
> )
> ...+>
> ? tmp = e
>
> @@ type T; identifier a.tmp; @@
>
> - T tmp;
> ...when != tmp
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
>  sound/soc/codecs/wm5102.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
> index f602349..fec21f9 100644
> --- a/sound/soc/codecs/wm5102.c
> +++ b/sound/soc/codecs/wm5102.c
> @@ -28,6 +28,7 @@
>
>  #include <linux/mfd/arizona/core.h>
>  #include <linux/mfd/arizona/registers.h>
> +#include <asm/unaligned.h>
>
>  #include "arizona.h"
>  #include "wm5102.h"
> @@ -617,11 +618,11 @@ static int wm5102_out_comp_coeff_get(struct snd_kcontrol *kcontrol,
>  {
>         struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
>         struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
> -       uint16_t data;
>
>         mutex_lock(&codec->mutex);
> -       data = cpu_to_be16(arizona->dac_comp_coeff);
> -       memcpy(ucontrol->value.bytes.data, &data, sizeof(data));
> +
> +       put_unaligned_be16(arizona->dac_comp_coeff,
> +                          ucontrol->value.bytes.data);
>         mutex_unlock(&codec->mutex);
>
>         return 0;
> --
> 1.9.1
>

Hello...Can someone please review my patch so that I can have idea
about I am on a right way or not??
I think this is missed by developers.

Thank You.

-- 
Vaishali

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-28 11:05 ` Vaishali Thakkar
@ 2014-12-29 15:53   ` Mark Brown
  2014-12-29 16:30     ` Vaishali Thakkar
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2014-12-29 15:53 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 958 bytes --]

On Sun, Dec 28, 2014 at 04:35:00PM +0530, Vaishali Thakkar wrote:
> On Fri, Dec 26, 2014 at 10:14 AM, Vaishali Thakkar
> <vthakkar1994@gmail.com> wrote:
> > This patch introduces the use of function put_unaligned_be16.

> Hello...Can someone please review my patch so that I can have idea
> about I am on a right way or not??
> I think this is missed by developers.

You sent this on the 26th, two days later on the 28th you're demanding a
review and complaining that we've missed this with a top posted quote.
Even during a normal working period this would not be a reasnoable
demand (a couple of weeks is normally a good *lower* limit, people have
vacations and other things to do), and right now we're in the middle of
the time of year when people from western societies typically take
vacation.

This is not a good way to get people to pay attention, and since I don't
want to create the impression that it works I'd not be expecting a quick
response...

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-29 15:53   ` Mark Brown
@ 2014-12-29 16:30     ` Vaishali Thakkar
  2014-12-29 16:57       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Vaishali Thakkar @ 2014-12-29 16:30 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel

On Mon, Dec 29, 2014 at 9:23 PM, Mark Brown <broonie@kernel.org> wrote:
> On Sun, Dec 28, 2014 at 04:35:00PM +0530, Vaishali Thakkar wrote:
>> On Fri, Dec 26, 2014 at 10:14 AM, Vaishali Thakkar
>> <vthakkar1994@gmail.com> wrote:
>> > This patch introduces the use of function put_unaligned_be16.
>
>> Hello...Can someone please review my patch so that I can have idea
>> about I am on a right way or not??
>> I think this is missed by developers.
>
> You sent this on the 26th, two days later on the 28th you're demanding a
> review and complaining that we've missed this with a top posted quote.
> Even during a normal working period this would not be a reasnoable
> demand (a couple of weeks is normally a good *lower* limit, people have
> vacations and other things to do), and right now we're in the middle of
> the time of year when people from western societies typically take
> vacation.

I am really very sorry for this. Actually I am a newbie. I mainly
worked during opw-application period and there we used to work with
staging directory only. This is my first time, I am working with other
parts of kernel. So, I had kind of feeling that I might have done
something wrong that's why I am not getting any comments. But I think
its my fault. I may need to understand workflow of community properly
and I apologizes for that.

> This is not a good way to get people to pay attention, and since I don't
> want to create the impression that it works I'd not be expecting a quick
> response...

I agree. This is definitely not a good way and thanks for your reply.
I get to know about my mistake. I will be more careful next time.

Sorry Again

-- 
Vaishali

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-29 16:30     ` Vaishali Thakkar
@ 2014-12-29 16:57       ` Mark Brown
  2014-12-29 17:19         ` Vaishali Thakkar
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2014-12-29 16:57 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 1628 bytes --]

On Mon, Dec 29, 2014 at 10:00:13PM +0530, Vaishali Thakkar wrote:
> On Mon, Dec 29, 2014 at 9:23 PM, Mark Brown <broonie@kernel.org> wrote:

> > You sent this on the 26th, two days later on the 28th you're demanding a
> > review and complaining that we've missed this with a top posted quote.
> > Even during a normal working period this would not be a reasnoable
> > demand (a couple of weeks is normally a good *lower* limit, people have
> > vacations and other things to do), and right now we're in the middle of
> > the time of year when people from western societies typically take
> > vacation.

> I am really very sorry for this. Actually I am a newbie. I mainly
> worked during opw-application period and there we used to work with
> staging directory only. This is my first time, I am working with other
> parts of kernel. So, I had kind of feeling that I might have done
> something wrong that's why I am not getting any comments. But I think
> its my fault. I may need to understand workflow of community properly
> and I apologizes for that.

Basically you should be allowing something measured in weeks to get a
response rather than days unless there's some ultra critical issue -
people might be busy, on vacation or whatever.  Different parts of the
kernel will have different working patterns and rules of thumb but in
general be patient, try to leave it for a few weeks before doing
anything unless you realise that there's some problem (eg, you forgot to
CC someone or you spot a mistake yourself in which case do a new version
fixing that mistake).  If it's just been a week or two people might just
be busy.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-29 16:57       ` Mark Brown
@ 2014-12-29 17:19         ` Vaishali Thakkar
  0 siblings, 0 replies; 11+ messages in thread
From: Vaishali Thakkar @ 2014-12-29 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel

On Dec 29, 2014 10:27 PM, "Mark Brown" <broonie@kernel.org> wrote:
>
> On Mon, Dec 29, 2014 at 10:00:13PM +0530, Vaishali Thakkar wrote:
> > On Mon, Dec 29, 2014 at 9:23 PM, Mark Brown <broonie@kernel.org> wrote:
>
> > > You sent this on the 26th, two days later on the 28th you're
demanding a
> > > review and complaining that we've missed this with a top posted quote.
> > > Even during a normal working period this would not be a reasnoable
> > > demand (a couple of weeks is normally a good *lower* limit, people
have
> > > vacations and other things to do), and right now we're in the middle
of
> > > the time of year when people from western societies typically take
> > > vacation.
>
> > I am really very sorry for this. Actually I am a newbie. I mainly
> > worked during opw-application period and there we used to work with
> > staging directory only. This is my first time, I am working with other
> > parts of kernel. So, I had kind of feeling that I might have done
> > something wrong that's why I am not getting any comments. But I think
> > its my fault. I may need to understand workflow of community properly
> > and I apologizes for that.
>
> Basically you should be allowing something measured in weeks to get a
> response rather than days unless there's some ultra critical issue -
> people might be busy, on vacation or whatever.  Different parts of the
> kernel will have different working patterns and rules of thumb but in
> general be patient, try to leave it for a few weeks before doing
> anything unless you realise that there's some problem (eg, you forgot to
> CC someone or you spot a mistake yourself in which case do a new version
> fixing that mistake).  If it's just been a week or two people might just
> be busy.

Ok. I got your point. This makes sense. Ill keep these things in my mind
and will follow it.
Also, thanks for your reply.It makes me realize my mistake and got to learn
about common working pattern of kernel community. :-)

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-26  4:44 [PATCH] ASoC: wm5102: Use put_unaligned_be16 Vaishali Thakkar
  2014-12-28 11:05 ` Vaishali Thakkar
@ 2015-01-07 10:01 ` Charles Keepax
  2015-01-07 15:24   ` Vaishali Thakkar
  2015-01-07 17:45 ` Mark Brown
  2 siblings, 1 reply; 11+ messages in thread
From: Charles Keepax @ 2015-01-07 10:01 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Takashi Iwai, alsa-devel, broonie

On Fri, Dec 26, 2014 at 10:14:57AM +0530, Vaishali Thakkar wrote:
> This patch introduces the use of function put_unaligned_be16.
> 
> This is done using Coccinelle and semantic patch used is as follows:
> 
> @a@
> typedef u16, __be16, uint16_t;
> {u16,__be16,uint16_t} e16;
> identifier tmp;
> expression ptr;
> expression y,e;
> type T;
> @@
> 
> - tmp = cpu_to_be16(y);
> 
> <+... when != tmp
> (
> - memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
> + put_unaligned_be16(y,ptr);
> |
> - memcpy(ptr, (T)&tmp, ...);
> + put_unaligned_be16(y,ptr);
> )
> ...+>
> ? tmp = e
> 
> @@ type T; identifier a.tmp; @@
> 
> - T tmp;
> ...when != tmp
> 
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

CCing patches@opensource.wolfsonmicro.com would be handy though.

Thanks,
Charles

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2015-01-07 10:01 ` Charles Keepax
@ 2015-01-07 15:24   ` Vaishali Thakkar
  2015-01-07 16:47     ` Charles Keepax
  0 siblings, 1 reply; 11+ messages in thread
From: Vaishali Thakkar @ 2015-01-07 15:24 UTC (permalink / raw)
  To: Charles Keepax; +Cc: Takashi Iwai, alsa-devel, Mark Brown

On Wed, Jan 7, 2015 at 3:31 PM, Charles Keepax
<ckeepax@opensource.wolfsonmicro.com> wrote:
> On Fri, Dec 26, 2014 at 10:14:57AM +0530, Vaishali Thakkar wrote:
>> This patch introduces the use of function put_unaligned_be16.
>>
>> This is done using Coccinelle and semantic patch used is as follows:
>>
>> @a@
>> typedef u16, __be16, uint16_t;
>> {u16,__be16,uint16_t} e16;
>> identifier tmp;
>> expression ptr;
>> expression y,e;
>> type T;
>> @@
>>
>> - tmp = cpu_to_be16(y);
>>
>> <+... when != tmp
>> (
>> - memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
>> + put_unaligned_be16(y,ptr);
>> |
>> - memcpy(ptr, (T)&tmp, ...);
>> + put_unaligned_be16(y,ptr);
>> )
>> ...+>
>> ? tmp = e
>>
>> @@ type T; identifier a.tmp; @@
>>
>> - T tmp;
>> ...when != tmp
>>
>> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>> ---
>
> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
>
> CCing patches@opensource.wolfsonmicro.com would be handy though.

Ok. Will keep this in mind while sending patches of audio drivers.

Do I need to send this patch again with CC??

> Thanks,
> Charles



-- 
Vaishali

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2015-01-07 15:24   ` Vaishali Thakkar
@ 2015-01-07 16:47     ` Charles Keepax
  0 siblings, 0 replies; 11+ messages in thread
From: Charles Keepax @ 2015-01-07 16:47 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Takashi Iwai, alsa-devel, Mark Brown

On Wed, Jan 07, 2015 at 08:54:58PM +0530, Vaishali Thakkar wrote:
> On Wed, Jan 7, 2015 at 3:31 PM, Charles Keepax
> <ckeepax@opensource.wolfsonmicro.com> wrote:
> > On Fri, Dec 26, 2014 at 10:14:57AM +0530, Vaishali Thakkar wrote:
> >> This patch introduces the use of function put_unaligned_be16.
> >> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> >> ---
> >
> > Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> >
> > CCing patches@opensource.wolfsonmicro.com would be handy though.
> 
> Ok. Will keep this in mind while sending patches of audio drivers.
> 
> Do I need to send this patch again with CC??

No its fine I have already acked it now.

Thanks,
Charles

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

* Re: [PATCH] ASoC: wm5102: Use put_unaligned_be16
  2014-12-26  4:44 [PATCH] ASoC: wm5102: Use put_unaligned_be16 Vaishali Thakkar
  2014-12-28 11:05 ` Vaishali Thakkar
  2015-01-07 10:01 ` Charles Keepax
@ 2015-01-07 17:45 ` Mark Brown
  2 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2015-01-07 17:45 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Takashi Iwai, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 302 bytes --]

On Fri, Dec 26, 2014 at 10:14:57AM +0530, Vaishali Thakkar wrote:
> This patch introduces the use of function put_unaligned_be16.
> 
> This is done using Coccinelle and semantic patch used is as follows:

This doesn't apply against current code (-next, or my git tree), please
check and resend.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* [PATCH] ASoC: wm5102: Use put_unaligned_be16
@ 2014-12-26  4:39 Vaishali Thakkar
  0 siblings, 0 replies; 11+ messages in thread
From: Vaishali Thakkar @ 2014-12-26  4:39 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel

This patch introduces the use of function put_unaligned_le16.

This is done using Coccinelle and semantic patch used is as follows:

@a@
typedef u16, __be16, uint16_t;
{u16,__be16,uint16_t} e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
@@

- tmp = cpu_to_be16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
+ put_unaligned_be16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_be16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 sound/soc/codecs/wm5102.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index f602349..fec21f9 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -28,6 +28,7 @@
 
 #include <linux/mfd/arizona/core.h>
 #include <linux/mfd/arizona/registers.h>
+#include <asm/unaligned.h>
 
 #include "arizona.h"
 #include "wm5102.h"
@@ -617,11 +618,11 @@ static int wm5102_out_comp_coeff_get(struct snd_kcontrol *kcontrol,
 {
 	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
 	struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
-	uint16_t data;
 
 	mutex_lock(&codec->mutex);
-	data = cpu_to_be16(arizona->dac_comp_coeff);
-	memcpy(ucontrol->value.bytes.data, &data, sizeof(data));
+
+	put_unaligned_be16(arizona->dac_comp_coeff,
+			   ucontrol->value.bytes.data);
 	mutex_unlock(&codec->mutex);
 
 	return 0;
-- 
1.9.1

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

end of thread, other threads:[~2015-01-07 17:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-26  4:44 [PATCH] ASoC: wm5102: Use put_unaligned_be16 Vaishali Thakkar
2014-12-28 11:05 ` Vaishali Thakkar
2014-12-29 15:53   ` Mark Brown
2014-12-29 16:30     ` Vaishali Thakkar
2014-12-29 16:57       ` Mark Brown
2014-12-29 17:19         ` Vaishali Thakkar
2015-01-07 10:01 ` Charles Keepax
2015-01-07 15:24   ` Vaishali Thakkar
2015-01-07 16:47     ` Charles Keepax
2015-01-07 17:45 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2014-12-26  4:39 Vaishali Thakkar

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.