summaryrefslogtreecommitdiff
path: root/sound/soc/sof/control.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>2020-09-17 13:56:30 +0300
committerMark Brown <broonie@kernel.org>2020-09-17 15:53:19 +0100
commitb9f8e1387cf0c9911b26c9d1fca84605d923de66 (patch)
tree553ed45b56a8658cec1f11f01435b8af059105a9 /sound/soc/sof/control.c
parent99ceec5ca0cb29e3b1d556d108ddc54654377792 (diff)
ASoC: SOF: (cosmetic) remove redundant "ret" variable uses
In some cases no "ret" variable is even needed, those functions always return 0 anyway, in other cases "ret" initialisation is redundant. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/control.c')
-rw-r--r--sound/soc/sof/control.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c
index 5419c93badd2..63ead9ebc4c6 100644
--- a/sound/soc/sof/control.c
+++ b/sound/soc/sof/control.c
@@ -221,7 +221,6 @@ int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
struct sof_ipc_ctrl_data *cdata = scontrol->control_data;
struct sof_abi_hdr *data = cdata->data;
size_t size;
- int ret = 0;
if (be->max > sizeof(ucontrol->value.bytes.data)) {
dev_err_ratelimited(scomp->dev,
@@ -235,15 +234,13 @@ int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
dev_err_ratelimited(scomp->dev,
"error: DSP sent %zu bytes max is %d\n",
size, be->max);
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
/* copy back to kcontrol */
memcpy(ucontrol->value.bytes.data, data, size);
-out:
- return ret;
+ return 0;
}
int snd_sof_bytes_put(struct snd_kcontrol *kcontrol,
@@ -424,7 +421,6 @@ int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_tlv __user *tlvd =
(struct snd_ctl_tlv __user *)binary_data;
int data_size;
- int ret = 0;
/*
* Decrement the limit by ext bytes header size to
@@ -443,20 +439,16 @@ int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
if (data_size > be->max) {
dev_err_ratelimited(scomp->dev, "error: user data size %d exceeds max size %d.\n",
data_size, be->max);
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
header.numid = scontrol->cmd;
header.length = data_size;
- if (copy_to_user(tlvd, &header, sizeof(const struct snd_ctl_tlv))) {
- ret = -EFAULT;
- goto out;
- }
+ if (copy_to_user(tlvd, &header, sizeof(const struct snd_ctl_tlv)))
+ return -EFAULT;
if (copy_to_user(tlvd->tlv, cdata->data, data_size))
- ret = -EFAULT;
+ return -EFAULT;
-out:
- return ret;
+ return 0;
}