From 2dd2f36d10961e3819ff0525ae2567e601973826 Mon Sep 17 00:00:00 2001 From: Alexander Winkowski Date: Mon, 3 Jul 2023 18:29:37 +0000 Subject: [PATCH] vc04_services/vc-sm-cma: Switch one-bit bitfields to bool Clang 16 warns: ../drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:816:19: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] buffer->imported = 1; ^ ~ ../drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:822:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] buffer->in_use = 1; ^ ~ 2 warnings generated. Signed-off-by: Alexander Winkowski --- drivers/staging/vc04_services/vc-sm-cma/vc_sm.c | 6 +++--- drivers/staging/vc04_services/vc-sm-cma/vc_sm.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c @@ -533,7 +533,7 @@ static void vc_sm_dma_buf_release(struct pr_debug("%s dmabuf %p, buffer %p\n", __func__, dmabuf, buffer); - buffer->in_use = 0; + buffer->in_use = false; /* Unmap on the VPU */ vc_sm_vpu_free(buffer); @@ -813,13 +813,13 @@ vc_sm_cma_import_dmabuf_internal(struct buffer->size = import.size; buffer->vpu_state = VPU_MAPPED; - buffer->imported = 1; + buffer->imported = true; buffer->import.dma_buf = dma_buf; buffer->import.attach = attach; buffer->import.sgt = sgt; buffer->dma_addr = dma_addr; - buffer->in_use = 1; + buffer->in_use = true; buffer->kernel_id = import.kernel_id; /* --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h @@ -57,8 +57,8 @@ struct vc_sm_buffer { char name[VC_SM_MAX_NAME_LEN]; - int in_use:1; /* Kernel is still using this resource */ - int imported:1; /* Imported dmabuf */ + bool in_use:1; /* Kernel is still using this resource */ + bool imported:1; /* Imported dmabuf */ enum vc_sm_vpu_mapping_state vpu_state; u32 vc_handle; /* VideoCore handle for this buffer */