Skip to content

bindings: rust: clippy: fix warnings

Erik Schilling linux-gpio 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20230629-clippy-890c541c6d09

Versions newest first

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Changed cover letter title to active language
- Improved commit messages (hopefully)
- Elaborated what was built and tested
- Resent with hacked b4 for proper [libgpiod] tag
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bindings: rust: clippy: drop unnecessary castsbindings/rust/gpiosim-sys/src/lib.rs bindings/rust/gpiosim-sys/src/sim.rs bindings/rust/libgpiod/src/chip.rs +9 more+16 -160 replies
2/4bindings: rust: clippy: silence false-positives on castsbindings/rust/libgpiod/src/line_info.rs bindings/rust/libgpiod/src/line_settings.rs+6 -00 replies
3/4bindings: rust: clippy: drop unneeded conversionsbindings/rust/gpiosim-sys/src/sim.rs bindings/rust/libgpiod/src/event_buffer.rs+2 -20 replies
4/4bindings: rust: clippy: silence false-positive on iteratorbindings/rust/libgpiod/src/event_buffer.rs+3 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKent Gibson
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [libgpiod][PATCH v2 0/4] bindings: rust: clippy: fix warnings

This follows up on my promise on Kent's series [1] to look into whether these casts are needed or not. Most are not, a few are false-positives.

I also explored some shunit2 based test-script to automate the testing, but that became ugly with linking issue and needs me to revisit it another time. So this only sends the clippy fixes for now.

Tested the build (lib + examples + test) and clippy report on:
- Fedora 38 x86_64
- Fedora 38 aarch64
- Debian 12 armv7hf

Test execution (cargo test) was tested on:
- Fedora 38 x86_64
- Fedora 38 aarch64

Could not execute tests on armv7hf due to lack of suitable test environment.

[1] https://lore.kernel.org/r/[email protected]

To: Linux-GPIO <[email protected]>
Cc: Kent Gibson <[email protected]>
Cc: Viresh Kumar <[email protected]>

---
Changes in v2:
- Changed cover letter title to active language
- Improved commit messages (hopefully)
- Elaborated what was built and tested
- Resent with hacked b4 for proper [libgpiod] tag
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Erik Schilling (4):
bindings: rust: clippy: drop unnecessary casts
bindings: rust: clippy: silence false-positives on casts
bindings: rust: clippy: drop unneeded conversions
bindings: rust: clippy: silence false-positive on iterator

 bindings/rust/gpiosim-sys/src/lib.rs         | 2 +-
 bindings/rust/gpiosim-sys/src/sim.rs         | 4 ++--
 bindings/rust/libgpiod/src/chip.rs           | 2 +-
 bindings/rust/libgpiod/src/edge_event.rs     | 2 +-
 bindings/rust/libgpiod/src/event_buffer.rs   | 7 +++++--
 bindings/rust/libgpiod/src/info_event.rs     | 2 +-
 bindings/rust/libgpiod/src/lib.rs            | 2 +-
 bindings/rust/libgpiod/src/line_config.rs    | 4 ++--
 bindings/rust/libgpiod/src/line_info.rs      | 3 +++
 bindings/rust/libgpiod/src/line_request.rs   | 8 ++++----
 bindings/rust/libgpiod/src/line_settings.rs  | 5 ++++-
 bindings/rust/libgpiod/src/request_config.rs | 2 +-
 bindings/rust/libgpiod/tests/chip.rs         | 2 +-
 13 files changed, 27 insertions(+), 18 deletions(-)

---
base-commit: 4510231c95a087f58a155cf74164e403e1e0584f
change-id: 20230629-clippy-890c541c6d09

Best regards,

Signature · 1 line
Erik Schilling <[email protected]>