2023-04-03 02:54:11

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH 2/7] usb: mtu3: use boolean return value

Prefer to use boolean value due to gpd_ring_empty() return true or false.
See "16) Function return values and names" in coding-style.rst

Signed-off-by: Chunfeng Yun <[email protected]>
---
drivers/usb/mtu3/mtu3_qmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
index 7be4e4be1a6a..66639f602a9d 100644
--- a/drivers/usb/mtu3/mtu3_qmu.c
+++ b/drivers/usb/mtu3/mtu3_qmu.c
@@ -221,7 +221,7 @@ static struct qmu_gpd *advance_deq_gpd(struct mtu3_gpd_ring *ring)
}

/* check if a ring is emtpy */
-static int gpd_ring_empty(struct mtu3_gpd_ring *ring)
+static bool gpd_ring_empty(struct mtu3_gpd_ring *ring)
{
struct qmu_gpd *enq = ring->enqueue;
struct qmu_gpd *next;
--
2.18.0


Subject: Re: [PATCH 2/7] usb: mtu3: use boolean return value

Il 03/04/23 04:52, Chunfeng Yun ha scritto:
> Prefer to use boolean value due to gpd_ring_empty() return true or false.
> See "16) Function return values and names" in coding-style.rst
>
> Signed-off-by: Chunfeng Yun <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>