From df80387822c50a0c028e188bbccf20d9966cae6f Mon Sep 17 00:00:00 2001 From: "Oleg.Khokhlov" Date: Tue, 13 Nov 2018 21:52:39 +0200 Subject: [PATCH] Lesson06: add/change some comments to module source code Signed-off-by: Oleg.Khokhlov --- 06-TimeManagement/omod6_kern_time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/06-TimeManagement/omod6_kern_time.c b/06-TimeManagement/omod6_kern_time.c index 268610b..070c9e3 100644 --- a/06-TimeManagement/omod6_kern_time.c +++ b/06-TimeManagement/omod6_kern_time.c @@ -95,7 +95,6 @@ static ssize_t ktime_show(struct class *cl, sprintf(buf, "ktime (%u ticks, %u HZ):\n", (uint32_t)get_jiffies_64(), HZ); sprintf(strchr(buf, 0), "%u module call\n", ModCallCount); sprintf(strchr(buf, 0), "%u sec from last call\n", dT); -// sprintf(strchr(buf, 0), "%u sec curr abs time from Epoch (year:%d)\n", TS, 1970+TS/(3600*24*365)); rtc_time64_to_tm(TS, &tm); //https://ru.wikipedia.org/wiki/Time.h sprintf(strchr(buf, 0), "%u sec curr abs time from Epoch (%d.%02d.%02d, %02d:%02d:%02d)\n", TS, @@ -161,6 +160,7 @@ static ssize_t ktime_store(struct class *cl, } } else { unsigned long expired = get_jiffies_64() + interval * HZ / 1000; + //--- commented code is not needed - timer works without it --- //if (timer_pending(&MyTimer)) { // mod_timer_pending(&MyTimer, expired); //} else { @@ -218,5 +218,5 @@ module_exit(omod_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Oleg Khokhlov"); MODULE_DESCRIPTION("OlegH Lesson06 module: test kernel time funcs"); -MODULE_VERSION("0.1"); +MODULE_VERSION("0.2");