On Mon, Nov 03, 2014 at 02:57:31AM -0800, tip-bot for Jiang Liu wrote:
> Commit-ID:  e22ce93870deae0e9a54e1539f0088538f187780
> Gitweb:     http://git.kernel.org/tip/e22ce93870deae0e9a54e1539f0088538f187780
> Author:     Jiang Liu <[email protected]>
> AuthorDate: Mon, 27 Oct 2014 13:21:34 +0800
> Committer:  Thomas Gleixner <[email protected]>
> CommitDate: Mon, 3 Nov 2014 11:56:07 +0100
> 
> x86, PCI, ACPI: Kill private function resource_to_addr() in 
> arch/x86/pci/acpi.c
> 
> Private function resource_to_addr() is used to parse ACPI resources
> for PCI host bridge. There are public interfaces available for that
> purpose, so replace resource_to_addr() with public interfaces.
> 
> Signed-off-by: Jiang Liu <[email protected]>
> Reviewed-by: Bjorn Helgaas <[email protected]>
> Cc: Konrad Rzeszutek Wilk <[email protected]>
> Cc: Tony Luck <[email protected]>
> Cc: Joerg Roedel <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Rafael J. Wysocki <[email protected]>
> Cc: Randy Dunlap <[email protected]>
> Cc: Yinghai Lu <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Link: 
> http://lkml.kernel.org/r/[email protected]
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---

...

>  static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
>  {
>       struct pci_root_info *info = data;
> -     struct resource *res;
> -     struct acpi_resource_address64 addr;
> -     acpi_status status;
> -     unsigned long flags;
> -     u64 start, orig_end, end;
> +     u64 translation_offset = 0;
> +     struct resource r = {
> +             .flags = 0
> +     };
> +
> +     if (acpi_dev_resource_memory(acpi_res, &r)) {
> +             r.flags &= IORESOURCE_MEM | IORESOURCE_IO;
> +     } else if (acpi_dev_resource_address_space(acpi_res, &r)) {
> +             u64 orig_end;
> +             struct acpi_resource_address64 addr;
> +
> +             r.flags &= IORESOURCE_MEM | IORESOURCE_IO;
> +             if (r.flags == 0)
> +                     return AE_OK;
>  
> -     status = resource_to_addr(acpi_res, &addr);
> -     if (!ACPI_SUCCESS(status))
> -             return AE_OK;
> +             if (ACPI_FAILURE(acpi_resource_to_address64(acpi_res, &addr)))
> +                     return AE_OK;
>  
> -     if (addr.resource_type == ACPI_MEMORY_RANGE) {
> -             flags = IORESOURCE_MEM;
> -             if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY)
> -                     flags |= IORESOURCE_PREFETCH;
> -     } else if (addr.resource_type == ACPI_IO_RANGE) {
> -             flags = IORESOURCE_IO;
> -     } else
> -             return AE_OK;
> +             if (addr.resource_type == ACPI_MEMORY_RANGE &&
> +                 addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY)
> +                     r.flags |= IORESOURCE_PREFETCH;
>  
> -     start = addr.minimum + addr.translation_offset;
> -     orig_end = end = addr.maximum + addr.translation_offset;
> +             translation_offset = addr.translation_offset;
> +             orig_end = r.end;
> +             r.start += translation_offset;
> +             r.end += translation_offset;
>  
> -     /* Exclude non-addressable range or non-addressable portion of range */
> -     end = min(end, (u64)iomem_resource.end);
> -     if (end <= start) {
> -             dev_info(&info->bridge->dev,
> -                     "host bridge window [%#llx-%#llx] "
> -                     "(ignored, not CPU addressable)\n", start, orig_end);
> -             return AE_OK;
> -     } else if (orig_end != end) {
> -             dev_info(&info->bridge->dev,
> -                     "host bridge window [%#llx-%#llx] "
> -                     "([%#llx-%#llx] ignored, not CPU addressable)\n", 
> -                     start, orig_end, end + 1, orig_end);
> +             /* Exclude non-addressable range or non-addressable portion of 
> range */
> +             r.end = min(r.end, iomem_resource.end);
> +             if (r.end <= r.start) {
> +                     dev_info(&info->bridge->dev,
> +                             "host bridge window [%#llx-%#llx] (ignored, not 
> CPU addressable)\n",
> +                              r.start, orig_end);
> +                     return AE_OK;
> +             } else if (orig_end != r.end) {
> +                     dev_info(&info->bridge->dev,
> +                             "host bridge window [%#llx-%#llx] 
> ([%#llx-%#llx] ignored, not CPU addressable)\n",
> +                             r.start, orig_end, r.end + 1, orig_end);
> +             }

I see the warnings below on 32-bit, those resource_size_t things on
32-bit are u32 through the phys_addr_t typedef:

#ifdef CONFIG_PHYS_ADDR_T_64BIT
typedef u64 phys_addr_t;
#else
typedef u32 phys_addr_t;
#endif

typedef phys_addr_t resource_size_t;
---

arch/x86/pci/acpi.c: In function ‘setup_resource’:
arch/x86/pci/acpi.c:271:4: warning: format ‘%llx’ expects argument of type 
‘long long unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat=]
    dev_info(&info->bridge->dev,
    ^
arch/x86/pci/acpi.c:276:4: warning: format ‘%llx’ expects argument of type 
‘long long unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat=]
    dev_info(&info->bridge->dev,
    ^
arch/x86/pci/acpi.c:276:4: warning: format ‘%llx’ expects argument of type 
‘long long unsigned int’, but argument 5 has type ‘resource_size_t’ [-Wformat=]

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to