Linux-RTC Archive on lore.kernel.org
 help / Atom feed
* [PATCH] rtc: proc: printf using alarm for alrm
@ 2018-12-04  9:29 yuankuiz
  2018-12-06  7:22 ` yuankuiz
  0 siblings, 1 reply; 4+ messages in thread
From: yuankuiz @ 2018-12-04  9:29 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: linux-rtc, linux-kernel

Hi,

 From 549bae59445c5ec67dd6a46f3ea4f58966d40c9b

Current the struct rtc_wkalrm is dumped as
"alrm_" by printing converted from the struct
name of "alrm.*" directly. Shall we use the
"alarm *" to replace the "alrm_*" during this
dumping?

Signed-off-by: John Zhao <yuankuiz@codeaurora.org>
---
  drivers/rtc/rtc-proc.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index a9dd921..d4a3c91 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
@@ -85,9 +85,9 @@ static int rtc_proc_show(struct seq_file *seq, void 
*offset)
  			seq_printf(seq, "%02d\n", alrm.time.tm_mday);
  		else
  			seq_printf(seq, "**\n");
-		seq_printf(seq, "alarm_IRQ\t: %s\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.7.4

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

* Re: [PATCH] rtc: proc: printf using alarm for alrm
  2018-12-04  9:29 [PATCH] rtc: proc: printf using alarm for alrm yuankuiz
@ 2018-12-06  7:22 ` yuankuiz
  2018-12-06 20:38   ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: yuankuiz @ 2018-12-06  7:22 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: linux-rtc, linux-kernel, linux-rtc-owner

Hi,

     Kindly, this format change formats the rtc dump from:
         alrm_time	: 00:00:00
         alrm_date	: 1970-01-01
         alarm_IRQ	: no
         alrm_pending	: no

     to:
         alarm time	: 00:00:00
         alarm date	: 1970-01-01
         alarm IRQ	: no
         alarm pending	: no

     Thanks,
BR//John Zhao

On 2018-12-04 05:29 PM, yuankuiz@codeaurora.org wrote:
> Hi,
> 
> From 549bae59445c5ec67dd6a46f3ea4f58966d40c9b
> 
> Current the struct rtc_wkalrm is dumped as
> "alrm_" by printing converted from the struct
> name of "alrm.*" directly. Shall we use the
> "alarm *" to replace the "alrm_*" during this
> dumping?
> 
> Signed-off-by: John Zhao <yuankuiz@codeaurora.org>
> ---
>  drivers/rtc/rtc-proc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
> index a9dd921..d4a3c91 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
> @@ -85,9 +85,9 @@ static int rtc_proc_show(struct seq_file *seq, void 
> *offset)
>  			seq_printf(seq, "%02d\n", alrm.time.tm_mday);
>  		else
>  			seq_printf(seq, "**\n");
> -		seq_printf(seq, "alarm_IRQ\t: %s\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");

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

* Re: [PATCH] rtc: proc: printf using alarm for alrm
  2018-12-06  7:22 ` yuankuiz
@ 2018-12-06 20:38   ` Alexandre Belloni
  2018-12-10 10:01     ` yuankuiz
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2018-12-06 20:38 UTC (permalink / raw)
  To: yuankuiz; +Cc: a.zummo, linux-rtc, linux-kernel, linux-rtc-owner

On 06/12/2018 15:22:51+0800, yuankuiz@codeaurora.org wrote:
> Hi,
> 
>     Kindly, this format change formats the rtc dump from:
>         alrm_time	: 00:00:00
>         alrm_date	: 1970-01-01
>         alarm_IRQ	: no
>         alrm_pending	: no
> 
>     to:
>         alarm time	: 00:00:00
>         alarm date	: 1970-01-01
>         alarm IRQ	: no
>         alarm pending	: no
> 

Yes, and this would break the ABI as this file is in procfs. This is not
something I'm willing to do, especially since this file has been
deprecated since 2006.

>     Thanks,
> BR//John Zhao
> 
> On 2018-12-04 05:29 PM, yuankuiz@codeaurora.org wrote:
> > Hi,
> > 
> > From 549bae59445c5ec67dd6a46f3ea4f58966d40c9b
> > 
> > Current the struct rtc_wkalrm is dumped as
> > "alrm_" by printing converted from the struct
> > name of "alrm.*" directly. Shall we use the
> > "alarm *" to replace the "alrm_*" during this
> > dumping?
> > 
> > Signed-off-by: John Zhao <yuankuiz@codeaurora.org>
> > ---
> >  drivers/rtc/rtc-proc.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
> > index a9dd921..d4a3c91 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
> > @@ -85,9 +85,9 @@ static int rtc_proc_show(struct seq_file *seq, void
> > *offset)
> >  			seq_printf(seq, "%02d\n", alrm.time.tm_mday);
> >  		else
> >  			seq_printf(seq, "**\n");
> > -		seq_printf(seq, "alarm_IRQ\t: %s\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");

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] rtc: proc: printf using alarm for alrm
  2018-12-06 20:38   ` Alexandre Belloni
@ 2018-12-10 10:01     ` yuankuiz
  0 siblings, 0 replies; 4+ messages in thread
From: yuankuiz @ 2018-12-10 10:01 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: a.zummo, linux-rtc, linux-kernel, linux-rtc-owner

On 2018-12-07 04:38 AM, Alexandre Belloni wrote:
> On 06/12/2018 15:22:51+0800, yuankuiz@codeaurora.org wrote:
>> Hi,
>> 
>>     Kindly, this format change formats the rtc dump from:
>>         alrm_time	: 00:00:00
>>         alrm_date	: 1970-01-01
>>         alarm_IRQ	: no
>>         alrm_pending	: no
>> 
>>     to:
>>         alarm time	: 00:00:00
>>         alarm date	: 1970-01-01
>>         alarm IRQ	: no
>>         alarm pending	: no
>> 
> 
> Yes, and this would break the ABI as this file is in procfs. This is 
> not
> something I'm willing to do, especially since this file has been
> deprecated since 2006.

OK. So shall we default it as n like:
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index a819ef0..c51f0e1 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -100,7 +100,7 @@ config RTC_INTF_SYSFS
  config RTC_INTF_PROC
         bool "/proc/driver/rtc (procfs for rtcN)"
         depends on PROC_FS
-       default RTC_CLASS
+       default n
         help
           Say yes here if you want to use your system clock RTC through
           the proc interface, /proc/driver/rtc.


     Thanks,
BR//John Zhao

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04  9:29 [PATCH] rtc: proc: printf using alarm for alrm yuankuiz
2018-12-06  7:22 ` yuankuiz
2018-12-06 20:38   ` Alexandre Belloni
2018-12-10 10:01     ` yuankuiz

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org linux-rtc@archiver.kernel.org
	public-inbox-index linux-rtc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox