edd117c9b54b7f97a94d33fa6b1678a35ef32ab1
[openwrt/staging/blocktrron.git] /
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
5
6 Clang 16 warns:
7
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]
9 buffer->imported = 1;
10 ^ ~
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]
12 buffer->in_use = 1;
13 ^ ~
14 2 warnings generated.
15
16 Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
17 ---
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(-)
21
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
25
26 pr_debug("%s dmabuf %p, buffer %p\n", __func__, dmabuf, buffer);
27
28 - buffer->in_use = 0;
29 + buffer->in_use = false;
30
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;
36
37 - buffer->imported = 1;
38 + buffer->imported = true;
39 buffer->import.dma_buf = dma_buf;
40
41 buffer->import.attach = attach;
42 buffer->import.sgt = sgt;
43 buffer->dma_addr = dma_addr;
44 - buffer->in_use = 1;
45 + buffer->in_use = true;
46 buffer->kernel_id = import.kernel_id;
47
48 /*
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 {
52
53 char name[VC_SM_MAX_NAME_LEN];
54
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 */
59
60 enum vc_sm_vpu_mapping_state vpu_state;
61 u32 vc_handle; /* VideoCore handle for this buffer */