[PATCH v1 18/23] pps: Switch to use %ptSp

Andy Shevchenko posted 23 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH v1 18/23] pps: Switch to use %ptSp
Posted by Andy Shevchenko 2 months, 4 weeks ago
Use %ptSp instead of open coded variants to print content of
struct timespec64 in human readable format.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pps/generators/pps_gen_parport.c | 3 +--
 drivers/pps/kapi.c                       | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
index f5eeb4dd01ad..05bbf8d30ef1 100644
--- a/drivers/pps/generators/pps_gen_parport.c
+++ b/drivers/pps/generators/pps_gen_parport.c
@@ -80,8 +80,7 @@ static enum hrtimer_restart hrtimer_event(struct hrtimer *timer)
 	/* check if we are late */
 	if (expire_time.tv_sec != ts1.tv_sec || ts1.tv_nsec > lim) {
 		local_irq_restore(flags);
-		pr_err("we are late this time %lld.%09ld\n",
-				(s64)ts1.tv_sec, ts1.tv_nsec);
+		pr_err("we are late this time %ptSp\n", &ts1);
 		goto done;
 	}
 
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index e9389876229e..6985c34de2ce 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -163,8 +163,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
 	/* check event type */
 	BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
 
-	dev_dbg(&pps->dev, "PPS event at %lld.%09ld\n",
-			(s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec);
+	dev_dbg(&pps->dev, "PPS event at %ptSp\n", &ts->ts_real);
 
 	timespec_to_pps_ktime(&ts_real, ts->ts_real);
 
-- 
2.50.1
Re: [PATCH v1 18/23] pps: Switch to use %ptSp
Posted by Rodolfo Giometti 2 months, 4 weeks ago
On 10/11/25 19:40, Andy Shevchenko wrote:
> Use %ptSp instead of open coded variants to print content of
> struct timespec64 in human readable format.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Rodolfo Giometti <giometti@enneenne.com>

Thanks,

Rodolfo Giometti

> ---
>   drivers/pps/generators/pps_gen_parport.c | 3 +--
>   drivers/pps/kapi.c                       | 3 +--
>   2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
> index f5eeb4dd01ad..05bbf8d30ef1 100644
> --- a/drivers/pps/generators/pps_gen_parport.c
> +++ b/drivers/pps/generators/pps_gen_parport.c
> @@ -80,8 +80,7 @@ static enum hrtimer_restart hrtimer_event(struct hrtimer *timer)
>   	/* check if we are late */
>   	if (expire_time.tv_sec != ts1.tv_sec || ts1.tv_nsec > lim) {
>   		local_irq_restore(flags);
> -		pr_err("we are late this time %lld.%09ld\n",
> -				(s64)ts1.tv_sec, ts1.tv_nsec);
> +		pr_err("we are late this time %ptSp\n", &ts1);
>   		goto done;
>   	}
>   
> diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
> index e9389876229e..6985c34de2ce 100644
> --- a/drivers/pps/kapi.c
> +++ b/drivers/pps/kapi.c
> @@ -163,8 +163,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
>   	/* check event type */
>   	BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
>   
> -	dev_dbg(&pps->dev, "PPS event at %lld.%09ld\n",
> -			(s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec);
> +	dev_dbg(&pps->dev, "PPS event at %ptSp\n", &ts->ts_real);
>   
>   	timespec_to_pps_ktime(&ts_real, ts->ts_real);
>   


-- 
GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming