linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq()
@ 2021-11-17  6:39 cgel.zte
  2021-11-17  9:20 ` Stefano Garzarella
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cgel.zte @ 2021-11-17  6:39 UTC (permalink / raw)
  To: mst
  Cc: jasowang, pbonzini, stefanha, axboe, virtualization, linux-block,
	linux-kernel, Ye Guojin, Zeal Robot

From: Ye Guojin <ye.guojin@zte.com.cn>

This was found by coccicheck:
./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression
compared with zero  num < 0

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
---
 drivers/block/virtio_blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 97bf051a50ce..eed1666eff31 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -316,7 +316,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
 	struct request *req = bd->rq;
 	struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
 	unsigned long flags;
-	unsigned int num;
+	int num;
 	int qid = hctx->queue_num;
 	bool notify = false;
 	blk_status_t status;
-- 
2.25.1


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

* Re: [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq()
  2021-11-17  6:39 [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq() cgel.zte
@ 2021-11-17  9:20 ` Stefano Garzarella
  2021-11-23 16:59 ` Max Gurtovoy
  2021-11-24 15:37 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2021-11-17  9:20 UTC (permalink / raw)
  To: cgel.zte
  Cc: mst, jasowang, pbonzini, stefanha, axboe, virtualization,
	linux-block, linux-kernel, Ye Guojin, Zeal Robot

On Wed, Nov 17, 2021 at 06:39:55AM +0000, cgel.zte@gmail.com wrote:
>From: Ye Guojin <ye.guojin@zte.com.cn>
>
>This was found by coccicheck:
>./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression
>compared with zero  num < 0
>

We should add the Fixes tag:

Fixes: 02746e26c39e ("virtio-blk: avoid preallocating big SGL for data")

>Reported-by: Zeal Robot <zealci@zte.com.cn>
>Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
>---
> drivers/block/virtio_blk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>index 97bf051a50ce..eed1666eff31 100644
>--- a/drivers/block/virtio_blk.c
>+++ b/drivers/block/virtio_blk.c
>@@ -316,7 +316,7 @@ static blk_status_t virtio_queue_rq(struct 
>blk_mq_hw_ctx *hctx,
> 	struct request *req = bd->rq;
> 	struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
> 	unsigned long flags;
>-	unsigned int num;
>+	int num;
> 	int qid = hctx->queue_num;
> 	bool notify = false;
> 	blk_status_t status;
>-- 
>2.25.1
>

The patch LGTM.

With the Fixes tag added:

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>


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

* Re: [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq()
  2021-11-17  6:39 [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq() cgel.zte
  2021-11-17  9:20 ` Stefano Garzarella
@ 2021-11-23 16:59 ` Max Gurtovoy
  2021-11-24 15:37 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Max Gurtovoy @ 2021-11-23 16:59 UTC (permalink / raw)
  To: cgel.zte, mst
  Cc: jasowang, pbonzini, stefanha, axboe, virtualization, linux-block,
	linux-kernel, Ye Guojin, Zeal Robot


On 11/17/2021 8:39 AM, cgel.zte@gmail.com wrote:
> From: Ye Guojin <ye.guojin@zte.com.cn>
>
> This was found by coccicheck:
> ./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression
> compared with zero  num < 0
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
> ---
>   drivers/block/virtio_blk.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 97bf051a50ce..eed1666eff31 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -316,7 +316,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
>   	struct request *req = bd->rq;
>   	struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
>   	unsigned long flags;
> -	unsigned int num;
> +	int num;
>   	int qid = hctx->queue_num;
>   	bool notify = false;
>   	blk_status_t status;

Looks good,

Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>


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

* Re: [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq()
  2021-11-17  6:39 [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq() cgel.zte
  2021-11-17  9:20 ` Stefano Garzarella
  2021-11-23 16:59 ` Max Gurtovoy
@ 2021-11-24 15:37 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2021-11-24 15:37 UTC (permalink / raw)
  To: cgel.zte
  Cc: mst, jasowang, pbonzini, axboe, virtualization, linux-block,
	linux-kernel, Ye Guojin, Zeal Robot

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

On Wed, Nov 17, 2021 at 06:39:55AM +0000, cgel.zte@gmail.com wrote:
> From: Ye Guojin <ye.guojin@zte.com.cn>
> 
> This was found by coccicheck:
> ./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression
> compared with zero  num < 0
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
> ---
>  drivers/block/virtio_blk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-11-24 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17  6:39 [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq() cgel.zte
2021-11-17  9:20 ` Stefano Garzarella
2021-11-23 16:59 ` Max Gurtovoy
2021-11-24 15:37 ` Stefan Hajnoczi

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).