All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: remove unnecessary type castings
@ 2022-07-06  5:35 Yu Zhe
  2022-07-20 11:19 ` Paolo VALENTE
  0 siblings, 1 reply; 3+ messages in thread
From: Yu Zhe @ 2022-07-06  5:35 UTC (permalink / raw)
  To: paolo.valente, axboe; +Cc: linux-block, linux-kernel, liqiong, Yu Zhe

remove unnecessary void* type castings.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 block/bfq-wf2q.c   | 6 +++---
 block/blk-iocost.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index f8eb340381cf..2a666b100bcb 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -474,7 +474,7 @@ static void bfq_active_insert(struct bfq_service_tree *st,
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	sd = entity->sched_data;
 	bfqg = container_of(sd, struct bfq_group, sched_data);
-	bfqd = (struct bfq_data *)bfqg->bfqd;
+	bfqd = bfqg->bfqd;
 #endif
 	if (bfqq)
 		list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list);
@@ -573,7 +573,7 @@ static void bfq_active_extract(struct bfq_service_tree *st,
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	sd = entity->sched_data;
 	bfqg = container_of(sd, struct bfq_group, sched_data);
-	bfqd = (struct bfq_data *)bfqg->bfqd;
+	bfqd = bfqg->bfqd;
 #endif
 	if (bfqq)
 		list_del(&bfqq->bfqq_list);
@@ -719,7 +719,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
 		else {
 			sd = entity->my_sched_data;
 			bfqg = container_of(sd, struct bfq_group, sched_data);
-			bfqd = (struct bfq_data *)bfqg->bfqd;
+			bfqd = bfqg->bfqd;
 		}
 #endif
 
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 33a11ba971ea..117181a69b7a 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -1430,7 +1430,7 @@ static int iocg_wake_fn(struct wait_queue_entry *wq_entry, unsigned mode,
 			int flags, void *key)
 {
 	struct iocg_wait *wait = container_of(wq_entry, struct iocg_wait, wait);
-	struct iocg_wake_ctx *ctx = (struct iocg_wake_ctx *)key;
+	struct iocg_wake_ctx *ctx = key;
 	u64 cost = abs_cost_to_cost(wait->abs_cost, ctx->hw_inuse);
 
 	ctx->vbudget -= cost;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: remove unnecessary type castings
  2022-07-06  5:35 [PATCH] block: remove unnecessary type castings Yu Zhe
@ 2022-07-20 11:19 ` Paolo VALENTE
  2022-07-20 11:28   ` Yu Kuai
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo VALENTE @ 2022-07-20 11:19 UTC (permalink / raw)
  To: Yu Zhe; +Cc: Jens Axboe, linux-block, LKML, liqiong



> Il giorno 6 lug 2022, alle ore 07:35, Yu Zhe <yuzhe@nfschina.com> ha scritto:
> 
> remove unnecessary void* type castings.
> 

Thanks for improving BFQ code. Which commit made these casts unnecessary?

Paolo


> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---
> block/bfq-wf2q.c   | 6 +++---
> block/blk-iocost.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
> index f8eb340381cf..2a666b100bcb 100644
> --- a/block/bfq-wf2q.c
> +++ b/block/bfq-wf2q.c
> @@ -474,7 +474,7 @@ static void bfq_active_insert(struct bfq_service_tree *st,
> #ifdef CONFIG_BFQ_GROUP_IOSCHED
> 	sd = entity->sched_data;
> 	bfqg = container_of(sd, struct bfq_group, sched_data);
> -	bfqd = (struct bfq_data *)bfqg->bfqd;
> +	bfqd = bfqg->bfqd;
> #endif
> 	if (bfqq)
> 		list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list);
> @@ -573,7 +573,7 @@ static void bfq_active_extract(struct bfq_service_tree *st,
> #ifdef CONFIG_BFQ_GROUP_IOSCHED
> 	sd = entity->sched_data;
> 	bfqg = container_of(sd, struct bfq_group, sched_data);
> -	bfqd = (struct bfq_data *)bfqg->bfqd;
> +	bfqd = bfqg->bfqd;
> #endif
> 	if (bfqq)
> 		list_del(&bfqq->bfqq_list);
> @@ -719,7 +719,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
> 		else {
> 			sd = entity->my_sched_data;
> 			bfqg = container_of(sd, struct bfq_group, sched_data);
> -			bfqd = (struct bfq_data *)bfqg->bfqd;
> +			bfqd = bfqg->bfqd;
> 		}
> #endif
> 
> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
> index 33a11ba971ea..117181a69b7a 100644
> --- a/block/blk-iocost.c
> +++ b/block/blk-iocost.c
> @@ -1430,7 +1430,7 @@ static int iocg_wake_fn(struct wait_queue_entry *wq_entry, unsigned mode,
> 			int flags, void *key)
> {
> 	struct iocg_wait *wait = container_of(wq_entry, struct iocg_wait, wait);
> -	struct iocg_wake_ctx *ctx = (struct iocg_wake_ctx *)key;
> +	struct iocg_wake_ctx *ctx = key;
> 	u64 cost = abs_cost_to_cost(wait->abs_cost, ctx->hw_inuse);
> 
> 	ctx->vbudget -= cost;
> -- 
> 2.11.0
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: remove unnecessary type castings
  2022-07-20 11:19 ` Paolo VALENTE
