Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pci/misc'

- Remove unnecessary #includes (Gustavo Pimentel)

- Fix intel_mid_pci.c build error when !CONFIG_ACPI (Randy Dunlap)

- Use scnprintf(), not snprintf(), in sysfs "show" functions (Krzysztof
Wilczyński)

- Simplify pci-pf-stub by using module_pci_driver() (Liu Shixin)

- Print IRQ used by Link Bandwidth Notification (Dongdong Liu)

- Update sysfs mmap-related #ifdef comments (Clint Sbisa)

- Simplify pci_dev_reset_slot_function() (Lukas Wunner)

- Use "NULL" instead of "0" to fix sparse warnings (Gustavo Pimentel)

- Simplify bool comparisons (Krzysztof Wilczyński)

- Drop double zeroing for P2PDMA sg_init_table() (Julia Lawall)

* pci/misc:
PCI: v3-semi: Remove unneeded break
PCI/P2PDMA: Drop double zeroing for sg_init_table()
PCI: Simplify bool comparisons
PCI: endpoint: Use "NULL" instead of "0" as a NULL pointer
PCI: Simplify pci_dev_reset_slot_function()
PCI: Update mmap-related #ifdef comments
PCI/LINK: Print IRQ number used by port
PCI/IOV: Simplify pci-pf-stub with module_pci_driver()
PCI: Use scnprintf(), not snprintf(), in sysfs "show" functions
x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled
PCI: Remove unnecessary header includes

