diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-02-24 08:35:26 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-02-24 08:35:26 +0700 |
commit | 6c5dadef809982e05b16ba7cf309e7c642a1b56a (patch) | |
tree | 1524a508c2cdf116b160732d002179e7537b20a7 /kernel | |
parent | ade046f9db4d92795249a3e3ce2b8cebf6dce0c7 (diff) | |
parent | 21d69845e411bfcee426070af5416ddfba350529 (diff) | |
download | kernel_samsung_aries-6c5dadef809982e05b16ba7cf309e7c642a1b56a.zip kernel_samsung_aries-6c5dadef809982e05b16ba7cf309e7c642a1b56a.tar.gz kernel_samsung_aries-6c5dadef809982e05b16ba7cf309e7c642a1b56a.tar.bz2 |
Merge 3.0.66
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 13 | ||||
-rw-r--r-- | kernel/resource.c | 50 |
2 files changed, 50 insertions, 13 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 2414614..a1d702c 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -684,8 +684,19 @@ static void call_console_drivers(unsigned start, unsigned end) start_print = start; while (cur_index != end) { if (msg_level < 0 && ((end - cur_index) > 2)) { + /* + * prepare buf_prefix, as a contiguous array, + * to be processed by log_prefix function + */ + char buf_prefix[SYSLOG_PRI_MAX_LENGTH+1]; + unsigned i; + for (i = 0; i < ((end - cur_index)) && (i < SYSLOG_PRI_MAX_LENGTH); i++) { + buf_prefix[i] = LOG_BUF(cur_index + i); + } + buf_prefix[i] = '\0'; /* force '\0' as last string character */ + /* strip log prefix */ - cur_index += log_prefix(&LOG_BUF(cur_index), &msg_level, NULL); + cur_index += log_prefix((const char *)&buf_prefix, &msg_level, NULL); start_print = cur_index; } while (cur_index != end) { diff --git a/kernel/resource.c b/kernel/resource.c index b29b83d..d005cd3 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -736,6 +736,7 @@ static void __init __reserve_region_with_split(struct resource *root, struct resource *parent = root; struct resource *conflict; struct resource *res = kzalloc(sizeof(*res), GFP_ATOMIC); + struct resource *next_res = NULL; if (!res) return; @@ -745,21 +746,46 @@ static void __init __reserve_region_with_split(struct resource *root, res->end = end; res->flags = IORESOURCE_BUSY; - conflict = __request_resource(parent, res); - if (!conflict) - return; + while (1) { - /* failed, split and try again */ - kfree(res); + conflict = __request_resource(parent, res); + if (!conflict) { + if (!next_res) + break; + res = next_res; + next_res = NULL; + continue; + } - /* conflict covered whole area */ - if (conflict->start <= start && conflict->end >= end) - return; + /* conflict covered whole area */ + if (conflict->start <= res->start && + conflict->end >= res->end) { + kfree(res); + WARN_ON(next_res); + break; + } + + /* failed, split and try again */ + if (conflict->start > res->start) { + end = res->end; + res->end = conflict->start - 1; + if (conflict->end < end) { + next_res = kzalloc(sizeof(*next_res), + GFP_ATOMIC); + if (!next_res) { + kfree(res); + break; + } + next_res->name = name; + next_res->start = conflict->end + 1; + next_res->end = end; + next_res->flags = IORESOURCE_BUSY; + } + } else { + res->start = conflict->end + 1; + } + } - if (conflict->start > start) - __reserve_region_with_split(root, start, conflict->start-1, name); - if (conflict->end < end) - __reserve_region_with_split(root, conflict->end+1, end, name); } void __init reserve_region_with_split(struct resource *root, |