Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson06: Time management demo module #82

Open
wants to merge 3 commits into
base: Vadym.Mishchuk
Choose a base branch
from

Conversation

vad32m
Copy link

@vad32m vad32m commented Nov 11, 2018

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;

Copy link
Contributor

@DevyatovAndrey DevyatovAndrey left a comment

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.

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
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
@vad32m vad32m added ready and removed changes requested The PR review revealed issues which should be fixed (set by reviewer). labels Nov 13, 2018
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