Patchwork [v6,20/20] PM: Switch to use %ptR

login
register
mail settings
Submitter Andy Shevchenko
Date Dec. 4, 2018, 9:23 p.m.
Message ID <20181204212330.69515-21-andriy.shevchenko@linux.intel.com>
Download mbox | patch
Permalink /patch/672411/
State New
Headers show

Comments

Andy Shevchenko - Dec. 4, 2018, 9:23 p.m.
Use %ptR instead of open coded variant to print content of
struct rtc_time in human readable format.

Cc: linux-pm@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/power/trace.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Rafael J. Wysocki - Dec. 11, 2018, 11:53 a.m.
On Tuesday, December 4, 2018 10:23:30 PM CET Andy Shevchenko wrote:
> Use %ptR instead of open coded variant to print content of
> struct rtc_time in human readable format.
> 
> Cc: linux-pm@vger.kernel.org
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Do you want me to take this patch?

> ---
>  drivers/base/power/trace.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
> index 1cda505d6a85..b11f47a1e819 100644
> --- a/drivers/base/power/trace.c
> +++ b/drivers/base/power/trace.c
> @@ -118,9 +118,7 @@ static unsigned int read_magic_time(void)
>  	unsigned int val;
>  
>  	mc146818_get_time(&time);
> -	pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n",
> -		time.tm_hour, time.tm_min, time.tm_sec,
> -		time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
> +	pr_info("RTC time: %ptRt, date: %ptRd\n", &time, &time);
>  	val = time.tm_year;				/* 100 years */
>  	if (val > 100)
>  		val -= 100;
>
Andy Shevchenko - Dec. 11, 2018, 12:29 p.m.
On Tue, Dec 11, 2018 at 2:12 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> On Tuesday, December 4, 2018 10:23:30 PM CET Andy Shevchenko wrote:
> > Use %ptR instead of open coded variant to print content of
> > struct rtc_time in human readable format.
> >
> > Cc: linux-pm@vger.kernel.org
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> Do you want me to take this patch?

Alexandre took all of them, thanks!

>
> > ---
> >  drivers/base/power/trace.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
> > index 1cda505d6a85..b11f47a1e819 100644
> > --- a/drivers/base/power/trace.c
> > +++ b/drivers/base/power/trace.c
> > @@ -118,9 +118,7 @@ static unsigned int read_magic_time(void)
> >       unsigned int val;
> >
> >       mc146818_get_time(&time);
> > -     pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n",
> > -             time.tm_hour, time.tm_min, time.tm_sec,
> > -             time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
> > +     pr_info("RTC time: %ptRt, date: %ptRd\n", &time, &time);
> >       val = time.tm_year;                             /* 100 years */
> >       if (val > 100)
> >               val -= 100;
> >
>
>

Patch

diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
index 1cda505d6a85..b11f47a1e819 100644
--- a/drivers/base/power/trace.c
+++ b/drivers/base/power/trace.c
@@ -118,9 +118,7 @@  static unsigned int read_magic_time(void)
 	unsigned int val;
 
 	mc146818_get_time(&time);
-	pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n",
-		time.tm_hour, time.tm_min, time.tm_sec,
-		time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
+	pr_info("RTC time: %ptRt, date: %ptRd\n", &time, &time);
 	val = time.tm_year;				/* 100 years */
 	if (val > 100)
 		val -= 100;