Skip to content

Commit

Permalink
nvmet: use u32 type for the local variable nsid
Browse files Browse the repository at this point in the history
In function nvmet_max_nsid() we calculate the max nsid by iterating
over the XArray and store it in the variable nsid that has type of
unsigned long.

Since the value of this function is stored into the subsys->max_nsid
which is of type u32, change the local variable nsid type and the return
type of the same function to u32.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Chaitanya Kulkarni authored and Christoph Hellwig committed Jun 17, 2021
1 parent 86693c4 commit 245067e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvme/target/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ u16 nvmet_zero_sgl(struct nvmet_req *req, off_t off, size_t len)
return 0;
}

static unsigned int nvmet_max_nsid(struct nvmet_subsys *subsys)
static u32 nvmet_max_nsid(struct nvmet_subsys *subsys)
{
unsigned long nsid = 0;
struct nvmet_ns *cur;
unsigned long idx;
u32 nsid = 0;

xa_for_each(&subsys->namespaces, idx, cur)
nsid = cur->nsid;
Expand Down

0 comments on commit 245067e

Please sign in to comment.