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.
This commit is contained in:
@@ -147,7 +147,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct acp_chip_info *chip;
|
||||
u32 ret;
|
||||
int ret;
|
||||
|
||||
chip = dev_get_platdata(&pdev->dev);
|
||||
if (!chip || !chip->base) {
|
||||
|
||||
@@ -149,8 +149,9 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
|
||||
int cmd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct i2s_stream_instance *rtd;
|
||||
u32 ret, val, period_bytes, reg_val, ier_val, water_val;
|
||||
u32 val, period_bytes, reg_val, ier_val, water_val;
|
||||
u32 buf_size, buf_reg;
|
||||
int ret;
|
||||
|
||||
rtd = substream->runtime->private_data;
|
||||
period_bytes = frames_to_bytes(substream->runtime,
|
||||
|
||||
@@ -234,8 +234,9 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct i2s_stream_instance *rtd;
|
||||
struct i2s_dev_data *adata;
|
||||
u32 ret, val, period_bytes, reg_val, ier_val, water_val;
|
||||
u32 val, period_bytes, reg_val, ier_val, water_val;
|
||||
u32 buf_size, buf_reg;
|
||||
int ret;
|
||||
|
||||
adata = snd_soc_dai_get_drvdata(dai);
|
||||
rtd = substream->runtime->private_data;
|
||||
|
||||
@@ -795,7 +795,7 @@ static int adau1977_set_sysclk(struct snd_soc_component *component,
|
||||
struct adau1977 *adau1977 = snd_soc_component_get_drvdata(component);
|
||||
unsigned int mask = 0;
|
||||
unsigned int clk_src;
|
||||
unsigned int ret;
|
||||
int ret;
|
||||
|
||||
if (dir != SND_SOC_CLOCK_IN)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -217,8 +217,9 @@ static int lpass_cdc_dma_daiops_hw_params(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct lpaif_dmactl *dmactl = NULL;
|
||||
unsigned int ret, regval;
|
||||
unsigned int regval;
|
||||
unsigned int channels = params_channels(params);
|
||||
int ret;
|
||||
int id;
|
||||
|
||||
switch (channels) {
|
||||
|
||||
@@ -23,7 +23,6 @@ static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream,
|
||||
snd_pcm_format_t format = params_format(params);
|
||||
unsigned int rate = params_rate(params);
|
||||
unsigned int channels = params_channels(params);
|
||||
unsigned int ret;
|
||||
int bitwidth;
|
||||
unsigned int word_length;
|
||||
unsigned int ch_sts_buf0;
|
||||
@@ -33,6 +32,7 @@ static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream,
|
||||
unsigned int ch = 0;
|
||||
struct lpass_dp_metadata_ctl *meta_ctl = drvdata->meta_ctl;
|
||||
struct lpass_sstream_ctl *sstream_ctl = drvdata->sstream_ctl;
|
||||
int ret;
|
||||
|
||||
bitwidth = snd_pcm_format_width(format);
|
||||
if (bitwidth < 0) {
|
||||
|
||||
Reference in New Issue
Block a user