public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] soundwire: qcom: remove redundant ret variable
@ 2022-11-02 14:08 zhang.songyi
  0 siblings, 0 replies; only message in thread
From: zhang.songyi @ 2022-11-02 14:08 UTC (permalink / raw)
  To: agross
  Cc: andersson, konrad.dybcio, vkoul, yung-chuan.liao,
	pierre-louis.bossart, sanyog.r.kale, linux-arm-msm, alsa-devel,
	linux-kernel, jiang.xuexin, xue.zhihong, zhang.songyi

From ebc0be30e0c49d2d54a9aaa064c7f742e99e8eb2 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
Date: Wed, 2 Nov 2022 22:08:48 +0800
Subject: [PATCH linux-next] soundwire: qcom: remove redundant ret variable

Return value from swrm_get_packed_reg_val() directly instead of taking
this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 drivers/soundwire/qcom.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 335424870290..d92f421d38c8 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -260,7 +260,6 @@ static int qcom_swrm_cpu_reg_write(struct qcom_swrm_ctrl *ctrl, int reg,
 static u32 swrm_get_packed_reg_val(u8 *cmd_id, u8 cmd_data,
                   u8 dev_addr, u16 reg_addr)
 {
-   u32 val;
    u8 id = *cmd_id;

    if (id != SWR_BROADCAST_CMD_ID) {
@@ -270,9 +269,8 @@ static u32 swrm_get_packed_reg_val(u8 *cmd_id, u8 cmd_data,
            id = 0;
        *cmd_id = id;
    }
-   val = SWRM_REG_VAL_PACK(cmd_data, dev_addr, id, reg_addr);

-   return val;
+   return SWRM_REG_VAL_PACK(cmd_data, dev_addr, id, reg_addr);
 }

 static int swrm_wait_for_rd_fifo_avail(struct qcom_swrm_ctrl *swrm)
--
2.15.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-02 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 14:08 [PATCH linux-next] soundwire: qcom: remove redundant ret variable zhang.songyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox