x86: gen_idt.py: Use enumerate() to fix pylint warning
Use enumerate() to fix this pylint warning: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate) enumerate() is handy when the loop body needs both the element and its index. It returns (index, element) tuples. Also use a tuple unpacking to extract 'handler' from the elements in 'vector'. Piggyback a slightly simpler way to build a list of num_chars 0s. Getting rid of warnings for a CI check. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
4e90dd67a9
commit
72e71d6000
1 changed files with 2 additions and 3 deletions
|
@ -274,9 +274,8 @@ def create_irq_vectors_allocated(vectors, spur_code, spur_nocode, filename):
|
|||
# interrupt handlers installed, they are free for runtime installation
|
||||
# of interrupts
|
||||
num_chars = (len(vectors) + 7) // 8
|
||||
vbits = [0 for i in range(num_chars)]
|
||||
for i in range(len(vectors)):
|
||||
handler, _, _ = vectors[i]
|
||||
vbits = num_chars*[0]
|
||||
for i, (handler, _, _) in enumerate(vectors):
|
||||
if handler not in (spur_code, spur_nocode):
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue