mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
net: use napi_id_valid helper
In commit 6597e8d358 ("netdev-genl: Elide napi_id when not present"),
napi_id_valid function was added. Use the helper to refactor open-coded
checks in the source.
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Stefano Jordhani <sjordhani@gmail.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk> # for iouring
Link: https://patch.msgid.link/20250214181801.931-1-sjordhani@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
b706d9f068
commit
b9d752105e
@@ -44,7 +44,7 @@ int __io_napi_add_id(struct io_ring_ctx *ctx, unsigned int napi_id)
|
||||
struct io_napi_entry *e;
|
||||
|
||||
/* Non-NAPI IDs can be rejected. */
|
||||
if (napi_id < MIN_NAPI_ID)
|
||||
if (!napi_id_valid(napi_id))
|
||||
return -EINVAL;
|
||||
|
||||
hash_list = &ctx->napi_ht[hash_min(napi_id, HASH_BITS(ctx->napi_ht))];
|
||||
@@ -87,7 +87,7 @@ static int __io_napi_del_id(struct io_ring_ctx *ctx, unsigned int napi_id)
|
||||
struct io_napi_entry *e;
|
||||
|
||||
/* Non-NAPI IDs can be rejected. */
|
||||
if (napi_id < MIN_NAPI_ID)
|
||||
if (!napi_id_valid(napi_id))
|
||||
return -EINVAL;
|
||||
|
||||
hash_list = &ctx->napi_ht[hash_min(napi_id, HASH_BITS(ctx->napi_ht))];
|
||||
|
||||
Reference in New Issue
Block a user