[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624141141.GA30990@kadam>
Date: Wed, 24 Jun 2020 17:11:41 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
kernel-list@...pberrypi.com, linux-kernel@...r.kernel.org,
laurent.pinchart@...asonboard.com,
linux-arm-kernel@...ts.infradead.org,
linux-rpi-kernel@...ts.infradead.org
Subject: Re: [PATCH 15/50] staging: vchi: Unify struct shim_service and
struct vchi_service_handle
On Tue, Jun 23, 2020 at 06:42:01PM +0200, Nicolas Saenz Julienne wrote:
> @@ -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".
> 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
Powered by blists - more mailing lists