Skip to content

Remove unreachable code and cleanup code with fixed return

Andrew Goodbody u-boot 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20250714-blk-uclass-34684c01f60c

Versions newest first

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 2 repliesSuperseded
  3. v11 patch 5 repliesSuperseded

Changes in v3 from the cover letter

- Address review comments to make more readable and prevent for loop testing of a variable that will not change
- Remove those for loops that reduce to being empty
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2block: Remove unreachable codedrivers/block/blk-uclass.c+4 -100 replies
2/2uclass: Cleanup uclass_find_next_deviceboard/emulation/qemu-ppce500/qemu-ppce500.c boot/bootdev-uclass.c cmd/regulator.c +5 more+90 -1230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] Remove unreachable code and cleanup code with fixed return

Smatch reported unreachable code in blk-uclass.c which led to noticing that uclass_find_next_device always returned 0 which meant it had no need of any return value.

---
Changes in v3:
- Address review comments to make more readable and prevent for loop testing of a variable that will not change
- Remove those for loops that reduce to being empty
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- make uclass_find_next_device a void and update callers
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Andrew Goodbody (2):
block: Remove unreachable code
uclass: Cleanup uclass_find_next_device

 board/emulation/qemu-ppce500/qemu-ppce500.c |   4 +-
 boot/bootdev-uclass.c                       |   8 +-
 cmd/regulator.c                             |   8 +-
 drivers/block/blk-uclass.c                  |  14 +--
 drivers/core/uclass.c                       |  16 +---
 drivers/power/regulator/regulator-uclass.c  |  21 ++--
 drivers/remoteproc/rproc-uclass.c           |   9 +-
 include/dm/uclass-internal.h                |   4 +-
 test/dm/core.c                              | 143 +++++++++++-----------------
 9 files changed, 94 insertions(+), 133 deletions(-)

---
base-commit: cd79a2839b01571b6f2915c219f71c05e3c97482
change-id: 20250714-blk-uclass-34684c01f60c

Best regards,

Signature · 1 line
Andrew Goodbody <[email protected]>