Re: [PATCH 2/2] soundwire: cadence: Simplify error paths in cdns_xfer_msg()

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

 




On 9/17/22 17:48, Richard Fitzgerald wrote:
> There's no need to goto an exit label to return from cdns_xfer_msg().
> It doesn't do any cleanup, only a return statement.
> 
> Replace the gotos with returns.
> 
> Signed-off-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>

> ---
>  drivers/soundwire/cadence_master.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
> index 3543a923ee6b..30b8c628fdbd 100644
> --- a/drivers/soundwire/cadence_master.c
> +++ b/drivers/soundwire/cadence_master.c
> @@ -709,17 +709,14 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
>  		ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
>  				     CDNS_MCP_CMD_LEN, false);
>  		if (ret != SDW_CMD_OK)
> -			goto exit;
> +			return ret;
>  	}
>  
>  	if (!(msg->len % CDNS_MCP_CMD_LEN))
> -		goto exit;
> +		return SDW_CMD_OK;
>  
> -	ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
> -			     msg->len % CDNS_MCP_CMD_LEN, false);
> -
> -exit:
> -	return ret;
> +	return _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
> +			      msg->len % CDNS_MCP_CMD_LEN, false);
>  }
>  EXPORT_SYMBOL(cdns_xfer_msg);
>  



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux