Re: [PATCH] remove custom return values in vc04_services

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 12, 2022 at 02:19:28PM -0400, Joel Slebodnick wrote:
> @@ -3264,27 +3260,25 @@ release_message_sync(struct vchiq_state *state, struct vchiq_header *header)
>  	remote_event_signal(&state->remote->sync_release);
>  }
>  
> -enum vchiq_status
> +int
>  vchiq_get_peer_version(unsigned int handle, short *peer_version)
>  {
> -	enum vchiq_status status = VCHIQ_ERROR;
> +	int status = -EINVAL;
>  	struct vchiq_service *service = find_service_by_handle(handle);
>  
>  	if (!service)
>  		goto exit;
>  
> -	if (vchiq_check_service(service) != VCHIQ_SUCCESS)
> +	if (vchiq_check_service(service))
>  		goto exit;
>  
>  	if (!peer_version)
>  		goto exit;
>  
>  	*peer_version = service->peer_version;
> -	status = VCHIQ_SUCCESS;
> +	status = 0;
>  
>  exit:
> -	if (service)
> -		vchiq_service_put(service);

Too aggressive with the delete key.

>  	return status;
>  }

regards,
dan carpenter







[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux