diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-21 11:52:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-21 11:52:16 -0800 |
commit | d43421565bf0510d35e6a39ebf96586ad486f3aa (patch) | |
tree | f3a6cf9f5284d0146c9c858dc96c5b6bcdf28dc9 /drivers/pci/hotplug/cpqphp_nvram.c | |
parent | 859e762544902c3e09b3f8d994aab80ea5ff5042 (diff) | |
parent | 9662e32c810ad3e6ce49832d5f585a54f8fbdbdb (diff) | |
download | linux-d43421565bf0510d35e6a39ebf96586ad486f3aa.tar.bz2 |
Merge tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"PCI changes for the v4.5 merge window:
Enumeration:
- Simplify config space size computation (Bjorn Helgaas)
- Avoid iterating through ROM outside the resource window (Edward O'Callaghan)
- Support PCIe devices with short cfg_size (Jason S. McMullan)
- Add Netronome vendor and device IDs (Jason S. McMullan)
- Limit config space size for Netronome NFP6000 family (Jason S. McMullan)
- Add Netronome NFP4000 PF device ID (Simon Horman)
- Limit config space size for Netronome NFP4000 (Simon Horman)
- Print warnings for all invalid expansion ROM headers (Vladis Dronov)
Resource management:
- Fix minimum allocation address overwrite (Christoph Biedl)
PCI device hotplug:
- acpiphp_ibm: Fix null dereferences on null ibm_slot (Colin Ian King)
- pciehp: Always protect pciehp_disable_slot() with hotplug mutex (Guenter Roeck)
- shpchp: Constify hpc_ops structure (Julia Lawall)
- ibmphp: Remove unneeded NULL test (Julia Lawall)
Power management:
- Make ASPM sysfs link_state_store() consistent with link_state_show() (Andy Lutomirski)
Virtualization
- Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183 (Tim Sander)
MSI:
- Remove empty pci_msi_init_pci_dev() (Bjorn Helgaas)
- Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD (Grygorii Strashko)
- Initialize MSI capability for all architectures (Guilherme G. Piccoli)
- Relax msi_domain_alloc() to support parentless MSI irqdomains (Liu Jiang)
ARM Versatile host bridge driver:
- Remove unused pci_sys_data structures (Lorenzo Pieralisi)
Broadcom iProc host bridge driver:
- Hide CONFIG_PCIE_IPROC (Arnd Bergmann)
- Do not use 0x in front of %pap (Dmitry V. Krivenok)
- Update iProc PCIe device tree binding (Ray Jui)
- Add PAXC interface support (Ray Jui)
- Add iProc PCIe MSI device tree binding (Ray Jui)
- Add iProc PCIe MSI support (Ray Jui)
Freescale i.MX6 host bridge driver:
- Use gpio_set_value_cansleep() (Fabio Estevam)
- Add support for active-low reset GPIO (Petr Štetiar)
HiSilicon host bridge driver:
- Add support for HiSilicon Hip06 PCIe host controllers (Gabriele Paoloni)
Intel VMD host bridge driver:
- Export irq_domain_set_info() for module use (Keith Busch)
- x86/PCI: Allow DMA ops specific to a PCI domain (Keith Busch)
- Use 32 bit PCI domain numbers (Keith Busch)
- Add driver for Intel Volume Management Device (VMD) (Keith Busch)
Qualcomm host bridge driver:
- Document PCIe devicetree bindings (Stanimir Varbanov)
- Add Qualcomm PCIe controller driver (Stanimir Varbanov)
- dts: apq8064: add PCIe devicetree node (Stanimir Varbanov)
- dts: ifc6410: enable PCIe DT node for this board (Stanimir Varbanov)
Renesas R-Car host bridge driver:
- Add support for R-Car H3 to pcie-rcar (Harunobu Kurokawa)
- Allow DT to override default window settings (Phil Edworthy)
- Convert to DT resource parsing API (Phil Edworthy)
- Revert "PCI: rcar: Build pcie-rcar.c only on ARM" (Phil Edworthy)
- Remove unused pci_sys_data struct from pcie-rcar (Phil Edworthy)
- Add runtime PM support to pcie-rcar (Phil Edworthy)
- Add Gen2 PHY setup to pcie-rcar (Phil Edworthy)
- Add gen2 fallback compatibility string for pci-rcar-gen2 (Simon Horman)
- Add gen2 fallback compatibility string for pcie-rcar (Simon Horman)
Synopsys DesignWare host bridge driver:
- Simplify control flow (Bjorn Helgaas)
- Make config accessor override checking symmetric (Bjorn Helgaas)
- Ensure ATU is enabled before IO/conf space accesses (Stanimir Varbanov)
Miscellaneous:
- Add of_pci_get_host_bridge_resources() stub (Arnd Bergmann)
- Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask (Bjorn Helgaas)
- Fix all whitespace issues (Bogicevic Sasa)
- x86/PCI: Simplify pci_bios_{read,write} (Geliang Tang)
- Use to_pci_dev() instead of open-coding it (Geliang Tang)
- Use kobj_to_dev() instead of open-coding it (Geliang Tang)
- Use list_for_each_entry() to simplify code (Geliang Tang)
- Fix typos in <linux/msi.h> (Thomas Petazzoni)
- x86/PCI: Clarify AMD Fam10h config access restrictions comment (Tomasz Nowicki)"
* tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (58 commits)
PCI: Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183
PCI: Limit config space size for Netronome NFP4000
PCI: Add Netronome NFP4000 PF device ID
x86/PCI: Add driver for Intel Volume Management Device (VMD)
PCI/AER: Use 32 bit PCI domain numbers
x86/PCI: Allow DMA ops specific to a PCI domain
irqdomain: Export irq_domain_set_info() for module use
PCI: host: Add of_pci_get_host_bridge_resources() stub
genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains
PCI: rcar: Add Gen2 PHY setup to pcie-rcar
PCI: rcar: Add runtime PM support to pcie-rcar
PCI: designware: Make config accessor override checking symmetric
PCI: ibmphp: Remove unneeded NULL test
ARM: dts: ifc6410: enable PCIe DT node for this board
ARM: dts: apq8064: add PCIe devicetree node
PCI: hotplug: Use list_for_each_entry() to simplify code
PCI: rcar: Remove unused pci_sys_data struct from pcie-rcar
PCI: hisi: Add support for HiSilicon Hip06 PCIe host controllers
PCI: Avoid iterating through memory outside the resource window
PCI: acpiphp_ibm: Fix null dereferences on null ibm_slot
...
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_nvram.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_nvram.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 1e08ff8c229c..c25fc9061059 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c @@ -114,10 +114,10 @@ static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, u32 *avail) if ((*used + 1) > *avail) return(1); - *((u8*)*p_buffer) = value; - tByte = (u8**)p_buffer; + *((u8 *)*p_buffer) = value; + tByte = (u8 **)p_buffer; (*tByte)++; - *used+=1; + *used += 1; return(0); } @@ -129,7 +129,7 @@ static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail) **p_buffer = value; (*p_buffer)++; - *used+=4; + *used += 4; return(0); } @@ -141,7 +141,7 @@ static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail) * * returns 0 for non-Compaq ROM, 1 for Compaq ROM */ -static int check_for_compaq_ROM (void __iomem *rom_start) +static int check_for_compaq_ROM(void __iomem *rom_start) { u8 temp1, temp2, temp3, temp4, temp5, temp6; int result = 0; @@ -160,12 +160,12 @@ static int check_for_compaq_ROM (void __iomem *rom_start) (temp6 == 'Q')) { result = 1; } - dbg ("%s - returned %d\n", __func__, result); + dbg("%s - returned %d\n", __func__, result); return result; } -static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size) +static u32 access_EV(u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size) { unsigned long flags; int op = operation; @@ -197,7 +197,7 @@ static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size) * * Read the hot plug Resource Table from NVRAM */ -static int load_HRT (void __iomem *rom_start) +static int load_HRT(void __iomem *rom_start) { u32 available; u32 temp_dword; @@ -232,7 +232,7 @@ static int load_HRT (void __iomem *rom_start) * * Save the hot plug Resource Table in NVRAM */ -static u32 store_HRT (void __iomem *rom_start) +static u32 store_HRT(void __iomem *rom_start) { u32 *buffer; u32 *pFill; @@ -252,7 +252,7 @@ static u32 store_HRT (void __iomem *rom_start) if (!check_for_compaq_ROM(rom_start)) return(1); - buffer = (u32*) evbuffer; + buffer = (u32 *) evbuffer; if (!buffer) return(1); @@ -306,7 +306,7 @@ static u32 store_HRT (void __iomem *rom_start) loop = 0; while (resNode) { - loop ++; + loop++; /* base */ rc = add_dword(&pFill, resNode->base, &usedbytes, &available); @@ -331,7 +331,7 @@ static u32 store_HRT (void __iomem *rom_start) loop = 0; while (resNode) { - loop ++; + loop++; /* base */ rc = add_dword(&pFill, resNode->base, &usedbytes, &available); @@ -356,7 +356,7 @@ static u32 store_HRT (void __iomem *rom_start) loop = 0; while (resNode) { - loop ++; + loop++; /* base */ rc = add_dword(&pFill, resNode->base, &usedbytes, &available); @@ -381,7 +381,7 @@ static u32 store_HRT (void __iomem *rom_start) loop = 0; while (resNode) { - loop ++; + loop++; /* base */ rc = add_dword(&pFill, resNode->base, &usedbytes, &available); @@ -408,7 +408,7 @@ static u32 store_HRT (void __iomem *rom_start) temp_dword = usedbytes; - rc = access_EV(WRITE_EV, "CQTHPS", (u8*) buffer, &temp_dword); + rc = access_EV(WRITE_EV, "CQTHPS", (u8 *) buffer, &temp_dword); dbg("usedbytes = 0x%x, length = 0x%x\n", usedbytes, temp_dword); @@ -423,7 +423,7 @@ static u32 store_HRT (void __iomem *rom_start) } -void compaq_nvram_init (void __iomem *rom_start) +void compaq_nvram_init(void __iomem *rom_start) { if (rom_start) compaq_int15_entry_point = (rom_start + ROM_INT15_PHY_ADDR - ROM_PHY_ADDR); @@ -435,7 +435,7 @@ void compaq_nvram_init (void __iomem *rom_start) } -int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) +int compaq_nvram_load(void __iomem *rom_start, struct controller *ctrl) { u8 bus, device, function; u8 nummem, numpmem, numio, numbus; @@ -451,7 +451,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) if (!evbuffer_init) { /* Read the resource list information in from NVRAM */ if (load_HRT(rom_start)) - memset (evbuffer, 0, 1024); + memset(evbuffer, 0, 1024); evbuffer_init = 1; } @@ -472,7 +472,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) p_byte += 3; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) return 2; bus = p_ev_ctrl->bus; @@ -489,20 +489,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) return 2; /* Skip forward to the next entry */ p_byte += (nummem + numpmem + numio + numbus) * 8; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) return 2; p_ev_ctrl = (struct ev_hrt_ctrl *) p_byte; p_byte += 3; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) return 2; bus = p_ev_ctrl->bus; @@ -517,7 +517,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) return 2; while (nummem--) { @@ -526,20 +526,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) if (!mem_node) break; - mem_node->base = *(u32*)p_byte; - dbg("mem base = %8.8x\n",mem_node->base); + mem_node->base = *(u32 *)p_byte; + dbg("mem base = %8.8x\n", mem_node->base); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(mem_node); return 2; } - mem_node->length = *(u32*)p_byte; - dbg("mem length = %8.8x\n",mem_node->length); + mem_node->length = *(u32 *)p_byte; + dbg("mem length = %8.8x\n", mem_node->length); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(mem_node); return 2; } @@ -554,20 +554,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) if (!p_mem_node) break; - p_mem_node->base = *(u32*)p_byte; - dbg("pre-mem base = %8.8x\n",p_mem_node->base); + p_mem_node->base = *(u32 *)p_byte; + dbg("pre-mem base = %8.8x\n", p_mem_node->base); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(p_mem_node); return 2; } - p_mem_node->length = *(u32*)p_byte; - dbg("pre-mem length = %8.8x\n",p_mem_node->length); + p_mem_node->length = *(u32 *)p_byte; + dbg("pre-mem length = %8.8x\n", p_mem_node->length); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(p_mem_node); return 2; } @@ -582,20 +582,20 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) if (!io_node) break; - io_node->base = *(u32*)p_byte; - dbg("io base = %8.8x\n",io_node->base); + io_node->base = *(u32 *)p_byte; + dbg("io base = %8.8x\n", io_node->base); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(io_node); return 2; } - io_node->length = *(u32*)p_byte; - dbg("io length = %8.8x\n",io_node->length); + io_node->length = *(u32 *)p_byte; + dbg("io length = %8.8x\n", io_node->length); p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(io_node); return 2; } @@ -610,18 +610,18 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) if (!bus_node) break; - bus_node->base = *(u32*)p_byte; + bus_node->base = *(u32 *)p_byte; p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(bus_node); return 2; } - bus_node->length = *(u32*)p_byte; + bus_node->length = *(u32 *)p_byte; p_byte += 4; - if (p_byte > ((u8*)p_EV_header + evbuffer_length)) { + if (p_byte > ((u8 *)p_EV_header + evbuffer_length)) { kfree(bus_node); return 2; } @@ -650,7 +650,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) } -int compaq_nvram_store (void __iomem *rom_start) +int compaq_nvram_store(void __iomem *rom_start) { int rc = 1; |