Kernel/NVMe: Fix calculation of "Maximum Queue Entries Supported" field
The value of this field is incremented by one, as a value of 0 for this field means 1 entry supported. A value of 0xffff for CAP.MQES would incorrectly by truncated to 0x0000, if we don't increase the bit width of the return type.
This commit is contained in:
parent
760b9186a5
commit
6daa0da3c6
Notes:
sideshowbarker
2024-07-17 02:57:43 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/6daa0da3c6 Pull-request: https://github.com/SerenityOS/serenity/pull/23456
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ static constexpr u8 CAP_DBL_SHIFT = 32;
|
|||
static constexpr u8 CAP_DBL_MASK = 0xf;
|
||||
static constexpr u8 CAP_TO_SHIFT = 24;
|
||||
static constexpr u64 CAP_TO_MASK = 0xff << CAP_TO_SHIFT;
|
||||
static constexpr u16 MQES(u64 cap)
|
||||
static constexpr u32 MQES(u64 cap)
|
||||
{
|
||||
return (cap & 0xffff) + 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue