resource: add resource_size()
Avoid one-off errors by introducing a resource_size() function. Signed-off-by: Magnus Damm <damm@igel.co.jp> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e958d3ace7
commit
1a4e564b7d
@@ -490,7 +490,7 @@ resource_size_t resource_alignment(struct resource *res)
|
||||
{
|
||||
switch (res->flags & (IORESOURCE_SIZEALIGN | IORESOURCE_STARTALIGN)) {
|
||||
case IORESOURCE_SIZEALIGN:
|
||||
return res->end - res->start + 1;
|
||||
return resource_size(res);
|
||||
case IORESOURCE_STARTALIGN:
|
||||
return res->start;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user