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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>

---
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_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) {
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux