staging: vchiq: Have vchiu_queue_init() return 0 on success.
authorMarcelo Diop-Gonzalez <marcgonzalez@google.com>
Tue, 5 Nov 2019 22:27:56 +0000 (17:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Nov 2019 15:26:31 +0000 (16:26 +0100)
It could be confusing to return 1 on success and 0 on error
given the style elswhere.

Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
Link: https://lore.kernel.org/r/20191105222756.25369-1-marcgonzalez@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c

index 3055e94..0ce3b08 100644 (file)
@@ -573,7 +573,7 @@ static struct shim_service *service_alloc(struct vchiq_instance *instance,
        (void)instance;
 
        if (service) {
-               if (vchiu_queue_init(&service->queue, 64)) {
+               if (!vchiu_queue_init(&service->queue, 64)) {
                        service->callback = setup->callback;
                        service->callback_param = setup->callback_param;
                } else {
index 5e6d303..644844d 100644 (file)
@@ -24,9 +24,9 @@ int vchiu_queue_init(struct vchiu_queue *queue, int size)
                                 GFP_KERNEL);
        if (!queue->storage) {
                vchiu_queue_delete(queue);
-               return 0;
+               return -ENOMEM;
        }
-       return 1;
+       return 0;
 }
 
 void vchiu_queue_delete(struct vchiu_queue *queue)