Re: [PATCH v3 12/30] drivers: hv: dxgkrnl: Sharing of dxgresource objects

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

 



On Tue, Mar 01, 2022 at 11:45:59AM -0800, Iouri Tarassov wrote:
[...]
>  
> +static int dxgsharedresource_seal(struct dxgsharedresource *shared_resource)
> +{
> +	int ret = 0;
> +	int i = 0;
> +	u8 *private_data;
> +	u32 data_size;
> +	struct dxgresource *resource;
> +	struct dxgallocation *alloc;
> +
> +	pr_debug("Sealing resource: %p", shared_resource);
> +
> +	down_write(&shared_resource->adapter->shared_resource_list_lock);
> +	if (shared_resource->sealed) {
> +		pr_debug("Resource already sealed");
> +		goto cleanup;
> +	}
> +	shared_resource->sealed = 1;
> +	if (!list_empty(&shared_resource->resource_list_head)) {
[...]
> +		}
> +cleanup1:

Please just name it unlock ... 

> +		mutex_unlock(&resource->resource_mutex);
> +	}
> +cleanup:

... and rename this to done because you are not cleaning up anything.

> +	up_write(&shared_resource->adapter->shared_resource_list_lock);
> +	return ret;
> +}
> +

Thanks,
Wei.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux