Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • error.rs
Find file BlameHistoryPermalink
  • Miguel Ojeda's avatar
    rust: error: allow `useless_conversion` for 32-bit builds · 7bc18673
    Miguel Ojeda authored Jul 30, 2024
    For the new Rust support for 32-bit arm [1], Clippy warns:
    
        error: useless conversion to the same type: `i32`
           --> rust/kernel/error.rs:139:36
            |
        139 |         unsafe { bindings::ERR_PTR(self.0.into()) as *mut _ }
            |                                    ^^^^^^^^^^^^^ help: consider removing `.into()`: `self.0`
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
            = note: `-D clippy::useless-conversion` implied by `-D warnings`
            = help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]`
    
    The `self.0.into()` converts an `c_int` into `ERR_PTR`'s parameter
    which is a `c_long`. Thus, both types are `i32` in 32-bit. Therefore,
    allow it for those architectures.
    
    Link: https://lore.kernel.org/rust-for-linux/2dbd1491-149d-443c-9802-75786a6a3b73@gmail.com/
    
     [1]
    Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Reviewed-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
    Link: https://lore.kernel.org/r/20240730155702.1110144-1-ojeda@kernel.org
    
    
    [ Fixed typo in tag. - Miguel ]
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    7bc18673
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7