@ 2022-07-20 11:28   ` Yu Kuai
  0 siblings, 0 replies; 3+ messages in thread
From: Yu Kuai @ 2022-07-20 11:28 UTC (permalink / raw)
  To: Paolo VALENTE, Yu Zhe; +Cc: Jens Axboe, linux-block, LKML, liqiong

在 2022/07/20 19:19, Paolo VALENTE 写道:
> 
> 
>> Il giorno 6 lug 2022, alle ore 07:35, Yu Zhe <yuzhe@nfschina.com> ha scritto:
>>
>> remove unnecessary void* type castings.
>>
> 
> Thanks for improving BFQ code. Which commit made these casts unnecessary?
> 
> Paolo
Hi!

I already posted a similar patch:

https://lore.kernel.org/all/20220528095958.270455-5-yukuai3@huawei.com/

It's waiting for the concurrent sync io patchset.

Thanks,
Kuai
> 
> 
>> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
>> ---
>> block/bfq-wf2q.c   | 6 +++---
>> block/blk-iocost.c | 2 +-
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
>> index f8eb340381cf..2a666b100bcb 100644
>> --- a/block/bfq-wf2q.c
>> +++ b/block/bfq-wf2q.c
>> @@ -474,7 +474,7 @@ static void bfq_active_insert(struct bfq_service_tree *st,
>> #ifdef CONFIG_BFQ_GROUP_IOSCHED
>> 	sd = entity->sched_data;
>> 	bfqg = container_of(sd, struct bfq_group, sched_data);
>> -	bfqd = (struct bfq_data *)bfqg->bfqd;
>> +	bfqd = bfqg->bfqd;
>> #endif
>> 	if (bfqq)
>> 		list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list);
>> @@ -573,7 +573,7 @@ static void bfq_active_extract(struct bfq_service_tree *st,
>> #ifdef CONFIG_BFQ_GROUP_IOSCHED
>> 	sd = entity->sched_data;
>> 	bfqg = container_of(sd, struct bfq_group, sched_data);
>> -	bfqd = (struct bfq_data *)bfqg->bfqd;
>> +	bfqd = bfqg->bfqd;
>> #endif
>> 	if (bfqq)
>> 		list_del(&bfqq->bfqq_list);
>> @@ -719,7 +719,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
>> 		else {
>> 			sd = entity->my_sched_data;
>> 			bfqg = container_of(sd, struct bfq_group, sched_data);
>> -			bfqd = (struct bfq_data *)bfqg->bfqd;
>> +			bfqd = bfqg->bfqd;
>> 		}
>> #endif
>>
>> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
>> index 33a11ba971ea..117181a69b7a 100644
>> --- a/block/blk-iocost.c
>> +++ b/block/blk-iocost.c
>> @@ -1430,7 +1430,7 @@ static int iocg_wake_fn(struct wait_queue_entry *wq_entry, unsigned mode,
>> 			int flags, void *key)
>> {
>> 	struct iocg_wait *wait = container_of(wq_entry, struct iocg_wait, wait);
>> -	struct iocg_wake_ctx *ctx = (struct iocg_wake_ctx *)key;
>> +	struct iocg_wake_ctx *ctx = key;
>> 	u64 cost = abs_cost_to_cost(wait->abs_cost, ctx->hw_inuse);
>>
>> 	ctx->vbudget -= cost;
>> -- 
>> 2.11.0
>>
> 
> .
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-20 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  5:35 [PATCH] block: remove unnecessary type castings Yu Zhe
2022-07-20 11:19 ` Paolo VALENTE
2022-07-20 11:28   ` Yu Kuai

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.