Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: use int type to store negative error codes

Merge series from Qianfeng Rong <rongqianfeng@vivo.com>:

The 'ret' variable usually is used to store returns from some functions,
which return either zero on success or negative error codes on failure.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but it's ugly as pants. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

Change "ret" from u32/unsigned int to int type. No effect on runtime.

+9 -6
+1 -1
sound/soc/amd/acp/acp-rembrandt.c
··· 147 147 { 148 148 struct device *dev = &pdev->dev; 149 149 struct acp_chip_info *chip; 150 - u32 ret; 150 + int ret; 151 151 152 152 chip = dev_get_platdata(&pdev->dev); 153 153 if (!chip || !chip->base) {
+2 -1
sound/soc/amd/raven/acp3x-i2s.c
··· 149 149 int cmd, struct snd_soc_dai *dai) 150 150 { 151 151 struct i2s_stream_instance *rtd; 152 - u32 ret, val, period_bytes, reg_val, ier_val, water_val; 152 + u32 val, period_bytes, reg_val, ier_val, water_val; 153 153 u32 buf_size, buf_reg; 154 + int ret; 154 155 155 156 rtd = substream->runtime->private_data; 156 157 period_bytes = frames_to_bytes(substream->runtime,
+2 -1
sound/soc/amd/vangogh/acp5x-i2s.c
··· 234 234 { 235 235 struct i2s_stream_instance *rtd; 236 236 struct i2s_dev_data *adata; 237 - u32 ret, val, period_bytes, reg_val, ier_val, water_val; 237 + u32 val, period_bytes, reg_val, ier_val, water_val; 238 238 u32 buf_size, buf_reg; 239 + int ret; 239 240 240 241 adata = snd_soc_dai_get_drvdata(dai); 241 242 rtd = substream->runtime->private_data;
+1 -1
sound/soc/codecs/adau1977.c
··· 795 795 struct adau1977 *adau1977 = snd_soc_component_get_drvdata(component); 796 796 unsigned int mask = 0; 797 797 unsigned int clk_src; 798 - unsigned int ret; 798 + int ret; 799 799 800 800 if (dir != SND_SOC_CLOCK_IN) 801 801 return -EINVAL;
+2 -1
sound/soc/qcom/lpass-cdc-dma.c
··· 217 217 { 218 218 struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream); 219 219 struct lpaif_dmactl *dmactl = NULL; 220 - unsigned int ret, regval; 220 + unsigned int regval; 221 221 unsigned int channels = params_channels(params); 222 + int ret; 222 223 int id; 223 224 224 225 switch (channels) {
+1 -1
sound/soc/qcom/lpass-hdmi.c
··· 23 23 snd_pcm_format_t format = params_format(params); 24 24 unsigned int rate = params_rate(params); 25 25 unsigned int channels = params_channels(params); 26 - unsigned int ret; 27 26 int bitwidth; 28 27 unsigned int word_length; 29 28 unsigned int ch_sts_buf0; ··· 32 33 unsigned int ch = 0; 33 34 struct lpass_dp_metadata_ctl *meta_ctl = drvdata->meta_ctl; 34 35 struct lpass_sstream_ctl *sstream_ctl = drvdata->sstream_ctl; 36 + int ret; 35 37 36 38 bitwidth = snd_pcm_format_width(format); 37 39 if (bitwidth < 0) {