[PATCH 04/10] backports: replace struct pci_driver sriov_configure changes with smpl patch

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

 



There's still some manual patching done because igb_pci_disable_sriov()
will not be used on kernel older than 3.8, which would generate a
compile warning.

Signed-off-by: Stefan Assmann <sassmann@xxxxxxxxx>
---
 .../0032-sriov_configure/igb_sriov_configure.patch | 40 ++--------------------
 .../0032-sriov_configure/sriov_configure.cocci     | 19 ++++++++++
 2 files changed, 21 insertions(+), 38 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci

diff --git a/patches/collateral-evolutions/network/0032-sriov_configure/igb_sriov_configure.patch b/patches/collateral-evolutions/network/0032-sriov_configure/igb_sriov_configure.patch
index cd2b268..c6bcbd2 100644
--- a/patches/collateral-evolutions/network/0032-sriov_configure/igb_sriov_configure.patch
+++ b/patches/collateral-evolutions/network/0032-sriov_configure/igb_sriov_configure.patch
@@ -1,26 +1,6 @@
 --- a/drivers/net/ethernet/intel/igb/igb_main.c
 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
-@@ -196,7 +196,9 @@ static const struct dev_pm_ops igb_pm_op
- };
- #endif
- static void igb_shutdown(struct pci_dev *);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- #ifdef CONFIG_IGB_DCA
- static int igb_notify_dca(struct notifier_block *, unsigned long, void *);
- static struct notifier_block dca_notifier = {
-@@ -237,7 +239,9 @@ static struct pci_driver igb_driver = {
- 	.driver.pm = &igb_pm_ops,
- #endif
- 	.shutdown = igb_shutdown,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- 	.sriov_configure = igb_pci_sriov_configure,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- 	.err_handler = &igb_err_handler
- };
- 
-@@ -7567,6 +7571,7 @@ static int igb_sriov_reinit(struct pci_d
+@@ -7572,6 +7572,7 @@ static int igb_sriov_reinit(struct pci_dev *dev)
  	return 0;
  }
  
@@ -28,7 +8,7 @@
  static int igb_pci_disable_sriov(struct pci_dev *dev)
  {
  	int err = igb_disable_sriov(dev);
-@@ -7576,6 +7581,7 @@ static int igb_pci_disable_sriov(struct
+@@ -7581,6 +7582,7 @@ static int igb_pci_disable_sriov(struct pci_dev *dev)
  
  	return err;
  }
@@ -36,19 +16,3 @@
  
  static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs)
  {
-@@ -7593,6 +7599,7 @@ out:
- }
- 
- #endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs)
- {
- #ifdef CONFIG_PCI_IOV
-@@ -7603,6 +7610,7 @@ static int igb_pci_sriov_configure(struc
- #endif
- 	return 0;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- 
- #ifdef CONFIG_NET_POLL_CONTROLLER
- /* Polling 'interrupt' - used by things like netconsole to send skbs
diff --git a/patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci b/patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci
new file mode 100644
index 0000000..52920b8
--- /dev/null
+++ b/patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci
@@ -0,0 +1,19 @@
+@r1@
+identifier s, func;
+@@
+
+struct pci_driver s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+.sriov_configure = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux