linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] media: venus: simplify the return expression of venus_sys_set_* function
@ 2020-09-21  8:24 Liu Shixin
  2020-09-25 15:06 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2020-09-21  8:24 UTC (permalink / raw)
  To: Stanimir Varbanov, Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Liu Shixin

Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 28 +++----------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 4be4a75ddcb6..05ddb68023b8 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -772,34 +772,24 @@ static int venus_sys_set_debug(struct venus_hfi_device *hdev, u32 debug)
 {
 	struct hfi_sys_set_property_pkt *pkt;
 	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
-	int ret;
 
 	pkt = (struct hfi_sys_set_property_pkt *)packet;
 
 	pkt_sys_debug_config(pkt, HFI_DEBUG_MODE_QUEUE, debug);
 
-	ret = venus_iface_cmdq_write(hdev, pkt);
-	if (ret)
-		return ret;
-
-	return 0;
+	return venus_iface_cmdq_write(hdev, pkt);
 }
 
 static int venus_sys_set_coverage(struct venus_hfi_device *hdev, u32 mode)
 {
 	struct hfi_sys_set_property_pkt *pkt;
 	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
-	int ret;
 
 	pkt = (struct hfi_sys_set_property_pkt *)packet;
 
 	pkt_sys_coverage_config(pkt, mode);
 
-	ret = venus_iface_cmdq_write(hdev, pkt);
-	if (ret)
-		return ret;
-
-	return 0;
+	return venus_iface_cmdq_write(hdev, pkt);
 }
 
 static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
@@ -807,7 +797,6 @@ static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
 {
 	struct hfi_sys_set_property_pkt *pkt;
 	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
-	int ret;
 
 	if (!enable)
 		return 0;
@@ -816,11 +805,7 @@ static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
 
 	pkt_sys_idle_indicator(pkt, enable);
 
-	ret = venus_iface_cmdq_write(hdev, pkt);
-	if (ret)
-		return ret;
-
-	return 0;
+	return venus_iface_cmdq_write(hdev, pkt);
 }
 
 static int venus_sys_set_power_control(struct venus_hfi_device *hdev,
@@ -828,17 +813,12 @@ static int venus_sys_set_power_control(struct venus_hfi_device *hdev,
 {
 	struct hfi_sys_set_property_pkt *pkt;
 	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
-	int ret;
 
 	pkt = (struct hfi_sys_set_property_pkt *)packet;
 
 	pkt_sys_power_control(pkt, enable);
 
-	ret = venus_iface_cmdq_write(hdev, pkt);
-	if (ret)
-		return ret;
-
-	return 0;
+	return venus_iface_cmdq_write(hdev, pkt);
 }
 
 static int venus_get_queue_size(struct venus_hfi_device *hdev,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] media: venus: simplify the return expression of venus_sys_set_* function
  2020-09-21  8:24 [PATCH -next] media: venus: simplify the return expression of venus_sys_set_* function Liu Shixin
@ 2020-09-25 15:06 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2020-09-25 15:06 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Stanimir Varbanov, Andy Gross, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On Mon 21 Sep 03:24 CDT 2020, Liu Shixin wrote:

> Simplify the return expression.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  drivers/media/platform/qcom/venus/hfi_venus.c | 28 +++----------------
>  1 file changed, 4 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
> index 4be4a75ddcb6..05ddb68023b8 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
> @@ -772,34 +772,24 @@ static int venus_sys_set_debug(struct venus_hfi_device *hdev, u32 debug)
>  {
>  	struct hfi_sys_set_property_pkt *pkt;
>  	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
> -	int ret;
>  
>  	pkt = (struct hfi_sys_set_property_pkt *)packet;
>  
>  	pkt_sys_debug_config(pkt, HFI_DEBUG_MODE_QUEUE, debug);
>  
> -	ret = venus_iface_cmdq_write(hdev, pkt);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return venus_iface_cmdq_write(hdev, pkt);
>  }
>  
>  static int venus_sys_set_coverage(struct venus_hfi_device *hdev, u32 mode)
>  {
>  	struct hfi_sys_set_property_pkt *pkt;
>  	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
> -	int ret;
>  
>  	pkt = (struct hfi_sys_set_property_pkt *)packet;
>  
>  	pkt_sys_coverage_config(pkt, mode);
>  
> -	ret = venus_iface_cmdq_write(hdev, pkt);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return venus_iface_cmdq_write(hdev, pkt);
>  }
>  
>  static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
> @@ -807,7 +797,6 @@ static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
>  {
>  	struct hfi_sys_set_property_pkt *pkt;
>  	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
> -	int ret;
>  
>  	if (!enable)
>  		return 0;
> @@ -816,11 +805,7 @@ static int venus_sys_set_idle_message(struct venus_hfi_device *hdev,
>  
>  	pkt_sys_idle_indicator(pkt, enable);
>  
> -	ret = venus_iface_cmdq_write(hdev, pkt);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return venus_iface_cmdq_write(hdev, pkt);
>  }
>  
>  static int venus_sys_set_power_control(struct venus_hfi_device *hdev,
> @@ -828,17 +813,12 @@ static int venus_sys_set_power_control(struct venus_hfi_device *hdev,
>  {
>  	struct hfi_sys_set_property_pkt *pkt;
>  	u8 packet[IFACEQ_VAR_SMALL_PKT_SIZE];
> -	int ret;
>  
>  	pkt = (struct hfi_sys_set_property_pkt *)packet;
>  
>  	pkt_sys_power_control(pkt, enable);
>  
> -	ret = venus_iface_cmdq_write(hdev, pkt);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return venus_iface_cmdq_write(hdev, pkt);
>  }
>  
>  static int venus_get_queue_size(struct venus_hfi_device *hdev,
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-25 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21  8:24 [PATCH -next] media: venus: simplify the return expression of venus_sys_set_* function Liu Shixin
2020-09-25 15:06 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).