+19 -37
+1
arch/x86/pci/intel_mid_pci.c
··· 33 33 #include <asm/hw_irq.h> 34 34 #include <asm/io_apic.h> 35 35 #include <asm/intel-mid.h> 36 + #include <asm/acpi.h> 36 37 37 38 #define PCIE_CAP_OFFSET 0x100 38 39
-1
drivers/pci/controller/pci-v3-semi.c
··· 658 658 default: 659 659 dev_err(v3->dev, "illegal dma memory chunk size\n"); 660 660 return -EINVAL; 661 - break; 662 661 } 663 662 val |= V3_PCI_MAP_M_REG_EN | V3_PCI_MAP_M_ENABLE; 664 663 *pci_map = val;
+5 -5
drivers/pci/p2pdma.c
··· 53 53 if (pdev->p2pdma->pool) 54 54 size = gen_pool_size(pdev->p2pdma->pool); 55 55 56 - return snprintf(buf, PAGE_SIZE, "%zd\n", size); 56 + return scnprintf(buf, PAGE_SIZE, "%zd\n", size); 57 57 } 58 58 static DEVICE_ATTR_RO(size); 59 59 ··· 66 66 if (pdev->p2pdma->pool) 67 67 avail = gen_pool_avail(pdev->p2pdma->pool); 68 68 69 - return snprintf(buf, PAGE_SIZE, "%zd\n", avail); 69 + return scnprintf(buf, PAGE_SIZE, "%zd\n", avail); 70 70 } 71 71 static DEVICE_ATTR_RO(available); 72 72 ··· 75 75 { 76 76 struct pci_dev *pdev = to_pci_dev(dev); 77 77 78 - return snprintf(buf, PAGE_SIZE, "%d\n", 79 - pdev->p2pdma->p2pmem_published); 78 + return scnprintf(buf, PAGE_SIZE, "%d\n", 79 + pdev->p2pdma->p2pmem_published); 80 80 } 81 81 static DEVICE_ATTR_RO(published); 82 82 ··· 761 761 struct scatterlist *sg; 762 762 void *addr; 763 763 764 - sg = kzalloc(sizeof(*sg), GFP_KERNEL); 764 + sg = kmalloc(sizeof(*sg), GFP_KERNEL); 765 765 if (!sg) 766 766 return NULL; 767 767
+1 -13
drivers/pci/pci-pf-stub.c
··· 37 37 .probe = pci_pf_stub_probe, 38 38 .sriov_configure = pci_sriov_configure_simple, 39 39 }; 40 - 41 - static int __init pci_pf_stub_init(void) 42 - { 43 - return pci_register_driver(&pf_stub_driver); 44 - } 45 - 46 - static void __exit pci_pf_stub_exit(void) 47 - { 48 - pci_unregister_driver(&pf_stub_driver); 49 - } 50 - 51 - module_init(pci_pf_stub_init); 52 - module_exit(pci_pf_stub_exit); 40 + module_pci_driver(pf_stub_driver); 53 41 54 42 MODULE_LICENSE("GPL");
+3 -3
drivers/pci/pci-sysfs.c
··· 574 574 ssize_t len; 575 575 576 576 device_lock(dev); 577 - len = snprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override); 577 + len = scnprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override); 578 578 device_unlock(dev); 579 579 return len; 580 580 } ··· 1197 1197 } 1198 1198 return 0; 1199 1199 } 1200 - #else /* !HAVE_PCI_MMAP */ 1200 + #else /* !(defined(HAVE_PCI_MMAP) || defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)) */ 1201 1201 int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; } 1202 1202 void __weak pci_remove_resource_files(struct pci_dev *dev) { return; } 1203 - #endif /* HAVE_PCI_MMAP */ 1203 + #endif 1204 1204 1205 1205 /** 1206 1206 * pci_write_rom - used to enable access to the PCI ROM display
+4 -13
drivers/pci/pci.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/msi.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_pci.h> 19 18 #include <linux/pci.h> 20 19 #include <linux/pm.h> 21 20 #include <linux/slab.h> ··· 29 30 #include <linux/pm_runtime.h> 30 31 #include <linux/pci_hotplug.h> 31 32 #include <linux/vmalloc.h> 32 - #include <linux/pci-ats.h> 33 - #include <asm/setup.h> 34 33 #include <asm/dma.h> 35 34 #include <linux/aer.h> 36 35 #include "pci.h" ··· 4932 4935 4933 4936 static int pci_dev_reset_slot_function(struct pci_dev *dev, int probe) 4934 4937 { 4935 - struct pci_dev *pdev; 4936 - 4937 - if (dev->subordinate || !dev->slot || 4938 + if (dev->multifunction || dev->subordinate || !dev->slot || 4938 4939 dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET) 4939 4940 return -ENOTTY; 4940 - 4941 - list_for_each_entry(pdev, &dev->bus->devices, bus_list) 4942 - if (pdev != dev && pdev->slot == dev->slot) 4943 - return -ENOTTY; 4944 4941 4945 4942 return pci_reset_hotplug_slot(dev->slot->hotplug, probe); 4946 4943 } ··· 6011 6020 6012 6021 if (flags & PCI_VGA_STATE_CHANGE_DECODES) { 6013 6022 pci_read_config_word(dev, PCI_COMMAND, &cmd); 6014 - if (decode == true) 6023 + if (decode) 6015 6024 cmd |= command_bits; 6016 6025 else 6017 6026 cmd &= ~command_bits; ··· 6027 6036 if (bridge) { 6028 6037 pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, 6029 6038 &cmd); 6030 - if (decode == true) 6039 + if (decode) 6031 6040 cmd |= PCI_BRIDGE_CTL_VGA; 6032 6041 else 6033 6042 cmd &= ~PCI_BRIDGE_CTL_VGA; ··· 6356 6365 6357 6366 spin_lock(&resource_alignment_lock); 6358 6367 if (resource_alignment_param) 6359 - count = snprintf(buf, PAGE_SIZE, "%s", resource_alignment_param); 6368 + count = scnprintf(buf, PAGE_SIZE, "%s", resource_alignment_param); 6360 6369 spin_unlock(&resource_alignment_lock); 6361 6370 6362 6371 /*
+3
drivers/pci/pcie/bw_notification.c
··· 14 14 * and warns when links become degraded in operation. 15 15 */ 16 16 17 + #define dev_fmt(fmt) "bw_notification: " fmt 18 + 17 19 #include "../pci.h" 18 20 #include "portdrv.h" 19 21 ··· 99 97 return ret; 100 98 101 99 pcie_enable_link_bandwidth_notification(srv->port); 100 + pci_info(srv->port, "enabled with IRQ %d\n", srv->irq); 102 101 103 102 return 0; 104 103 }
+2 -2
include/linux/pci-ep-cfs.h
··· 19 19 #else 20 20 static inline struct config_group *pci_ep_cfs_add_epc_group(const char *name) 21 21 { 22 - return 0; 22 + return NULL; 23 23 } 24 24 25 25 static inline void pci_ep_cfs_remove_epc_group(struct config_group *group) ··· 28 28 29 29 static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name) 30 30 { 31 - return 0; 31 + return NULL; 32 32 } 33 33 34 34 static inline void pci_ep_cfs_remove_epf_group(struct config_group *group)