Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
pcmcia: fix up alignf issues

+14 -17
+14 -17
drivers/pcmcia/rsrc_nonstatic.c
··· 596 struct resource_map *map; 597 }; 598 599 - static resource_size_t 600 - pcmcia_common_align(void *align_data, const struct resource *res, 601 - resource_size_t size, resource_size_t align) 602 { 603 - struct pcmcia_align_data *data = align_data; 604 - resource_size_t start; 605 /* 606 * Ensure that we have the correct start address 607 */ 608 - start = (res->start & ~data->mask) + data->offset; 609 - if (start < res->start) 610 - start += data->mask + 1; 611 - return start; 612 } 613 614 static resource_size_t ··· 617 struct resource_map *m; 618 resource_size_t start; 619 620 - start = pcmcia_common_align(data, res, size, align); 621 622 for (m = data->map->next; m != data->map; m = m->next) { 623 - unsigned long start = m->base; 624 - unsigned long end = m->base + m->num - 1; 625 626 /* 627 * If the lower resources are not available, try aligning 628 * to this entry of the resource database to see if it'll 629 * fit here. 630 */ 631 - if (res->start < start) { 632 - start = pcmcia_common_align(data, res, size, align); 633 - } 634 635 /* 636 * If we're above the area which was passed in, there's 637 * no point proceeding. 638 */ 639 - if (res->start >= res->end) 640 break; 641 642 - if ((res->start + size - 1) <= end) 643 break; 644 } 645
··· 596 struct resource_map *map; 597 }; 598 599 + static resource_size_t pcmcia_common_align(struct pcmcia_align_data *align_data, 600 + resource_size_t start) 601 { 602 + resource_size_t ret; 603 /* 604 * Ensure that we have the correct start address 605 */ 606 + ret = (start & ~align_data->mask) + align_data->offset; 607 + if (ret < start) 608 + ret += align_data->mask + 1; 609 + return ret; 610 } 611 612 static resource_size_t ··· 619 struct resource_map *m; 620 resource_size_t start; 621 622 + start = pcmcia_common_align(data, res->start); 623 624 for (m = data->map->next; m != data->map; m = m->next) { 625 + unsigned long map_start = m->base; 626 + unsigned long map_end = m->base + m->num - 1; 627 628 /* 629 * If the lower resources are not available, try aligning 630 * to this entry of the resource database to see if it'll 631 * fit here. 632 */ 633 + if (start < map_start) 634 + start = pcmcia_common_align(data, map_start); 635 636 /* 637 * If we're above the area which was passed in, there's 638 * no point proceeding. 639 */ 640 + if (start >= res->end) 641 break; 642 643 + if ((start + size - 1) <= map_end) 644 break; 645 } 646