[alsa-devel] [PATCH] asihpi: Fix compatibility with 64-bit resource_size_t

Sergey Vlasov vsu at altlinux.ru
Mon Jun 11 18:26:48 CEST 2007

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.

Signed-off-by: Sergey Vlasov <vsu at altlinux.ru>

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'

--- alsa-driver-1.0.14/pci/asihpi/hpimod.c.alt-asihpi-warnings	2007-06-11 16:29:28 +0400
+++ alsa-driver-1.0.14/pci/asihpi/hpimod.c	2007-06-11 19:58:30 +0400
@@ -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_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) {

More information about the Alsa-devel mailing list