Commit graph

4 commits

Author SHA1 Message Date
David Tolnay
5bbbf61082 lint: Resolve the easier clippy lints
Hopefully the changes are self-explanatory and uncontroversial. This
eliminates much of the noise from `cargo clippy` and, for my purposes,
gives me a reasonable way to use it as a tool when writing and reviewing
code.

Here is the Clippy invocation I was using:

    cargo +nightly clippy -- -W clippy::correctness -A renamed_and_removed_lints -Aclippy::{blacklisted_name,borrowed_box,cast_lossless,cast_ptr_alignment,enum_variant_names,identity_op,if_same_then_else,mut_from_ref,needless_pass_by_value,new_without_default,new_without_default_derive,or_fun_call,ptr_arg,should_implement_trait,single_match,too_many_arguments,trivially_copy_pass_by_ref,unreadable_literal,unsafe_vector_initialization,useless_transmute}

TEST=cargo check --features wl-dmabuf,gpu,usb-emulation
TEST=boot linux

Change-Id: I55eb1b4a72beb2f762480e3333a921909314a0a2
Reviewed-on: https://chromium-review.googlesource.com/1356911
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-12-03 20:32:03 -08:00
Jingkui Wang
81066162c2 usb_util: Add descriptors
add config descriptors, endpoint descriptors, interface descriptors.

BUG=chromium:831850
TEST=cargo test
CQ-DEPEND=CL:1135783

Change-Id: If74c407f198725bdc6a3096b03d6fe02dcd29ec8
Reviewed-on: https://chromium-review.googlesource.com/1299716
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>
2018-12-01 01:08:36 -08:00
Jingkui Wang
457ebc9d93 usb_util: Add pollfd change handler.
Allow user to hander pollfd change events.

BUG=chromium:831850
TEST=local build
CQ-DEPEND=CL:1124870

Change-Id: I013104e7dfae8f9ae94803f99f435039cd53925c
Reviewed-on: https://chromium-review.googlesource.com/1135783
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>
2018-12-01 01:08:35 -08:00
Jingkui Wang
33e08312f2 usb_util: Create libusb wrapper
This wrapper will be part of usb emulation backend.

BUG=chromium:831850
TEST=local build

Change-Id: I084b15201941e4c16c4e3ff9b967e55db09db567
Reviewed-on: https://chromium-review.googlesource.com/1124870
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>
2018-12-01 01:08:35 -08:00