nvme: Use size_t for payload size
Using uint32_t here can cause spurious compiler warnings. I assume it was done to constrain the range; use a KASSERT instead. Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55279
This commit is contained in:
@@ -502,11 +502,13 @@ _nvme_allocate_request(const int how, nvme_cb_fn_t cb_fn, void *cb_arg)
|
||||
}
|
||||
|
||||
static __inline struct nvme_request *
|
||||
nvme_allocate_request_vaddr(void *payload, uint32_t payload_size,
|
||||
nvme_allocate_request_vaddr(void *payload, size_t payload_size,
|
||||
const int how, nvme_cb_fn_t cb_fn, void *cb_arg)
|
||||
{
|
||||
struct nvme_request *req;
|
||||
|
||||
KASSERT(payload_size <= UINT32_MAX,
|
||||
("payload size %zu exceeds maximum", payload_size));
|
||||
req = _nvme_allocate_request(how, cb_fn, cb_arg);
|
||||
if (req != NULL) {
|
||||
req->payload = memdesc_vaddr(payload, payload_size);
|
||||
|
||||
Reference in New Issue
Block a user