RM-autogen.py: Do not assign multiple ranges to resources
authorNikhil Devshatwar <nikhil.nd@ti.com>
Thu, 7 May 2020 10:55:09 +0000 (16:25 +0530)
committerNikhil Devshatwar <nikhil.nd@ti.com>
Thu, 7 May 2020 10:55:14 +0000 (16:25 +0530)
Do not assign multiple ranges of resources for a host.
Only generate first entry and ignore others.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
respart/RM-autogen.py

index cc09b7a35c61eb9dc9646b761f679aef1b05b2ee..feca3bb390a953632be7c8e41e4e70ec0d7a83f7 100755 (executable)
@@ -57,12 +57,12 @@ def gen_rmcfg_data(sharing):
 
                        key = (restype, subtype, host_id)
                        value = (start, num)
-                       if (key not in resasg):
-                               resasg[key] = [value]
-                       else:
+                       if (key in resasg):
                                print ("WARNING: Ignoring multiple entries for (%s,%s,%s)" % key)
                                #resasg[key].append(value)
-                       rmcfg.append((start, num, restype, subtype, host_id))
+                       else:
+                               resasg[key] = [value]
+                               rmcfg.append((start, num, restype, subtype, host_id))
 
                        for pair in sharing:
                                if (host_id != pair[0]):