Skip to content

Lesson06: Time management demo module#82

Open
vad32m wants to merge 3 commits into
Kernel-GL-HRK:Vadym.Mishchukfrom
vad32m:lesson06
Open

Lesson06: Time management demo module#82
vad32m wants to merge 3 commits into
Kernel-GL-HRK:Vadym.Mishchukfrom
vad32m:lesson06

Conversation

@vad32m

@vad32m vad32m commented Nov 11, 2018

Copy link
Copy Markdown

This module creates two sysfs files:

  • /sys/class/time_demo/log_period which can be written to adjust period, between messages thst module prints to log. This file may be read as well;
  • /sys/class/time_demo/prev_read_info which is read-only and contains time when previous read occurred and amount of seconds since last read;

@DevyatovAndrey DevyatovAndrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for boundary values is nesessary.

Comment thread 06-TimeManagement/solution/tim_module.c Outdated
static ssize_t log_period_store(struct class *class,
struct class_attribute *attr, const char *buf, size_t count)
{
if (kstrtoul(buf, 10, &log_period_ms)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be if user enter zero as log_period_ms value?

@DevyatovAndrey DevyatovAndrey added the changes requested The PR review revealed issues which should be fixed (set by reviewer). label Nov 12, 2018
Signed-off-by: Vadym Mishchuk <superoriginalmailboxname@gmail.com>
@vad32m vad32m added ready and removed changes requested The PR review revealed issues which should be fixed (set by reviewer). labels Nov 13, 2018
Signed-off-by: Vadym Mishchuk <superoriginalmailboxname@gmail.com>
Signed-off-by: Vadym Mishchuk <superoriginalmailboxname@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants