diff mbox

[1/1] rtc: fix type information of rtc-proc

Message ID 1444297652-10328-1-git-send-email-thunder.leizhen@huawei.com
State Rejected
Headers show

Commit Message

Leizhen (ThunderTown) Oct. 8, 2015, 9:47 a.m. UTC
Display the whole word of "alarm", make it look more comfortable.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/rtc/rtc-proc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.5.0

Comments

Alexandre Belloni Oct. 17, 2015, 11:22 a.m. UTC | #1
Hi,

On 08/10/2015 at 17:47:32 +0800, Zhen Lei wrote :
> Display the whole word of "alarm", make it look more comfortable.
> 

While this is nice, this will break scripts parsing that file for not
good technical reason. I guess we are stuck with legacy here.
Leizhen (ThunderTown) Nov. 11, 2015, 1:06 a.m. UTC | #2
Hi, all

I'm sorry. Maybe I didn't describe clearly enough before. These words are finally
shown to the end user. The end user maybe not a programmer, abbreviation word is unsuitable.


cat /proc/driver/rtc

rtc_time        : 00:47:43
rtc_date        : 2015-11-11
alrm_time       : 03:27:58				//alrm_time --> alarm_time
alrm_date       : 2015-10-08				//alrm_date --> alarm_date
alarm_IRQ       : no
alrm_pending    : no					//alrm_pending --> alarm_pending
update IRQ enabled      : no


On 2015/10/8 17:47, Zhen Lei wrote:
> Display the whole word of "alarm", make it look more comfortable.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/rtc/rtc-proc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
> index ffa69e1..ef83f34 100644
> --- a/drivers/rtc/rtc-proc.c
> +++ b/drivers/rtc/rtc-proc.c
> @@ -58,7 +58,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
> 
>  	err = rtc_read_alarm(rtc, &alrm);
>  	if (err == 0) {
> -		seq_printf(seq, "alrm_time\t: ");
> +		seq_printf(seq, "alarm_time\t: ");
>  		if ((unsigned int)alrm.time.tm_hour <= 24)
>  			seq_printf(seq, "%02d:", alrm.time.tm_hour);
>  		else
> @@ -72,7 +72,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
>  		else
>  			seq_printf(seq, "**\n");
> 
> -		seq_printf(seq, "alrm_date\t: ");
> +		seq_printf(seq, "alarm_date\t: ");
>  		if ((unsigned int)alrm.time.tm_year <= 200)
>  			seq_printf(seq, "%04d-", alrm.time.tm_year + 1900);
>  		else
> @@ -87,7 +87,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
>  			seq_printf(seq, "**\n");
>  		seq_printf(seq, "alarm_IRQ\t: %s\n",
>  				alrm.enabled ? "yes" : "no");
> -		seq_printf(seq, "alrm_pending\t: %s\n",
> +		seq_printf(seq, "alarm_pending\t: %s\n",
>  				alrm.pending ? "yes" : "no");
>  		seq_printf(seq, "update IRQ enabled\t: %s\n",
>  			(rtc->uie_rtctimer.enabled) ? "yes" : "no");
> --
> 2.5.0
> 
> 
> 
> .
>
Alexandre Belloni Nov. 11, 2015, 10:54 a.m. UTC | #3
On 11/11/2015 at 09:06:51 +0800, Leizhen (ThunderTown) wrote :
> Hi, all
> 
> I'm sorry. Maybe I didn't describe clearly enough before. These words are finally
> shown to the end user. The end user maybe not a programmer, abbreviation word is unsuitable.
> 

Yes, that is exactly m point. What if an end user currently has a
program parsing the file and looking for alrm_time or alrm_date? After
updating his kernel, the program won't work anymore which is something
we don't want.

> 
> cat /proc/driver/rtc
> 
> rtc_time        : 00:47:43
> rtc_date        : 2015-11-11
> alrm_time       : 03:27:58				//alrm_time --> alarm_time
> alrm_date       : 2015-10-08				//alrm_date --> alarm_date
> alarm_IRQ       : no
> alrm_pending    : no					//alrm_pending --> alarm_pending
> update IRQ enabled      : no
> 
>
Leizhen (ThunderTown) Nov. 12, 2015, 2:05 a.m. UTC | #4
On 2015/11/11 18:54, Alexandre Belloni wrote:
> On 11/11/2015 at 09:06:51 +0800, Leizhen (ThunderTown) wrote :
>> Hi, all
>>
>> I'm sorry. Maybe I didn't describe clearly enough before. These words are finally
>> shown to the end user. The end user maybe not a programmer, abbreviation word is unsuitable.
>>
> 
> Yes, that is exactly m point. What if an end user currently has a
> program parsing the file and looking for alrm_time or alrm_date? After
> updating his kernel, the program won't work anymore which is something
> we don't want.

OK. I see. Thanks.

> 
>>
>> cat /proc/driver/rtc
>>
>> rtc_time        : 00:47:43
>> rtc_date        : 2015-11-11
>> alrm_time       : 03:27:58				//alrm_time --> alarm_time
>> alrm_date       : 2015-10-08				//alrm_date --> alarm_date
>> alarm_IRQ       : no
>> alrm_pending    : no					//alrm_pending --> alarm_pending
>> update IRQ enabled      : no
>>
>>
>
diff mbox

Patch

diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index ffa69e1..ef83f34 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -58,7 +58,7 @@  static int rtc_proc_show(struct seq_file *seq, void *offset)

 	err = rtc_read_alarm(rtc, &alrm);
 	if (err == 0) {
-		seq_printf(seq, "alrm_time\t: ");
+		seq_printf(seq, "alarm_time\t: ");
 		if ((unsigned int)alrm.time.tm_hour <= 24)
 			seq_printf(seq, "%02d:", alrm.time.tm_hour);
 		else
@@ -72,7 +72,7 @@  static int rtc_proc_show(struct seq_file *seq, void *offset)
 		else
 			seq_printf(seq, "**\n");

-		seq_printf(seq, "alrm_date\t: ");
+		seq_printf(seq, "alarm_date\t: ");
 		if ((unsigned int)alrm.time.tm_year <= 200)
 			seq_printf(seq, "%04d-", alrm.time.tm_year + 1900);
 		else
@@ -87,7 +87,7 @@  static int rtc_proc_show(struct seq_file *seq, void *offset)
 			seq_printf(seq, "**\n");
 		seq_printf(seq, "alarm_IRQ\t: %s\n",
 				alrm.enabled ? "yes" : "no");
-		seq_printf(seq, "alrm_pending\t: %s\n",
+		seq_printf(seq, "alarm_pending\t: %s\n",
 				alrm.pending ? "yes" : "no");
 		seq_printf(seq, "update IRQ enabled\t: %s\n",
 			(rtc->uie_rtctimer.enabled) ? "yes" : "no");