* [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value
@ 2015-08-01 17:59 Felix Janda
2015-08-12 13:27 ` Alexandre Belloni
0 siblings, 1 reply; 6+ messages in thread
From: Felix Janda @ 2015-08-01 17:59 UTC (permalink / raw)
To: rtc-linux
The RTC's month value starts at 1, whereas the kernel's starts at 0.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
This is my first kernel patch. It's content is actually from
https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/9ce8d10f39c441642fba58ab8248d78951cec7a7
How can this be acknowledged? The patch from the chromiumos kernel
can't be taken as it is, can it?
---
drivers/rtc/rtc-as3722.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 9f38eda..56cc582 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -45,7 +45,7 @@ static void as3722_time_to_reg(u8 *rbuff, struct rtc_time *tm)
rbuff[1] = bin2bcd(tm->tm_min);
rbuff[2] = bin2bcd(tm->tm_hour);
rbuff[3] = bin2bcd(tm->tm_mday);
- rbuff[4] = bin2bcd(tm->tm_mon);
+ rbuff[4] = bin2bcd(tm->tm_mon + 1);
rbuff[5] = bin2bcd(tm->tm_year - (AS3722_RTC_START_YEAR - 1900));
}
@@ -55,7 +55,7 @@ static void as3722_reg_to_time(u8 *rbuff, struct rtc_time *tm)
tm->tm_min = bcd2bin(rbuff[1] & 0x7F);
tm->tm_hour = bcd2bin(rbuff[2] & 0x3F);
tm->tm_mday = bcd2bin(rbuff[3] & 0x3F);
- tm->tm_mon = bcd2bin(rbuff[4] & 0x1F);
+ tm->tm_mon = bcd2bin(rbuff[4] & 0x1F) - 1;
tm->tm_year = (AS3722_RTC_START_YEAR - 1900) + bcd2bin(rbuff[5] & 0x7F);
return;
}
--
2.3.6
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value
2015-08-01 17:59 [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value Felix Janda
@ 2015-08-12 13:27 ` Alexandre Belloni
2015-08-13 19:33 ` Felix Janda
0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2015-08-12 13:27 UTC (permalink / raw)
To: Felix Janda; +Cc: rtc-linux
Hi,
On 01/08/2015 at 19:59:24 +0200, Felix Janda wrote :
> The RTC's month value starts at 1, whereas the kernel's starts at 0.
>
> Signed-off-by: Felix Janda <felix.janda@posteo.de>
> ---
> This is my first kernel patch. It's content is actually from
>
> https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/9ce8d10f39c441642fba58ab8248d78951cec7a7
>
> How can this be acknowledged? The patch from the chromiumos kernel
> can't be taken as it is, can it?
You should send the patch with "Bibek Basu <bbasu@nvidia.com>" as the
author and both SoB tags, Bibek's and yours. The other, gerrit related,
tags can be removed.
It will look like:
https://groups.google.com/forum/#!topic/rtc-linux/9NJUEAJWIkI
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value
2015-08-12 13:27 ` Alexandre Belloni
@ 2015-08-13 19:33 ` Felix Janda
2015-08-14 8:45 ` Alexandre Belloni
0 siblings, 1 reply; 6+ messages in thread
From: Felix Janda @ 2015-08-13 19:33 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: rtc-linux
Alexandre Belloni wrote:
> Hi,
Thank you very much for your help!
> On 01/08/2015 at 19:59:24 +0200, Felix Janda wrote :
> > The RTC's month value starts at 1, whereas the kernel's starts at 0.
> >
> > Signed-off-by: Felix Janda <felix.janda@posteo.de>
> > ---
> > This is my first kernel patch. It's content is actually from
> >
> > https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/9ce8d10f39c441642fba58ab8248d78951cec7a7
> >
> > How can this be acknowledged? The patch from the chromiumos kernel
> > can't be taken as it is, can it?
>
> You should send the patch with "Bibek Basu <bbasu@nvidia.com>" as the
> author and both SoB tags, Bibek's and yours. The other, gerrit related,
> tags can be removed.
>
> It will look like:
> https://groups.google.com/forum/#!topic/rtc-linux/9NJUEAJWIkI
So I should better not rewrite the commit message? At least the
"CHROMIUM: " prefix of the title seems inappropriate.
Felix
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value
2015-08-13 19:33 ` Felix Janda
@ 2015-08-14 8:45 ` Alexandre Belloni
2015-08-14 18:44 ` [rtc-linux] [PATCH v2] drivers/rtc/rtc-as3722: correct " Bibek Basu
0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2015-08-14 8:45 UTC (permalink / raw)
To: Felix Janda; +Cc: rtc-linux
On 13/08/2015 at 21:33:27 +0200, Felix Janda wrote :
> So I should better not rewrite the commit message? At least the
> "CHROMIUM: " prefix of the title seems inappropriate.
>
Indeed, you can adjust it, it should be:
rtc: as3722: correct month value
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] [PATCH v2] drivers/rtc/rtc-as3722: correct month value
2015-08-14 8:45 ` Alexandre Belloni
@ 2015-08-14 18:44 ` Bibek Basu
2015-08-20 23:45 ` [rtc-linux] " Alexandre Belloni
0 siblings, 1 reply; 6+ messages in thread
From: Bibek Basu @ 2015-08-14 18:44 UTC (permalink / raw)
To: rtc-linux; +Cc: Alexandre Belloni
The RTCmonth value is 1-indexed, but the kernel assumes it is 0-indexed.
This may result in the RTC not rolling over correctly.
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
v1 -> v2: Correct attribution and use original commit message
---
drivers/rtc/rtc-as3722.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 9f38eda..56cc582 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -45,7 +45,7 @@ static void as3722_time_to_reg(u8 *rbuff, struct rtc_time *tm)
rbuff[1] = bin2bcd(tm->tm_min);
rbuff[2] = bin2bcd(tm->tm_hour);
rbuff[3] = bin2bcd(tm->tm_mday);
- rbuff[4] = bin2bcd(tm->tm_mon);
+ rbuff[4] = bin2bcd(tm->tm_mon + 1);
rbuff[5] = bin2bcd(tm->tm_year - (AS3722_RTC_START_YEAR - 1900));
}
@@ -55,7 +55,7 @@ static void as3722_reg_to_time(u8 *rbuff, struct rtc_time *tm)
tm->tm_min = bcd2bin(rbuff[1] & 0x7F);
tm->tm_hour = bcd2bin(rbuff[2] & 0x3F);
tm->tm_mday = bcd2bin(rbuff[3] & 0x3F);
- tm->tm_mon = bcd2bin(rbuff[4] & 0x1F);
+ tm->tm_mon = bcd2bin(rbuff[4] & 0x1F) - 1;
tm->tm_year = (AS3722_RTC_START_YEAR - 1900) + bcd2bin(rbuff[5] & 0x7F);
return;
}
--
2.4.6
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH v2] drivers/rtc/rtc-as3722: correct month value
2015-08-14 18:44 ` [rtc-linux] [PATCH v2] drivers/rtc/rtc-as3722: correct " Bibek Basu
@ 2015-08-20 23:45 ` Alexandre Belloni
0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2015-08-20 23:45 UTC (permalink / raw)
To: Felix Janda, Bibek Basu; +Cc: rtc-linux
On 14/08/2015 at 20:44:02 +0200, Bibek Basu wrote :
> The RTCmonth value is 1-indexed, but the kernel assumes it is 0-indexed.
> This may result in the RTC not rolling over correctly.
>
> Signed-off-by: Bibek Basu <bbasu@nvidia.com>
> Signed-off-by: Felix Janda <felix.janda@posteo.de>
> ---
> v1 -> v2: Correct attribution and use original commit message
> ---
> drivers/rtc/rtc-as3722.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Applied, thanks. However, it was not necessary to spoof the From: in
your email, It is enough to have a From: line in the body of the mail.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-20 23:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-01 17:59 [rtc-linux] [PATCH] rtc: as3772: Fix off-by-one error in month value Felix Janda
2015-08-12 13:27 ` Alexandre Belloni
2015-08-13 19:33 ` Felix Janda
2015-08-14 8:45 ` Alexandre Belloni
2015-08-14 18:44 ` [rtc-linux] [PATCH v2] drivers/rtc/rtc-as3722: correct " Bibek Basu
2015-08-20 23:45 ` [rtc-linux] " Alexandre Belloni
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.