Re: [PATCH 15/50] staging: vchi: Unify struct shim_service and struct vchi_service_handle
From: Dan Carpenter <hidden>
Date: 2020-06-24 14:12:26
Also in:
lkml
On Tue, Jun 23, 2020 at 06:42:01PM +0200, Nicolas Saenz Julienne wrote:
quoted hunk ↗ jump to hunk
@@ -437,12 +432,10 @@ static void service_free(struct shim_service *service) int32_t vchi_service_open(struct vchiq_instance *instance, struct service_creation *setup, - struct vchi_service_handle **handle) + struct vchi_service **service) { - struct shim_service *service = service_alloc(instance, setup); - - *handle = (struct vchi_service_handle *)service; + *service = service_alloc(instance, setup); if (service) {
This should be checking "*service".
quoted hunk ↗ jump to hunk
struct vchiq_service_params params; enum vchiq_status status;@@ -450,27 +443,25 @@ int32_t vchi_service_open(struct vchiq_instance *instance, memset(¶ms, 0, sizeof(params)); params.fourcc = setup->service_id; params.callback = shim_callback; - params.userdata = service; + params.userdata = *service; params.version = setup->version.version; params.version_min = setup->version.version_min; status = vchiq_open_service(instance, ¶ms, - &service->handle); + &((*service)->handle)); if (status != VCHIQ_SUCCESS) { - service_free(service); - service = NULL; - *handle = NULL; + service_free(*service); + *service = NULL; } } - return service ? 0 : -1; + return *service ? 0 : -1; } EXPORT_SYMBOL(vchi_service_open);
regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel