1 From 2dd2f36d10961e3819ff0525ae2567e601973826 Mon Sep 17 00:00:00 2001
2 From: Alexander Winkowski <dereference23@outlook.com>
3 Date: Mon, 3 Jul 2023 18:29:37 +0000
4 Subject: [PATCH] vc04_services/vc-sm-cma: Switch one-bit bitfields to bool
8 ../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]
11 ../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]
16 Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
18 drivers/staging/vc04_services/vc-sm-cma/vc_sm.c | 6 +++---
19 drivers/staging/vc04_services/vc-sm-cma/vc_sm.h | 4 ++--
20 2 files changed, 5 insertions(+), 5 deletions(-)
22 --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
23 +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
24 @@ -533,7 +533,7 @@ static void vc_sm_dma_buf_release(struct
26 pr_debug("%s dmabuf %p, buffer %p\n", __func__, dmabuf, buffer);
29 + buffer->in_use = false;
31 /* Unmap on the VPU */
32 vc_sm_vpu_free(buffer);
33 @@ -813,13 +813,13 @@ vc_sm_cma_import_dmabuf_internal(struct
34 buffer->size = import.size;
35 buffer->vpu_state = VPU_MAPPED;
37 - buffer->imported = 1;
38 + buffer->imported = true;
39 buffer->import.dma_buf = dma_buf;
41 buffer->import.attach = attach;
42 buffer->import.sgt = sgt;
43 buffer->dma_addr = dma_addr;
45 + buffer->in_use = true;
46 buffer->kernel_id = import.kernel_id;
49 --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h
50 +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.h
51 @@ -57,8 +57,8 @@ struct vc_sm_buffer {
53 char name[VC_SM_MAX_NAME_LEN];
55 - int in_use:1; /* Kernel is still using this resource */
56 - int imported:1; /* Imported dmabuf */
57 + bool in_use:1; /* Kernel is still using this resource */
58 + bool imported:1; /* Imported dmabuf */
60 enum vc_sm_vpu_mapping_state vpu_state;
61 u32 vc_handle; /* VideoCore handle for this buffer */