Re: [PATCH 01/11] staging: vchiq_arm: Replace variable ret with status

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

 



Hi Stefan,

Thank you for the patch.

On Tue, Jun 04, 2024 at 07:28:54PM +0200, Stefan Wahren wrote:
> The variable ret is just storing the result of last function
> call like the variable status. So replace ret with status
> and make a consistent use of this variable.

I would have gone the other way around, and replaced 'status' with 'ret'
as the latter is more commonly used for this purpose in kernel code. I
know it will generate more churn, but I think the result will be more
maintainable.

> Signed-off-by: Stefan Wahren <wahrenst@xxxxxxx>
> ---
>  .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 69daeba974f2..e2f4aa00cb70 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -1298,7 +1298,6 @@ vchiq_keepalive_thread_func(void *v)
>  	int status;
>  	struct vchiq_instance *instance;
>  	unsigned int ka_handle;
> -	int ret;
> 
>  	struct vchiq_service_params_kernel params = {
>  		.fourcc      = VCHIQ_MAKE_FOURCC('K', 'E', 'E', 'P'),
> @@ -1307,9 +1306,10 @@ vchiq_keepalive_thread_func(void *v)
>  		.version_min = KEEPALIVE_VER_MIN
>  	};
> 
> -	ret = vchiq_initialise(state, &instance);
> -	if (ret) {
> -		dev_err(state->dev, "suspend: %s: vchiq_initialise failed %d\n", __func__, ret);
> +	status = vchiq_initialise(state, &instance);
> +	if (status) {
> +		dev_err(state->dev, "suspend: %s: vchiq_initialise failed %d\n",
> +			__func__, status);
>  		goto exit;
>  	}
> 

-- 
Regards,

Laurent Pinchart




[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