coresight: tmc-etr: Assign boolean values to a bool variable
PATCH v2 1/1 coresight: tmc-etr: Assign boolean values to a bool variable
From: Kaixu Xia <[email protected]>
Fix the following coccinelle warnings:
./drivers/hwtracing/coresight/coresight-tmc-etr.c:957:2-15: WARNING: Assignment of 0/1 to bool variable
Fix them by assigning boolean values.
Reported-by Tosk Robot <[email protected]>
Signed-off-by Kaixu Xia <[email protected]>
--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-tmc-etr.c +2 -2
@@ -954,11 +954,11 @@ static void tmc_sync_etr_buf(struct tmc_drvdata *drvdata)dev_dbg (&drvdata->csdev->dev,"tmc memory error detected, truncating buffer\n" ); etr_buf->len =0 ; - etr_buf->full =0 ; + etr_buf->full = false;return ; } - etr_buf->full = status &TMC_STS_FULL ; + etr_buf->full = !!(status &TMC_STS_FULL );WARN_ON (!etr_buf->ops || !etr_buf->ops->sync);
Signature · 1 line
2.20.0
Quoted 6 lines · On Tue, Nov 10, 2020 at 11:39:15AM +0800, [email protected] wrote:
From: Kaixu Xia <[email protected]>
Fix the following coccinelle warnings:
./drivers/hwtracing/coresight/coresight-tmc-etr.c:957:2-15: WARNING: Assignment of 0/1 to bool variable
Quoted 7 lines
Fix them by assigning boolean values.
Reported-by Tosk Robot <[email protected]>Signed-off-by Kaixu Xia <[email protected]>--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
I have applied your patch.
Thanks,
Mathieu
Quoted 22 lines
drivers/hwtracing/coresight/coresight-tmc-etr.c +2
-2@@ -954,11 +954,11 @@ static void tmc_sync_etr_buf(struct tmc_drvdata *drvdata)dev_dbg (&drvdata->csdev->dev,"tmc memory error detected, truncating buffer\n" ); etr_buf->len =0 ; - etr_buf->full =0 ; + etr_buf->full = false;return ; } - etr_buf->full = status &TMC_STS_FULL ; + etr_buf->full = !!(status &TMC_STS_FULL );WARN_ON (!etr_buf->ops || !etr_buf->ops->sync);Signature · 1 line
2.20.0