aboutsummaryrefslogtreecommitdiff
path: root/drivers/nfc/trf7970a.c
diff options
context:
space:
mode:
authorChaitanya Kulkarni2021-02-09 21:47:54 -0800
committerChristoph Hellwig2021-02-10 16:38:04 +0100
commit3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238 (patch)
tree8b4d1853763883c9ed5ab66eb049439c1d485d2c /drivers/nfc/trf7970a.c
parentaa0aff604a60627b9f6c51c99dd5f63634322668 (diff)
nvmet: make nvmet_find_namespace() req based
The six callers of nvmet_find_namespace() duplicate the error log page update and status setting code for each call on failure. All callers are nvmet requests based functions, so we can pass req to the nvmet_find_namesapce() & derive ctrl from req, that'll allow us to update the error log page in nvmet_find_namespace(). Now that we pass the request we can also get rid of the local variable in nvmet_find_namespace() and use the req->ns and return the error code. Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(), centralize the error log page update for non allocated namesapces, and return uniform error for non-allocated namespace. The nvmet_find_namespace() takes nsid parameter which is from NVMe commands structures such as get_log_page, identify, rw and common. All these commands have same offset for the nsid field. Derive nsid from req->cmd->common.nsid) & remove the extra parameter from the nvmet_find_namespace(). Lastly now we associate the ns to the req parameter that we pass to the nvmet_find_namespace(), rename nvmet_find_namespace() to nvmet_req_find_ns(). Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nfc/trf7970a.c')
0 files changed, 0 insertions, 0 deletions