pci_device_solx_devfs_read: fix sign conversion/comparison warnings
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 6 Jul 2013 16:56:46 +0000 (09:56 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 6 Jul 2013 16:56:46 +0000 (09:56 -0700)
Fixes:
solx_devfs.c:824:19: warning: comparison of integers of different signs: 'int' and 'pciaddr_t' (aka 'unsigned long') [-Wsign-compare]
    for (i = 0; i < size; i += PCITOOL_ACC_ATTR_SIZE(PCITOOL_ACC_ATTR_SIZE_1))
                ~ ^ ~~~~
solx_devfs.c:826:28: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
        cfg_prg.offset = offset + i;
                                ~ ^
solx_devfs.c:844:19: warning: implicit conversion changes signedness: 'int' to 'pciaddr_t' (aka 'unsigned long') [-Wsign-conversion]
    *bytes_read = i;
                ~ ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
src/solx_devfs.c

index 433969f..df64e71 100644 (file)
@@ -802,7 +802,7 @@ pci_device_solx_devfs_read( struct pci_device * dev, void * data,
 {
     pcitool_reg_t cfg_prg;
     int err = 0;
-    int i = 0;
+    unsigned int i = 0;
     nexus_t *nexus;
 
     nexus = find_nexus_for_bus(dev->domain, dev->bus);