lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250626111045.2c90a402@nimda>
Date: Thu, 26 Jun 2025 11:10:45 +0300
From: Onur <work@...rozkan.dev>
To: Danilo Krummrich <dakr@...nel.org>
Cc: rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
 gregkh@...uxfoundation.org, rafael@...nel.org, ojeda@...nel.org,
 alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
 bjorn3_gh@...tonmail.com, lossin@...nel.org, a.hindborg@...nel.org,
 aliceryhl@...gle.com, tmgross@...ch.edu
Subject: Re: [PATCH] rust: simplify `Adapter::id_info`

On Wed, 25 Jun 2025 10:39:47 +0200
Danilo Krummrich <dakr@...nel.org> wrote:

> On Wed, Jun 25, 2025 at 11:36:04AM +0300, Onur wrote:
> > Even with that, it can be something like this:
> > 
> > fn id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> {
> >     let id = Self::acpi_id_info(dev);
> >     if id.is_some() {
> >         return id;
> >     }
> > 
> >     Self::of_id_info(dev)
> > }
> > 
> > or maybe even this:
> > 
> > fn id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> {
> >     Self::acpi_id_info(dev).or_else(|| Self::of_id_info(dev))
> > }
> 
> That's fair, can you please rebase your patch onto [1]?
> 
> [1]
> https://lore.kernel.org/lkml/20250620153914.295679-1-igor.korotin.linux@gmail.com/

HEAD: e0b49ca268d4a0d2b97d5820420d5a78b67d2537 currently doesn't pass
clippy. Should I send an additional change for the clippy fix or would
you prefer to fix it yourself first?

Here is the output of `make LLVM=1 -j $(nproc) CLIPPY=1`:

```
  DESCEND objtool
  CALL    scripts/checksyscalls.sh
  INSTALL libsubcmd_headers
  CLIPPY L rust/kernel.o
error: unneeded `return` statement
   --> rust/kernel/driver.rs:188:13
    |
188 |             return None;
    |             ^^^^^^^^^^^
    |
    = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings` = help:
to override `-D warnings` add `#[allow(clippy::needless_return)]` help:
remove `return` |
188 -             return None;
188 +             None
    |

error: aborting due to 1 previous error

make[2]: *** [rust/Makefile:538: rust/kernel.o] Error 1
make[1]: *** [/home/nimda/devspace/onur-ozkan/linux/Makefile:1280:
prepare] Error 2 make: *** [Makefile:248: __sub-make] Error 2
```

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