提交 f6f60707 编写于 作者: C ChanWoo Lee 提交者: Ulf Hansson

mmc: queue: Match the data type of max_segments

Each function has a different data type for max_segments,
Modify to match unsigned short(host->max_segs).
* unsigned short          max_segs;       /* see blk_queue_max_segments */

1) Return type : unsigned int
static unsigned int mmc_get_max_segments(struct mmc_host *host)
{
       return host->can_dma_map_merge ? MMC_DMA_MAP_MERGE_SEGMENTS :
                                         host->max_segs;
}

2) Parameter type : int
 mmc_alloc_sg(mmc_get_max_segments(host), gfp);
   -> static struct scatterlist *mmc_alloc_sg(int sg_len, gfp_t gfp)

3) Parameter type : unsigned short
 blk_queue_max_segments(mq->queue, mmc_get_max_segments(host));
   -> void blk_queue_max_segments(struct request_queue *q,
                                        unsigned short max_segments)
Signed-off-by: NChanWoo Lee <cw9316.lee@samsung.com>
Acked-by: NColy Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20210824073934.19727-1-cw9316.lee@samsung.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 b048457c
...@@ -163,7 +163,7 @@ static void mmc_mq_recovery_handler(struct work_struct *work) ...@@ -163,7 +163,7 @@ static void mmc_mq_recovery_handler(struct work_struct *work)
blk_mq_run_hw_queues(q, true); blk_mq_run_hw_queues(q, true);
} }
static struct scatterlist *mmc_alloc_sg(int sg_len, gfp_t gfp) static struct scatterlist *mmc_alloc_sg(unsigned short sg_len, gfp_t gfp)
{ {
struct scatterlist *sg; struct scatterlist *sg;
...@@ -193,7 +193,7 @@ static void mmc_queue_setup_discard(struct request_queue *q, ...@@ -193,7 +193,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
blk_queue_flag_set(QUEUE_FLAG_SECERASE, q); blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
} }
static unsigned int mmc_get_max_segments(struct mmc_host *host) static unsigned short mmc_get_max_segments(struct mmc_host *host)
{ {
return host->can_dma_map_merge ? MMC_DMA_MAP_MERGE_SEGMENTS : return host->can_dma_map_merge ? MMC_DMA_MAP_MERGE_SEGMENTS :
host->max_segs; host->max_segs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册