Patchwork Cosmetic fix for resource allocator

login
register
about
Submitter Patrick Georgi
Date 2009-08-28 12:17:19
Message ID <1251461839.29304.17.camel@tetris>
Download mbox | patch
Permalink /patch/218/
State Accepted
Headers show

Comments

Patrick Georgi - 2009-08-28 12:17:19
Hi,

With this patch, the resource allocator doesn't complain about 0-sized
fixed resources that aren't actually fixed. No harm done, except minor
confusion when warnings about fixed resources appear when there are no
fixed resources.


Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>


Patrick
Stefan Reinauer - 2009-08-28 12:38:35
On 8/28/09 2:17 PM, Patrick Georgi wrote:
> Hi,
>
> With this patch, the resource allocator doesn't complain about 0-sized
> fixed resources that aren't actually fixed. No harm done, except minor
> confusion when warnings about fixed resources appear when there are no
> fixed resources.
>
>
> Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
>   
Ackeb-by: Stefan Reinauer <stepan@coresystems.de>
Uwe Hermann - 2009-08-28 12:46:28
On Fri, Aug 28, 2009 at 02:17:19PM +0200, Patrick Georgi wrote:
> With this patch, the resource allocator doesn't complain about 0-sized
> fixed resources that aren't actually fixed. No harm done, except minor
> confusion when warnings about fixed resources appear when there are no
> fixed resources.
> 
> Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>

Untested by me, but looks good.

Acked-by: Uwe Hermann <uwe@hermann-uwe.de>


Uwe.

Patch

Index: src/devices/device.c
===================================================================
--- src/devices/device.c	(Revision 4605)
+++ src/devices/device.c	(Arbeitskopie)
@@ -556,14 +556,14 @@ 
 	/* Constrain limits based on the fixed resources of this device. */
 	for (i = 0; i < dev->resources; i++) {
 		res = &dev->resource[i];
+		if (!(res->flags & IORESOURCE_FIXED))
+			continue;
 		if (!res->size) {
 			/* It makes no sense to have 0-sized, fixed resources.*/
 			printk_err("skipping %s@%lx fixed resource, size=0!\n",
 				   dev_path(dev), res->index);
 			continue;
 		}
-		if (!(res->flags & IORESOURCE_FIXED))
-			continue;
 
 		/* PREFETCH, MEM, or I/O - skip any others. */
 		if ((res->flags & MEM_MASK) == PREF_TYPE)