* [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init
@ 2013-01-17 1:49 Axel Lin
2013-01-17 1:58 ` Thiago Farina
2013-01-17 12:47 ` Alexander Holler
0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2013-01-17 1:49 UTC (permalink / raw)
To: Jonathan Cameron, Alessandro Zummo
Cc: Alexander Holler, rtc-linux, linux-kernel
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/rtc/rtc-hid-sensor-time.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
index 0438c9e..31c5728 100644
--- a/drivers/rtc/rtc-hid-sensor-time.c
+++ b/drivers/rtc/rtc-hid-sensor-time.c
@@ -225,6 +225,7 @@ static int hid_time_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, time_state);
+ spin_lock_init(&time_state->lock_last_time);
init_completion(&time_state->comp_last_time);
time_state->common_attributes.hsdev = hsdev;
time_state->common_attributes.pdev = pdev;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init
2013-01-17 1:49 [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init Axel Lin
@ 2013-01-17 1:58 ` Thiago Farina
2013-01-17 12:58 ` Alexander Holler
2013-01-17 12:47 ` Alexander Holler
1 sibling, 1 reply; 5+ messages in thread
From: Thiago Farina @ 2013-01-17 1:58 UTC (permalink / raw)
To: Axel Lin
Cc: Jonathan Cameron, Alessandro Zummo, Alexander Holler, rtc-linux,
linux-kernel
On Wed, Jan 16, 2013 at 11:49 PM, Axel Lin <axel.lin@ingics.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/rtc/rtc-hid-sensor-time.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
> index 0438c9e..31c5728 100644
> --- a/drivers/rtc/rtc-hid-sensor-time.c
> +++ b/drivers/rtc/rtc-hid-sensor-time.c
> @@ -225,6 +225,7 @@ static int hid_time_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, time_state);
>
> + spin_lock_init(&time_state->lock_last_time);
Can you explain in the commit message why it is missing?
For people not familiar with this code that isn't obvious.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init
2013-01-17 1:49 [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init Axel Lin
2013-01-17 1:58 ` Thiago Farina
@ 2013-01-17 12:47 ` Alexander Holler
2013-01-20 12:02 ` Jonathan Cameron
1 sibling, 1 reply; 5+ messages in thread
From: Alexander Holler @ 2013-01-17 12:47 UTC (permalink / raw)
To: Axel Lin; +Cc: Jonathan Cameron, Alessandro Zummo, rtc-linux, linux-kernel
Am 17.01.2013 02:49, schrieb Axel Lin:
Thanks, yes, I missed it the initialization of the spinlock.
Below is my ack.
Regards,
Alexander
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Alexander Holler <holler@ahsoftware.de>
> ---
> drivers/rtc/rtc-hid-sensor-time.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
> index 0438c9e..31c5728 100644
> --- a/drivers/rtc/rtc-hid-sensor-time.c
> +++ b/drivers/rtc/rtc-hid-sensor-time.c
> @@ -225,6 +225,7 @@ static int hid_time_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, time_state);
>
> + spin_lock_init(&time_state->lock_last_time);
> init_completion(&time_state->comp_last_time);
> time_state->common_attributes.hsdev = hsdev;
> time_state->common_attributes.pdev = pdev;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init
2013-01-17 1:58 ` Thiago Farina
@ 2013-01-17 12:58 ` Alexander Holler
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Holler @ 2013-01-17 12:58 UTC (permalink / raw)
To: Thiago Farina
Cc: Axel Lin, Jonathan Cameron, Alessandro Zummo, rtc-linux,
linux-kernel
Am 17.01.2013 02:58, schrieb Thiago Farina:
> On Wed, Jan 16, 2013 at 11:49 PM, Axel Lin <axel.lin@ingics.com> wrote:
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> ---
>> drivers/rtc/rtc-hid-sensor-time.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
>> index 0438c9e..31c5728 100644
>> --- a/drivers/rtc/rtc-hid-sensor-time.c
>> +++ b/drivers/rtc/rtc-hid-sensor-time.c
>> @@ -225,6 +225,7 @@ static int hid_time_probe(struct platform_device *pdev)
>>
>> platform_set_drvdata(pdev, time_state);
>>
>> + spin_lock_init(&time_state->lock_last_time);
> Can you explain in the commit message why it is missing?
>
> For people not familiar with this code that isn't obvious.
>
Every spinlock must be initialized once (to SPIN_LOCK_UNLOCKED or by
using spin_lock_init()). On most architectures SPIN_LOCK_UNLOCKED is
just zero, therefor the kzalloc of the time_state does it (which likely
is the case why I haven't spotted any error without the initialization),
but that doesn't isn't true for all architectures.
Regards,
Alexander
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init
2013-01-17 12:47 ` Alexander Holler
@ 2013-01-20 12:02 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2013-01-20 12:02 UTC (permalink / raw)
To: Alexander Holler; +Cc: Axel Lin, Alessandro Zummo, rtc-linux, linux-kernel
On 01/17/2013 12:47 PM, Alexander Holler wrote:
> Am 17.01.2013 02:49, schrieb Axel Lin:
>
> Thanks, yes, I missed it the initialization of the spinlock.
>
> Below is my ack.
>
> Regards,
>
> Alexander
>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
> Acked-by: Alexander Holler <holler@ahsoftware.de>
Applied to togreg branch of iio.git.
Thanks,
>
>> ---
>> drivers/rtc/rtc-hid-sensor-time.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
>> index 0438c9e..31c5728 100644
>> --- a/drivers/rtc/rtc-hid-sensor-time.c
>> +++ b/drivers/rtc/rtc-hid-sensor-time.c
>> @@ -225,6 +225,7 @@ static int hid_time_probe(struct platform_device *pdev)
>>
>> platform_set_drvdata(pdev, time_state);
>>
>> + spin_lock_init(&time_state->lock_last_time);
>> init_completion(&time_state->comp_last_time);
>> time_state->common_attributes.hsdev = hsdev;
>> time_state->common_attributes.pdev = pdev;
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-20 12:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 1:49 [PATCH] rtc: hid-sensor-time: Add missing spin_lock_init Axel Lin
2013-01-17 1:58 ` Thiago Farina
2013-01-17 12:58 ` Alexander Holler
2013-01-17 12:47 ` Alexander Holler
2013-01-20 12:02 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox