]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
powerpc/powernv: Data type unsigned int for PE number
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Tue, 3 May 2016 05:41:25 +0000 (15:41 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 11 May 2016 11:54:17 +0000 (21:54 +1000)
This changes the data type of PE number from "int" to "unsigned int"
in order to match the fact PE number is never negative:

   * The number of PE to which the specified PCI device is attached.
   * The PE number map for SRIOV VFs.
   * The returned PE number from pnv_ioda_alloc_pe().
   * The returned PE number from pnv_ioda2_pick_m64_pe().

Suggested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-By: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/powernv/pci.h

index 023c8c889f444daf50e0fe16a9edfc24868cb204..220129f333f937e0f45f9a172137cb14514eedf3 100644 (file)
@@ -209,14 +209,14 @@ struct pci_dn {
 #ifdef CONFIG_EEH
        struct eeh_dev *edev;           /* eeh device */
 #endif
-#define IODA_INVALID_PE                (-1)
+#define IODA_INVALID_PE                0xFFFFFFFF
 #ifdef CONFIG_PPC_POWERNV
-       int     pe_number;
+       unsigned int pe_number;
        int     vf_index;               /* VF index in the PF */
 #ifdef CONFIG_PCI_IOV
        u16     vfs_expanded;           /* number of VFs IOV BAR expanded */
        u16     num_vfs;                /* number of VFs enabled*/
-       int     *pe_num_map;            /* PE# for the first VF PE or array */
+       unsigned int *pe_num_map;       /* PE# for the first VF PE or array */
        bool    m64_single_mode;        /* Use M64 BAR in Single Mode */
 #define IODA_INVALID_M64        (-1)
        int     (*m64_map)[PCI_SRIOV_NUM_BARS];
index 1d2514f33925365a89a2527e8639c7972f9a1121..4aa6cdf33268f72a0a54d288ed8a7f11bf559cb4 100644 (file)
@@ -138,7 +138,7 @@ static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no)
        phb->ioda.pe_array[pe_no].pe_number = pe_no;
 }
 
-static int pnv_ioda_alloc_pe(struct pnv_phb *phb)
+static unsigned int pnv_ioda_alloc_pe(struct pnv_phb *phb)
 {
        unsigned long pe;
 
@@ -261,7 +261,7 @@ static void pnv_ioda2_reserve_m64_pe(struct pci_bus *bus,
        }
 }
 
-static int pnv_ioda2_pick_m64_pe(struct pci_bus *bus, bool all)
+static unsigned int pnv_ioda2_pick_m64_pe(struct pci_bus *bus, bool all)
 {
        struct pci_controller *hose = pci_bus_to_host(bus);
        struct pnv_phb *phb = hose->private_data;
@@ -919,7 +919,7 @@ static struct pnv_ioda_pe *pnv_ioda_setup_dev_PE(struct pci_dev *dev)
        struct pnv_phb *phb = hose->private_data;
        struct pci_dn *pdn = pci_get_pdn(dev);
        struct pnv_ioda_pe *pe;
-       int pe_num;
+       unsigned int pe_num;
 
        if (!pdn) {
                pr_err("%s: Device tree node not associated properly\n",
@@ -1010,7 +1010,7 @@ static void pnv_ioda_setup_bus_PE(struct pci_bus *bus, bool all)
        struct pci_controller *hose = pci_bus_to_host(bus);
        struct pnv_phb *phb = hose->private_data;
        struct pnv_ioda_pe *pe;
-       int pe_num = IODA_INVALID_PE;
+       unsigned int pe_num = IODA_INVALID_PE;
 
        /* Check if PE is determined by M64 */
        if (phb->pick_m64_pe)
index 88255eb877029cc4ed53a0bd44e2403b1b80ca4c..1d92bd93bcd9f5c8d28d760088bb3fcdeb14365f 100644 (file)
@@ -367,7 +367,7 @@ static void pnv_pci_config_check_eeh(struct pci_dn *pdn)
        struct pnv_phb *phb = pdn->phb->private_data;
        u8      fstate;
        __be16  pcierr;
-       int     pe_no;
+       unsigned int pe_no;
        s64     rc;
 
        /*
index 784882a1db07bb773444706ea5a4ee9a73f3c042..66f256920296249e862318b1e0f69229f3b9cbae 100644 (file)
@@ -113,7 +113,7 @@ struct pnv_phb {
        int (*init_m64)(struct pnv_phb *phb);
        void (*reserve_m64_pe)(struct pci_bus *bus,
                               unsigned long *pe_bitmap, bool all);
-       int (*pick_m64_pe)(struct pci_bus *bus, bool all);
+       unsigned int (*pick_m64_pe)(struct pci_bus *bus, bool all);
        int (*get_pe_state)(struct pnv_phb *phb, int pe_no);
        void (*freeze_pe)(struct pnv_phb *phb, int pe_no);
        int (*unfreeze_pe)(struct pnv_phb *phb, int pe_no, int opt);