* [PATCH] mmc: queue: Match the data type of max_segments
[not found] <CGME20210824074651epcas1p3b6965040fa6a4660a31192f96125c374@epcas1p3.samsung.com>
@ 2021-08-24 7:39 ` Chanwoo Lee
2021-08-24 10:26 ` Coly Li
2021-08-24 14:56 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Chanwoo Lee @ 2021-08-24 7:39 UTC (permalink / raw)
To: ulf.hansson, adrian.hunter, cw9316.lee, colyli, axboe, ebiggers,
pcc, porzio, linux-mmc, linux-kernel
Cc: grant.jung, jt77.jang, dh0421.hwang, sh043.lee
From: ChanWoo Lee <cw9316.lee@samsung.com>
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: ChanWoo Lee <cw9316.lee@samsung.com>
---
drivers/mmc/core/queue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index cc3261777637..48304bcf963c 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -163,7 +163,7 @@ static void mmc_mq_recovery_handler(struct work_struct *work)
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;
@@ -193,7 +193,7 @@ static void mmc_queue_setup_discard(struct request_queue *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 :
host->max_segs;
--
2.29.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: queue: Match the data type of max_segments
2021-08-24 7:39 ` [PATCH] mmc: queue: Match the data type of max_segments Chanwoo Lee
@ 2021-08-24 10:26 ` Coly Li
2021-08-24 14:56 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Coly Li @ 2021-08-24 10:26 UTC (permalink / raw)
To: Chanwoo Lee
Cc: grant.jung, jt77.jang, dh0421.hwang, sh043.lee, adrian.hunter,
axboe, ebiggers, pcc, porzio, ulf.hansson, linux-mmc,
linux-kernel
On 8/24/21 3:39 PM, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee@samsung.com>
>
> 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: ChanWoo Lee <cw9316.lee@samsung.com>
I am not sure whether it is mandatory necessary here, but it is OK for me.
Acked-by: Coly Li <colyli@suse.de>
Thanks.
Coly Li
> ---
> drivers/mmc/core/queue.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index cc3261777637..48304bcf963c 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -163,7 +163,7 @@ static void mmc_mq_recovery_handler(struct work_struct *work)
> 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;
>
> @@ -193,7 +193,7 @@ static void mmc_queue_setup_discard(struct request_queue *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 :
> host->max_segs;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: queue: Match the data type of max_segments
2021-08-24 7:39 ` [PATCH] mmc: queue: Match the data type of max_segments Chanwoo Lee
2021-08-24 10:26 ` Coly Li
@ 2021-08-24 14:56 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2021-08-24 14:56 UTC (permalink / raw)
To: Chanwoo Lee
Cc: Adrian Hunter, Coly Li, Jens Axboe, Eric Biggers,
Peter Collingbourne, Luca Porzio, linux-mmc,
Linux Kernel Mailing List, grant.jung, jt77.jang, DooHyun Hwang,
Seunghui Lee
On Tue, 24 Aug 2021 at 09:46, Chanwoo Lee <cw9316.lee@samsung.com> wrote:
>
> From: ChanWoo Lee <cw9316.lee@samsung.com>
>
> 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: ChanWoo Lee <cw9316.lee@samsung.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/core/queue.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index cc3261777637..48304bcf963c 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -163,7 +163,7 @@ static void mmc_mq_recovery_handler(struct work_struct *work)
> 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;
>
> @@ -193,7 +193,7 @@ static void mmc_queue_setup_discard(struct request_queue *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 :
> host->max_segs;
> --
> 2.29.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-24 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20210824074651epcas1p3b6965040fa6a4660a31192f96125c374@epcas1p3.samsung.com>
2021-08-24 7:39 ` [PATCH] mmc: queue: Match the data type of max_segments Chanwoo Lee
2021-08-24 10:26 ` Coly Li
2021-08-24 14:56 ` Ulf Hansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.