Patch "selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-ptp-fix-timestamp-printf-format-for-ptp_sy.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 21cd279cdc0d7c7d4d9e29a33efd62e6fdaed76b
Author: Alex Maftei <alex.maftei@xxxxxxx>
Date:   Thu Jun 15 09:34:04 2023 +0100

    selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET
    
    [ Upstream commit 76a4c8b82938bc5020b67663db41f451684bf327 ]
    
    Previously, timestamps were printed using "%lld.%u" which is incorrect
    for nanosecond values lower than 100,000,000 as they're fractional
    digits, therefore leading zeros are meaningful.
    
    This patch changes the format strings to "%lld.%09u" in order to add
    leading zeros to the nanosecond value.
    
    Fixes: 568ebc5985f5 ("ptp: add the PTP_SYS_OFFSET ioctl to the testptp program")
    Fixes: 4ec54f95736f ("ptp: Fix compiler warnings in the testptp utility")
    Fixes: 6ab0e475f1f3 ("Documentation: fix misc. warnings")
    Signed-off-by: Alex Maftei <alex.maftei@xxxxxxx>
    Acked-by: Richard Cochran <richardcochran@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230615083404.57112-1-alex.maftei@xxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c
index f7911aaeb0075..aa474febb4712 100644
--- a/tools/testing/selftests/ptp/testptp.c
+++ b/tools/testing/selftests/ptp/testptp.c
@@ -492,11 +492,11 @@ int main(int argc, char *argv[])
 			interval = t2 - t1;
 			offset = (t2 + t1) / 2 - tp;
 
-			printf("system time: %lld.%u\n",
+			printf("system time: %lld.%09u\n",
 				(pct+2*i)->sec, (pct+2*i)->nsec);
-			printf("phc    time: %lld.%u\n",
+			printf("phc    time: %lld.%09u\n",
 				(pct+2*i+1)->sec, (pct+2*i+1)->nsec);
-			printf("system time: %lld.%u\n",
+			printf("system time: %lld.%09u\n",
 				(pct+2*i+2)->sec, (pct+2*i+2)->nsec);
 			printf("system/phc clock time offset is %" PRId64 " ns\n"
 			       "system     clock time delay  is %" PRId64 " ns\n",



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux