[PATCH 0/3] ASoC: use int type to store negative error codes

Qianfeng Rong posted 3 patches 1 month ago
sound/soc/amd/acp/acp-rembrandt.c | 2 +-
sound/soc/amd/raven/acp3x-i2s.c   | 3 ++-
sound/soc/amd/vangogh/acp5x-i2s.c | 3 ++-
sound/soc/codecs/adau1977.c       | 2 +-
sound/soc/qcom/lpass-cdc-dma.c    | 3 ++-
sound/soc/qcom/lpass-hdmi.c       | 2 +-
6 files changed, 9 insertions(+), 6 deletions(-)
[PATCH 0/3] ASoC: use int type to store negative error codes
Posted by Qianfeng Rong 1 month ago
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.

Qianfeng Rong (3):
  ASoC: amd: use int type to store negative error codes
  ASoC: adau1977: use int type to store negative error codes
  ASoC: qcom: use int type to store negative error codes

 sound/soc/amd/acp/acp-rembrandt.c | 2 +-
 sound/soc/amd/raven/acp3x-i2s.c   | 3 ++-
 sound/soc/amd/vangogh/acp5x-i2s.c | 3 ++-
 sound/soc/codecs/adau1977.c       | 2 +-
 sound/soc/qcom/lpass-cdc-dma.c    | 3 ++-
 sound/soc/qcom/lpass-hdmi.c       | 2 +-
 6 files changed, 9 insertions(+), 6 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] ASoC: use int type to store negative error codes
Posted by Mark Brown 1 month ago
On Thu, 28 Aug 2025 15:53:56 +0800, Qianfeng Rong wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: amd: use int type to store negative error codes
      commit: d985b60f47893e8fd43989662111bebe78311cd1
[2/3] ASoC: adau1977: use int type to store negative error codes
      commit: 784771cdd77091e7e93b78b5de55006295cc7b8e
[3/3] ASoC: qcom: use int type to store negative error codes
      commit: 11f5c5f9e43e9020bae452232983fe98e7abfce0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark