Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83412
b: refs/heads/master
c: 5e2cb10
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Linus Torvalds committed Feb 6, 2008
1 parent 2f29d03 commit f5feb17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be6c28e62e3a304b74013afab029af2021e1f50d
refs/heads/master: 5e2cb1018a8a583b83d56c80f46507da6f3f2b57
19 changes: 10 additions & 9 deletions trunk/kernel/time/clocksource.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,13 @@ void clocksource_unregister(struct clocksource *cs)
static ssize_t
sysfs_show_current_clocksources(struct sys_device *dev, char *buf)
{
char *curr = buf;
ssize_t count = 0;

spin_lock_irq(&clocksource_lock);
curr += sprintf(curr, "%s ", curr_clocksource->name);
count = snprintf(buf, PAGE_SIZE, "%s\n", curr_clocksource->name);
spin_unlock_irq(&clocksource_lock);

curr += sprintf(curr, "\n");

return curr - buf;
return count;
}

/**
Expand Down Expand Up @@ -439,17 +437,20 @@ static ssize_t
sysfs_show_available_clocksources(struct sys_device *dev, char *buf)
{
struct clocksource *src;
char *curr = buf;
ssize_t count = 0;

spin_lock_irq(&clocksource_lock);
list_for_each_entry(src, &clocksource_list, list) {
curr += sprintf(curr, "%s ", src->name);
count += snprintf(buf + count,
max((ssize_t)PAGE_SIZE - count, (ssize_t)0),
"%s ", src->name);
}
spin_unlock_irq(&clocksource_lock);

curr += sprintf(curr, "\n");
count += snprintf(buf + count,
max((ssize_t)PAGE_SIZE - count, (ssize_t)0), "\n");

return curr - buf;
return count;
}

/*
Expand Down

0 comments on commit f5feb17

Please sign in to comment.