[v2,2/6] dpdk-devbind: fix indentation
diff mbox series

Message ID 20201104070350.28224-3-stephen@networkplumber.org
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • dpdk-devbind: python lint cleanups
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Stephen Hemminger Nov. 4, 2020, 7:03 a.m. UTC
Python lint complains about identation and missing spaces around
commas in this script.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 usertools/dpdk-devbind.py | 53 ++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

Patch
diff mbox series

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index e0b74c5a3e41..3a27641d0e08 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -14,15 +14,15 @@ 
 
 # The PCI base class for all devices
 network_class = {'Class': '02', 'Vendor': None, 'Device': None,
-                    'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 acceleration_class = {'Class': '12', 'Vendor': None, 'Device': None,
                       'SVendor': None, 'SDevice': None}
 ifpga_class = {'Class': '12', 'Vendor': '8086', 'Device': '0b30',
-                    'SVendor': None, 'SDevice': None}
+               'SVendor': None, 'SDevice': None}
 encryption_class = {'Class': '10', 'Vendor': None, 'Device': None,
-                   'SVendor': None, 'SDevice': None}
+                    'SVendor': None, 'SDevice': None}
 intel_processor_class = {'Class': '0b', 'Vendor': '8086', 'Device': None,
-                   'SVendor': None, 'SDevice': None}
+                         'SVendor': None, 'SDevice': None}
 cavium_sso = {'Class': '08', 'Vendor': '177d', 'Device': 'a04b,a04d',
               'SVendor': None, 'SDevice': None}
 cavium_fpa = {'Class': '08', 'Vendor': '177d', 'Device': 'a053',
@@ -34,29 +34,30 @@ 
 cavium_zip = {'Class': '12', 'Vendor': '177d', 'Device': 'a037',
               'SVendor': None, 'SDevice': None}
 avp_vnic = {'Class': '05', 'Vendor': '1af4', 'Device': '1110',
-              'SVendor': None, 'SDevice': None}
+            'SVendor': None, 'SDevice': None}
 
 octeontx2_sso = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f9,a0fa',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 octeontx2_npa = {'Class': '08', 'Vendor': '177d', 'Device': 'a0fb,a0fc',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 octeontx2_dma = {'Class': '08', 'Vendor': '177d', 'Device': 'a081',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 
-intel_ioat_bdw = {'Class': '08', 'Vendor': '8086', 'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
-              'SVendor': None, 'SDevice': None}
+intel_ioat_bdw = {'Class': '08', 'Vendor': '8086',
+                  'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
+                  'SVendor': None, 'SDevice': None}
 intel_ioat_skx = {'Class': '08', 'Vendor': '8086', 'Device': '2021',
-              'SVendor': None, 'SDevice': None}
+                  'SVendor': None, 'SDevice': None}
 intel_ioat_icx = {'Class': '08', 'Vendor': '8086', 'Device': '0b00',
-              'SVendor': None, 'SDevice': None}
+                  'SVendor': None, 'SDevice': None}
 intel_idxd_spr = {'Class': '08', 'Vendor': '8086', 'Device': '0b25',
-              'SVendor': None, 'SDevice': None}
+                  'SVendor': None, 'SDevice': None}
 intel_ntb_skx = {'Class': '06', 'Vendor': '8086', 'Device': '201c',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 intel_ntb_icx = {'Class': '06', 'Vendor': '8086', 'Device': '347e',
-              'SVendor': None, 'SDevice': None}
+                 'SVendor': None, 'SDevice': None}
 
 network_devices = [network_class, cavium_pkx, avp_vnic, ifpga_class]
 baseband_devices = [acceleration_class]
@@ -206,7 +207,7 @@  def get_device_details(devices_type):
         route = subprocess.check_output(["ip", "-o", "route"])
         # filter out all lines for 169.254 routes
         route = "\n".join(filter(lambda ln: not ln.startswith("169.254"),
-                             route.decode().splitlines()))
+                                 route.decode().splitlines()))
         rt_info = route.split()
         for i in range(len(rt_info) - 1):
             if rt_info[i] == "dev":
@@ -366,8 +367,8 @@  def bind_one(dev_id, driver, force):
                 return
             try:
                 # Convert Device and Vendor Id to int to write to new_id
-                f.write("%04x %04x" % (int(dev["Vendor"],16),
-                        int(dev["Device"], 16)))
+                f.write("%04x %04x" % (int(dev["Vendor"], 16),
+                                       int(dev["Device"], 16)))
                 f.close()
             except:
                 print("Error: bind failed for %s - Cannot write new PCI ID to "
@@ -409,13 +410,13 @@  def bind_one(dev_id, driver, force):
             f = open(filename, "w")
         except:
             sys.exit("Error: unbind failed for %s - Cannot open %s"
-                  % (dev_id, filename))
+                     % (dev_id, filename))
         try:
             f.write("\00")
             f.close()
         except:
             sys.exit("Error: unbind failed for %s - Cannot open %s"
-                  % (dev_id, filename))
+                     % (dev_id, filename))
 
 
 def unbind_all(dev_list, force=False):
@@ -456,7 +457,7 @@  def bind_all(dev_list, driver, force=False):
         pass
 
     # check if we're attempting to bind to a driver that isn't loaded
-    if not module_is_loaded(driver.replace('-','_')):
+    if not module_is_loaded(driver.replace('-', '_')):
         sys.exit("Error: Driver '%s' is not loaded." % driver)
 
     try:
@@ -501,9 +502,9 @@  def display_devices(title, dev_list, extra_params=None):
         for dev in dev_list:
             if extra_params is not None:
                 strings.append("%s '%s %s' %s" % (dev["Slot"],
-                                               dev["Device_str"],
-                                               dev["Device"],
-                                               extra_params % dev))
+                                                  dev["Device_str"],
+                                                  dev["Device"],
+                                                  extra_params % dev))
             else:
                 strings.append("%s '%s'" % (dev["Slot"], dev["Device_str"]))
     # sort before printing, so that the entries appear in PCI order
@@ -573,7 +574,7 @@  def show_status():
         show_device_status(mempool_devices, "Mempool")
 
     if status_dev == "compress" or status_dev == "all":
-        show_device_status(compress_devices , "Compress")
+        show_device_status(compress_devices, "Compress")
 
     if status_dev == "misc" or status_dev == "all":
         show_device_status(misc_devices, "Misc (rawdev)")