提交 f309cb3e 编写于 作者: D Dominik Brodowski

pcmcia: allow for extension of resource interval

If a new interval overlaps or extends an existing interval in
add_interval(), do not fail, but extend the existing interval.
Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
上级 d801c140
......@@ -124,8 +124,10 @@ static int add_interval(struct resource_map *map, u_long base, u_long num)
struct resource_map *p, *q;
for (p = map; ; p = p->next) {
if ((p != map) && (p->base+p->num-1 >= base))
return -1;
if ((p != map) && (p->base+p->num >= base)) {
p->num = max(num + base - p->base, p->num);
return 0;
}
if ((p->next == map) || (p->next->base > base+num-1))
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册