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
  • Wedson Almeida Filho's avatar
    rust: error: Add to_result() helper · 086fbfa3
    Wedson Almeida Filho authored Apr 03, 2023
    
    
    Add a to_result() helper to convert kernel C return values to a Rust
    Result, mapping >=0 values to Ok(()) and negative values to Err(...),
    with Error::from_errno() ensuring that the errno is within range.
    
    Lina: Imported from rust-for-linux/rust, originally developed by Wedson
    as part of the AMBA device driver support.
    
    Signed-off-by: default avatarWedson Almeida Filho <wedsonaf@gmail.com>
    Reviewed-by: default avatarAndreas Hindborg <a.hindborg@samsung.com>
    Reviewed-by: default avatarGary Guo <gary@garyguo.net>
    Reviewed-by: default avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
    Signed-off-by: default avatarAsahi Lina <lina@asahilina.net>
    Link: https://lore.kernel.org/r/20230224-rust-error-v3-4-03779bddc02b@asahilina.net
    
    
    [ Add a removal of `#[allow(dead_code)]`. ]
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    086fbfa3
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7