From: Bjorn Helgaas Date: Wed, 5 Feb 2014 03:32:28 +0000 (-0800) Subject: resource: Add resource_contains() X-Git-Tag: v3.15-rc1~143^2^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5edb93b89f6cc3089ee283656555e7a9ad36a8a0;p=pandora-kernel.git resource: Add resource_contains() We have two identical copies of resource_contains() already, and more places that could use it. This moves it to ioport.h where it can be shared. resource_contains(struct resource *r1, struct resource *r2) returns true iff r1 and r2 are the same type (most callers already checked this separately) and the r1 address range completely contains r2. In addition, the new resource_contains() checks that both r1 and r2 have addresses assigned to them. If a resource is IORESOURCE_UNSET, it doesn't have a valid address and can't contain or be contained by another resource. Some callers already check this or for res->start. No functional change. Signed-off-by: Bjorn Helgaas --- Reading git-diff-tree failed