diff options
author | Manas <manas18244@iiitd.ac.in> | 2024-11-18 15:36:58 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-18 17:10:33 +0100 |
commit | a3f143c461444c0b56360bbf468615fa814a8372 (patch) | |
tree | 32af9a647f99fb5770d621d081309c04abd34ed9 /rust | |
parent | Merge tag 'md-6.13-20241115' of https://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-a3f143c461444c0b56360bbf468615fa814a8372.tar.xz linux-a3f143c461444c0b56360bbf468615fa814a8372.zip |
rust: block: simplify Result<()> in validate_block_size return
`Result` is used in place of `Result<()>` because the default type
parameters are unit `()` and `Error` types, which are automatically
inferred. Thus keep the usage consistent throughout codebase.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1128
Signed-off-by: Manas <manas18244@iiitd.ac.in>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/r/20241118-simplify-result-v3-1-6b1566a77eab@iiitd.ac.in
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust')
-rw-r--r-- | rust/kernel/block/mq/gen_disk.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs index 708125dce96a..798c4ae0bded 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -45,7 +45,7 @@ impl GenDiskBuilder { /// Validate block size by verifying that it is between 512 and `PAGE_SIZE`, /// and that it is a power of two. - fn validate_block_size(size: u32) -> Result<()> { + fn validate_block_size(size: u32) -> Result { if !(512..=bindings::PAGE_SIZE as u32).contains(&size) || !size.is_power_of_two() { Err(error::code::EINVAL) } else { |