Skip to content

Commit

Permalink
mmc: queue: Remove unused parameters(request_queue)
Browse files Browse the repository at this point in the history
In function mmc_exit_request, the request_queue structure(*q) is not used.
I remove the unnecessary code related to the request_queue structure.

Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20210825074601.8881-1-cw9316.lee@samsung.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
ChanWoo Lee authored and Ulf Hansson committed Aug 25, 2021
1 parent dba914b commit f80c8e6
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions drivers/mmc/core/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,48 +199,30 @@ static unsigned short mmc_get_max_segments(struct mmc_host *host)
host->max_segs;
}

/**
* mmc_init_request() - initialize the MMC-specific per-request data
* @mq: the request queue
* @req: the request
* @gfp: memory allocation policy
*/
static int __mmc_init_request(struct mmc_queue *mq, struct request *req,
gfp_t gfp)
static int mmc_mq_init_request(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx, unsigned int numa_node)
{
struct mmc_queue_req *mq_rq = req_to_mmc_queue_req(req);
struct mmc_queue *mq = set->driver_data;
struct mmc_card *card = mq->card;
struct mmc_host *host = card->host;

mq_rq->sg = mmc_alloc_sg(mmc_get_max_segments(host), gfp);
mq_rq->sg = mmc_alloc_sg(mmc_get_max_segments(host), GFP_KERNEL);
if (!mq_rq->sg)
return -ENOMEM;

return 0;
}

static void mmc_exit_request(struct request_queue *q, struct request *req)
static void mmc_mq_exit_request(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx)
{
struct mmc_queue_req *mq_rq = req_to_mmc_queue_req(req);

kfree(mq_rq->sg);
mq_rq->sg = NULL;
}

static int mmc_mq_init_request(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx, unsigned int numa_node)
{
return __mmc_init_request(set->driver_data, req, GFP_KERNEL);
}

static void mmc_mq_exit_request(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx)
{
struct mmc_queue *mq = set->driver_data;

mmc_exit_request(mq->queue, req);
}

static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
Expand Down

0 comments on commit f80c8e6

Please sign in to comment.