Skip to contentSkip to conversation

tools: binman: ti_board_cfg: Fix pylint error over 'br'

PATCH In review Tom Rini 2 participants 3 messages Feb 12, 2025 – Feb 21, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 tools: binman: ti_board_cfg: Fix pylint error over 'br'

With a newer pylint, we get a warning that 'br' could be used before assignment. Fix this by declaring br first as an empty bytearray.

---
Cc: Neha Malcom Francis <[email protected]>
Cc: Simon Glass <[email protected]>

---
 tools/binman/etype/ti_board_config.py | 1 +
 1 file changed, 1 insertion(+)
tools/binman/etype/ti_board_config.py +1 -0
index c10d66edcb15..cc7075eeebec 100644
@@ -119,6 +119,7 @@ class Entry_ti_board_config(Entry_section):
             array of bytes representing value
         """
         size = 0
+        br = bytearray()
         if (data_type == '#/definitions/u8'):
             size = 1
         elif (data_type == '#/definitions/u16'):
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Tom,

Quoted 16 lines · Tom Rini

With a newer pylint, we get a warning that 'br' could be used before assignment. Fix this by declaring br first as an empty bytearray.

---
Cc: Neha Malcom Francis <[email protected]>
Cc: Simon Glass <[email protected]>

---
 tools/binman/etype/ti_board_config.py | 1 +
 1 file changed, 1 insertion(+)
tools/binman/etype/ti_board_config.py +0 -0
index c10d66edcb15..cc7075eeebec 100644

tools/binman/etype/ti_board_config.py class Entry_ti_board_config(Entry_section): · line 125

Quoted 7 lines
tools/binman/etype/ti_board_config.py +1 -0
@@ -119,6 +119,7 @@ class Entry_ti_board_config(Entry_section):
             array of bytes representing value
         """
         size = 0
+        br = bytearray()
         if (data_type == '#/definitions/u8'):
             size = 1
         elif (data_type == '#/definitions/u16'):
Signature · 2 lines
Thanking You
Neha Malcom Francis
author
#2 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini

With a newer pylint, we get a warning that 'br' could be used before assignment. Fix this by declaring br first as an empty bytearray.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom