From af9fd01fc3c90ac8e2b8d56c3569eb743ee7d1a7 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 18 Mar 2019 17:14:51 +0000 Subject: [PATCH 1/3] vcsm: Fix makefile include on out-of-tree builds The vc_sm module tries to include the 'fs' directory from the $(srctree). $(srctree) is already provided by the build system, and causes the include path to be duplicated. With -Werror this fails to compile. Remove the unnecessary variable. Signed-off-by: Kieran Bingham --- drivers/char/broadcom/vc_sm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/broadcom/vc_sm/Makefile b/drivers/char/broadcom/vc_sm/Makefile index 19ce263bc273dc..20b7646fe4b64a 100644 --- a/drivers/char/broadcom/vc_sm/Makefile +++ b/drivers/char/broadcom/vc_sm/Makefile @@ -1,5 +1,5 @@ ccflags-$(CONFIG_BCM_VC_SM) += -Werror -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -ccflags-$(CONFIG_BCM_VC_SM) += -I"drivers/staging/vc04_services" -I"drivers/staging/vc04_services/interface/vchi" -I"drivers/staging/vc04_services/interface/vchiq_arm" -I"$(srctree)/fs/" +ccflags-$(CONFIG_BCM_VC_SM) += -I"drivers/staging/vc04_services" -I"drivers/staging/vc04_services/interface/vchi" -I"drivers/staging/vc04_services/interface/vchiq_arm" -I"fs" ccflags-$(CONFIG_BCM_VC_SM) += -DOS_ASSERT_FAILURE -D__STDC_VERSION=199901L -D__STDC_VERSION__=199901L -D__VCCOREVER__=0 -D__KERNEL__ -D__linux__ obj-$(CONFIG_BCM_VC_SM) := vc-sm.o From da30285f1316e2cbf7a997e7332f9c69363886aa Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 18 Mar 2019 17:16:41 +0000 Subject: [PATCH 2/3] vcsm: Remove set but unused variable The 'success' variable is set by the call to vchi_service_close() but never checked. Remove it, keeping the call in place. Signed-off-by: Kieran Bingham --- drivers/char/broadcom/vc_sm/vc_vchi_sm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c index f8b909a09adb07..ca4ec40bb5fb2b 100644 --- a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c +++ b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c @@ -361,11 +361,9 @@ int vc_vchi_sm_stop(struct sm_instance **handle) /* Close all VCHI service connections */ for (i = 0; i < instance->num_connections; i++) { - int32_t success; - vchi_service_use(instance->vchi_handle[i]); - success = vchi_service_close(instance->vchi_handle[i]); + vchi_service_close(instance->vchi_handle[i]); } kfree(instance); From f24d331f066781142ab5116dfbf6f0a580762114 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 18 Mar 2019 17:17:40 +0000 Subject: [PATCH 3/3] vcsm: Reduce scope of local functions The functions: vc_vchi_sm_send_msg vc_sm_ioctl_alloc vc_sm_ioctl_alloc_share vc_sm_ioctl_import_dmabuf Are declared without a prototype. They are not used outside of this module, thus - convert them to static functions. Signed-off-by: Kieran Bingham --- drivers/char/broadcom/vc_sm/vc_vchi_sm.c | 2 +- drivers/char/broadcom/vc_sm/vmcs_sm.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c index ca4ec40bb5fb2b..c3742e1656ae46 100644 --- a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c +++ b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c @@ -375,7 +375,7 @@ int vc_vchi_sm_stop(struct sm_instance **handle) return -EINVAL; } -int vc_vchi_sm_send_msg(struct sm_instance *handle, +static int vc_vchi_sm_send_msg(struct sm_instance *handle, enum vc_sm_msg_type msg_id, void *msg, uint32_t msg_size, void *result, uint32_t result_size, diff --git a/drivers/char/broadcom/vc_sm/vmcs_sm.c b/drivers/char/broadcom/vc_sm/vmcs_sm.c index 56a21658b53835..1bbe11dc1e3349 100644 --- a/drivers/char/broadcom/vc_sm/vmcs_sm.c +++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c @@ -1574,8 +1574,8 @@ static int vc_sm_mmap(struct file *file, struct vm_area_struct *vma) } /* Allocate a shared memory handle and block. */ -int vc_sm_ioctl_alloc(struct sm_priv_data_t *private, - struct vmcs_sm_ioctl_alloc *ioparam) +static int vc_sm_ioctl_alloc(struct sm_priv_data_t *private, + struct vmcs_sm_ioctl_alloc *ioparam) { int ret = 0; int status; @@ -1685,8 +1685,8 @@ int vc_sm_ioctl_alloc(struct sm_priv_data_t *private, } /* Share an allocate memory handle and block.*/ -int vc_sm_ioctl_alloc_share(struct sm_priv_data_t *private, - struct vmcs_sm_ioctl_alloc_share *ioparam) +static int vc_sm_ioctl_alloc_share(struct sm_priv_data_t *private, + struct vmcs_sm_ioctl_alloc_share *ioparam) { struct sm_resource_t *resource, *shared_resource; int ret = 0; @@ -2200,9 +2200,9 @@ static int vc_sm_ioctl_unlock(struct sm_priv_data_t *private, } /* Import a contiguous block of memory to be shared with VC. */ -int vc_sm_ioctl_import_dmabuf(struct sm_priv_data_t *private, - struct vmcs_sm_ioctl_import_dmabuf *ioparam, - struct dma_buf *src_dma_buf) +static int vc_sm_ioctl_import_dmabuf(struct sm_priv_data_t *private, + struct vmcs_sm_ioctl_import_dmabuf *ioparam, + struct dma_buf *src_dma_buf) { int ret = 0; int status;