Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180713
b: refs/heads/master
c: 3dae93e
h: refs/heads/master
i:
  180711: 6cce01b
v: v3
  • Loading branch information
Mike Frysinger authored and Wim Van Sebroeck committed Feb 21, 2010
1 parent 89e1c6b commit f6bc998
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 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: 87b8d1adefa1548b591cbf0d63965987e2cf893d
refs/heads/master: 3dae93ec3ee1fceec69f40ef9b97892ce62ba7a5
13 changes: 7 additions & 6 deletions trunk/drivers/watchdog/bfin_wdt.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* Blackfin On-Chip Watchdog Driver
* Supports BF53[123]/BF53[467]/BF54[2489]/BF561
*
* Originally based on softdog.c
* Copyright 2006-2007 Analog Devices Inc.
* Copyright 2006-2010 Analog Devices Inc.
* Copyright 2006-2007 Michele d'Amico
* Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>
*
Expand Down Expand Up @@ -137,13 +136,15 @@ static int bfin_wdt_running(void)
*/
static int bfin_wdt_set_timeout(unsigned long t)
{
u32 cnt;
u32 cnt, max_t, sclk;
unsigned long flags;

stampit();
sclk = get_sclk();
max_t = -1 / sclk;
cnt = t * sclk;
stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt);

cnt = t * get_sclk();
if (cnt < get_sclk()) {
if (t > max_t) {
printk(KERN_WARNING PFX "timeout value is too large\n");
return -EINVAL;
}
Expand Down
36 changes: 21 additions & 15 deletions trunk/mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,27 +1002,33 @@ static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages,
#define DO_PAGES_STAT_CHUNK_NR 16
const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR];
int chunk_status[DO_PAGES_STAT_CHUNK_NR];
unsigned long i, chunk_nr = DO_PAGES_STAT_CHUNK_NR;
int err;

while (nr_pages) {
unsigned long chunk_nr;

chunk_nr = nr_pages;
if (chunk_nr > DO_PAGES_STAT_CHUNK_NR)
chunk_nr = DO_PAGES_STAT_CHUNK_NR;
for (i = 0; i < nr_pages; i += chunk_nr) {
if (chunk_nr > nr_pages - i)
chunk_nr = nr_pages - i;

if (copy_from_user(chunk_pages, pages, chunk_nr * sizeof(*chunk_pages)))
break;
err = copy_from_user(chunk_pages, &pages[i],
chunk_nr * sizeof(*chunk_pages));
if (err) {
err = -EFAULT;
goto out;
}

do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status);

if (copy_to_user(status, chunk_status, chunk_nr * sizeof(*status)))
break;

pages += chunk_nr;
status += chunk_nr;
nr_pages -= chunk_nr;
err = copy_to_user(&status[i], chunk_status,
chunk_nr * sizeof(*chunk_status));
if (err) {
err = -EFAULT;
goto out;
}
}
return nr_pages ? -EFAULT : 0;
err = 0;

out:
return err;
}

/*
Expand Down

0 comments on commit f6bc998

Please sign in to comment.