asihpi: Fix compatibility with 64-bit resource_size_t
PATCH 1/1 asihpi: Fix compatibility with 64-bit resource_size_t
In recent kernels the resource_size_t type can be either 32-bit or 64-bit depending on config options. The proper way to printk such values is to cast them to unsigned long long.
---
Without the patch compilation on 2.6.18 produces warnings:
.../pci/asihpi/hpimod.c: In function 'adapter_probe':.../pci/asihpi/hpimod.c:460: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'resource_size_t' .../pci/asihpi/hpimod.c:460: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'resource_size_t'
pci/asihpi/hpimod.c renamed from pci/asihpi/hpimod.c.alt-asihpi-warnings +3 -3
@@ -457,10 +457,10 @@ static int __devinit adapter_probe(struc// fill in HPI_PCI information from kernel provided information for (idx =0 ; idx <HPI_MAX_ADAPTER_MEM_SPACES ; idx++) { -HPI_DEBUG_LOG4 (DEBUG ,"Resource %d %s %x-%x\n" , idx, +HPI_DEBUG_LOG4 (DEBUG ,"Resource %d %s %llx-%llx\n" , idx, pci_dev->resource[idx].name, -pci_resource_start (pci_dev, idx), -pci_resource_end (pci_dev, idx)); + (unsigned long long )pci_resource_start (pci_dev, idx), + (unsigned long long )pci_resource_end (pci_dev, idx)); memlen =pci_resource_len (pci_dev, idx);if (memlen) {
Takashi Iwai
AppliedAt Mon, 11 Jun 2007 20:26:48 +0400,
Quoted 6 lines · Sergey Vlasov
In recent kernels the
resource_size_ttype can be either 32-bit or 64-bit depending on config options. The proper way to printk such values is to cast them to unsigned long long.Signed-off-by Sergey Vlasov <[email protected]>
Thanks, applied to HG tree now.
Takashi