linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] block: remove unused but set variable 'hctx'
@ 2020-07-02  3:54 Wei Yongjun
  2020-07-02  4:34 ` Chaitanya Kulkarni
  2020-07-02  4:36 ` Ming Lei
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2020-07-02  3:54 UTC (permalink / raw)
  To: Wei Yongjun, Jens Axboe, Ming Lei; +Cc: Hulk Robot, linux-block

From: Hulk Robot <hulkci@huawei.com>

After commit 37f4a24c2469 ("blk-mq: centralise related handling
into blk_mq_get_driver_tag"), 'hctx' is never be used. Gcc report
build warning:

block/blk-flush.c:222:24: warning:
 variable hctx set but not used [-Wunused-but-set-variable]
  222 |  struct blk_mq_hw_ctx *hctx;
      |                        ^~~~

Just removing it to avoid build warning.

Signed-off-by: Hulk Robot <hulkci@huawei.com>
---
 block/blk-flush.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/block/blk-flush.c b/block/blk-flush.c
index e756db088d84..a20fe125e9fa 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -219,7 +219,6 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
 	struct request *rq, *n;
 	unsigned long flags = 0;
 	struct blk_flush_queue *fq = blk_get_flush_queue(q, flush_rq->mq_ctx);
-	struct blk_mq_hw_ctx *hctx;
 
 	blk_account_io_flush(flush_rq);
 
@@ -235,7 +234,6 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
 	if (fq->rq_status != BLK_STS_OK)
 		error = fq->rq_status;
 
-	hctx = flush_rq->mq_hctx;
 	if (!q->elevator)
 		flush_rq->tag = BLK_MQ_NO_TAG;
 	else


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

* Re: [PATCH -next] block: remove unused but set variable 'hctx'
  2020-07-02  3:54 [PATCH -next] block: remove unused but set variable 'hctx' Wei Yongjun
@ 2020-07-02  4:34 ` Chaitanya Kulkarni
  2020-07-02  4:36 ` Ming Lei
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2020-07-02  4:34 UTC (permalink / raw)
  To: Wei Yongjun, Jens Axboe, Ming Lei; +Cc: Hulk Robot, linux-block

On 7/1/20 8:44 PM, Wei Yongjun wrote:
> From: Hulk Robot<hulkci@huawei.com>
> 
> After commit 37f4a24c2469 ("blk-mq: centralise related handling
> into blk_mq_get_driver_tag"), 'hctx' is never be used. Gcc report
> build warning:
> 
> block/blk-flush.c:222:24: warning:
>   variable hctx set but not used [-Wunused-but-set-variable]
>    222 |  struct blk_mq_hw_ctx *hctx;
>        |                        ^~~~
> 
> Just removing it to avoid build warning.
Ha Ha was about to send this patch.

Looks good. Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

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

* Re: [PATCH -next] block: remove unused but set variable 'hctx'
  2020-07-02  3:54 [PATCH -next] block: remove unused but set variable 'hctx' Wei Yongjun
  2020-07-02  4:34 ` Chaitanya Kulkarni
@ 2020-07-02  4:36 ` Ming Lei
  1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2020-07-02  4:36 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Jens Axboe, Hulk Robot, linux-block

On Thu, Jul 02, 2020 at 11:54:45AM +0800, Wei Yongjun wrote:
> From: Hulk Robot <hulkci@huawei.com>
> 
> After commit 37f4a24c2469 ("blk-mq: centralise related handling
> into blk_mq_get_driver_tag"), 'hctx' is never be used. Gcc report
> build warning:
> 
> block/blk-flush.c:222:24: warning:
>  variable hctx set but not used [-Wunused-but-set-variable]
>   222 |  struct blk_mq_hw_ctx *hctx;
>       |                        ^~~~
> 
> Just removing it to avoid build warning.
> 
> Signed-off-by: Hulk Robot <hulkci@huawei.com>
> ---
>  block/blk-flush.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/block/blk-flush.c b/block/blk-flush.c
> index e756db088d84..a20fe125e9fa 100644
> --- a/block/blk-flush.c
> +++ b/block/blk-flush.c
> @@ -219,7 +219,6 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
>  	struct request *rq, *n;
>  	unsigned long flags = 0;
>  	struct blk_flush_queue *fq = blk_get_flush_queue(q, flush_rq->mq_ctx);
> -	struct blk_mq_hw_ctx *hctx;
>  
>  	blk_account_io_flush(flush_rq);
>  
> @@ -235,7 +234,6 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
>  	if (fq->rq_status != BLK_STS_OK)
>  		error = fq->rq_status;
>  
> -	hctx = flush_rq->mq_hctx;
>  	if (!q->elevator)
>  		flush_rq->tag = BLK_MQ_NO_TAG;
>  	else
> 

Reviewed-by: Ming Lei <ming.lei@redhat.com>

-- 
Ming


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

end of thread, other threads:[~2020-07-02  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02  3:54 [PATCH -next] block: remove unused but set variable 'hctx' Wei Yongjun
2020-07-02  4:34 ` Chaitanya Kulkarni
2020-07-02  4:36 ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).