All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 00/66] ALSA: Fix assignment in if condition
Date: Tue,  8 Jun 2021 16:04:34 +0200	[thread overview]
Message-ID: <20210608140540.17885-1-tiwai@suse.de> (raw)

Hi,

here is a largish patch set mostly for cleanup / a slight refactoring
of the coding styles with assignment in if condition, typically such
as:
	if ((err = xxx()) < 0)
		return err;

This was a popular style in the old ages, but nowadays it's seen
rather fairly harmful as it makes harder to read and easily hides
bugs.  Since we've hit quite a few issues (although most of them are
trivial), I decided to fix those lines.

While conversions, I spotted a couple of real bugs.  They are old
driver codes and only in certain error paths, so most likely no one
ever hits it.


Takashi

===

Takashi Iwai (66):
  ALSA: sb: Fix assignment in if condition
  ALSA: sb: Minor coding style fixes
  ALSA: sb: Fix potential double-free of CSP mixer elements
  ALSA: gus: Fix assignment in if condition
  ALSA: ad1816a: Fix assignment in if condition
  ALSA: wavefront: Fix assignment in if condition
  ALSA: cs423x:  Fix assignment in if condition
  ALSA: opti9xx: Fix assignment in if condition
  ALSA: opl3sa2: Fix assignment in if condition
  ALSA: es18xx: Fix assignment in if condition
  ALSA: cmi8330: Fix assignment in if condition
  ALSA: als100: Fix assignment in if condition
  ALSA: azt2320: Fix assignment in if condition
  ALSA: isa: Fix assignment in if condition
  ALSA: ad1889: Fix assignment in if condition
  ALSA: ak4531: Fix assignment in if condition
  ALSA: als300: Fix assignment in if condition
  ALSA: als4000: Fix assignment in if condition
  ALSA: atiixp: Fix assignment in if condition
  ALSA: azt3328: Fix assignment in if condition
  ALSA: bt87x: Fix assignment in if condition
  ALSA: cmipci: Fix assignment in if condition
  ALSA: cs4281: Fix assignment in if condition
  ALSA: ens137x: Fix assignment in if condition
  ALSA: es1938: Fix assignment in if condition
  ALSA: es1968: Fix assignment in if condition
  ALSA: fm801: Fix assignment in if condition
  ALSA: intel8x0: Fix assignment in if condition
  ALSA: maestro3: Fix assignment in if condition
  ALSA: rme32: Fix assignment in if condition
  ALSA: rme96: Fix assignment in if condition
  ALSA: sonicvibes: Fix assignment in if condition
  ALSA: via82xx: Fix assignment in if condition
  ALSA: ac97: Fix assignment in if condition
  ALSA: au88x0: Fix assignment in if condition
  ALSA: ca0106: Fix assignment in if condition
  ALSA: cs46xx: Fix assignment in if condition
  ALSA: cs5535audio: Fix assignment in if condition
  ALSA: echoaudio: Fix assignment in if condition
  ALSA: emu10k1: Fix assignment in if condition
  ALSA: emu10k1x: Fix assignment in if condition
  ALSA: ice1712: Fix assignment in if condition
  ALSA: korg1212: Fix assignment in if condition
  ALSA: mixart: Fix assignment in if condition
  ALSA: nm256: Fix assignment in if condition
  ALSA: pcxhr: Fix assignment in if condition
  ALSA: riptide: Fix assignment in if condition
  ALSA: hdsp: Fix assignment in if condition
  ALSA: rme9652: Fix assignment in if condition
  ALSA: trident: Fix assignment in if condition
  ALSA: vx222: Fix assignment in if condition
  ALSA: ymfpci: Fix assignment in if condition
  ALSA: core: Fix assignment in if condition
  ALSA: pcm: Fix assignment in if condition
  ALSA: oss: Fix assignment in if condition
  ALSA: seq: Fix assignment in if condition
  ALSA: pcmcia: Fix assignment in if condition
  ALSA: sparc: Fix assignment in if condition
  ALSA: mpu401: Fix assignment in if condition
  ALSA: vx: Fix assignment in if condition
  ALSA: opl3: Fix assignment in if condition
  ALSA: serial: Fix assignment in if condition
  ALSA: synth: Fix assignment in if condition
  ALSA: poewrmac: Fix assignment in if condition
  ALSA: i2c: Fix assignment in if condition
  ALSA: parisc: Fix assignment in if condition

 sound/core/hwdep.c                      |   6 +-
 sound/core/info_oss.c                   |   3 +-
 sound/core/init.c                       |  12 +-
 sound/core/oss/mixer_oss.c              |  45 +++--
 sound/core/oss/pcm_oss.c                |  70 +++++---
 sound/core/oss/pcm_plugin.c             |  26 +--
 sound/core/pcm_compat.c                 |   6 +-
 sound/core/pcm_misc.c                   |  12 +-
 sound/core/pcm_native.c                 |   6 +-
 sound/core/seq/oss/seq_oss.c            |  26 +--
 sound/core/seq/oss/seq_oss_init.c       |   9 +-
 sound/core/seq/oss/seq_oss_midi.c       |  33 ++--
 sound/core/seq/oss/seq_oss_rw.c         |   3 +-
 sound/core/seq/oss/seq_oss_synth.c      |   9 +-
 sound/core/seq/oss/seq_oss_writeq.c     |   3 +-
 sound/core/seq/seq_clientmgr.c          |  51 ++++--
 sound/core/seq/seq_dummy.c              |   3 +-
 sound/core/seq/seq_fifo.c               |   3 +-
 sound/core/seq/seq_memory.c             |   6 +-
 sound/core/seq/seq_midi.c               |  27 +--
 sound/core/seq/seq_queue.c              |  21 ++-
 sound/core/seq/seq_virmidi.c            |   9 +-
 sound/core/sound.c                      |   3 +-
 sound/core/sound_oss.c                  |   3 +-
 sound/drivers/mpu401/mpu401.c           |   9 +-
 sound/drivers/mpu401/mpu401_uart.c      |  19 +-
 sound/drivers/mtpav.c                   |  15 +-
 sound/drivers/mts64.c                   |  15 +-
 sound/drivers/opl3/opl3_lib.c           |  42 +++--
 sound/drivers/opl3/opl3_oss.c           |   6 +-
 sound/drivers/opl3/opl3_seq.c           |   9 +-
 sound/drivers/portman2x4.c              |  15 +-
 sound/drivers/serial-u16550.c           |  27 +--
 sound/drivers/vx/vx_core.c              |  60 ++++---
 sound/drivers/vx/vx_hwdep.c             |  12 +-
 sound/drivers/vx/vx_mixer.c             |  39 +++--
 sound/drivers/vx/vx_pcm.c               |  32 ++--
 sound/i2c/cs8427.c                      |  24 ++-
 sound/i2c/other/ak4114.c                |   3 +-
 sound/i2c/other/ak4117.c                |   3 +-
 sound/i2c/tea6330t.c                    |  24 ++-
 sound/isa/ad1816a/ad1816a.c             |  23 ++-
 sound/isa/ad1816a/ad1816a_lib.c         |  27 ++-
 sound/isa/als100.c                      |  18 +-
 sound/isa/azt2320.c                     |  21 ++-
 sound/isa/cmi8330.c                     |  37 ++--
 sound/isa/cs423x/cs4236.c               |  21 ++-
 sound/isa/cs423x/cs4236_lib.c           |  12 +-
 sound/isa/es1688/es1688_lib.c           |   3 +-
 sound/isa/es18xx.c                      |  51 ++++--
 sound/isa/gus/gus_main.c                |  18 +-
 sound/isa/gus/gus_mem.c                 |   3 +-
 sound/isa/gus/gus_mixer.c               |   6 +-
 sound/isa/gus/gus_pcm.c                 |  23 ++-
 sound/isa/gus/gus_uart.c                |   3 +-
 sound/isa/gus/gusclassic.c              |   6 +-
 sound/isa/gus/gusextreme.c              |   6 +-
 sound/isa/gus/gusmax.c                  |  36 ++--
 sound/isa/gus/interwave.c               |  90 ++++++----
 sound/isa/opl3sa2.c                     |  68 +++++---
 sound/isa/opti9xx/miro.c                |  27 ++-
 sound/isa/opti9xx/opti92x-ad1848.c      |  27 ++-
 sound/isa/sb/emu8000.c                  |  21 ++-
 sound/isa/sb/emu8000_patch.c            |   3 +-
 sound/isa/sb/emu8000_pcm.c              |   6 +-
 sound/isa/sb/sb16.c                     |  65 ++++---
 sound/isa/sb/sb16_csp.c                 |  29 ++--
 sound/isa/sb/sb16_main.c                |   6 +-
 sound/isa/sb/sb8.c                      |  38 ++--
 sound/isa/sb/sb8_main.c                 |   3 +-
 sound/isa/sb/sb8_midi.c                 |   3 +-
 sound/isa/sb/sb_common.c                |   9 +-
 sound/isa/sb/sb_mixer.c                 |  55 +++---
 sound/isa/wavefront/wavefront.c         |   6 +-
 sound/isa/wavefront/wavefront_midi.c    |  20 ++-
 sound/isa/wavefront/wavefront_synth.c   |  56 +++---
 sound/isa/wss/wss_lib.c                 |   9 +-
 sound/parisc/harmony.c                  |   7 +-
 sound/pci/ac97/ac97_codec.c             | 205 ++++++++++++++--------
 sound/pci/ac97/ac97_patch.c             | 137 ++++++++++-----
 sound/pci/ad1889.c                      |  15 +-
 sound/pci/ak4531_codec.c                |   9 +-
 sound/pci/als300.c                      |  22 ++-
 sound/pci/als4000.c                     |  55 +++---
 sound/pci/atiixp.c                      |  33 ++--
 sound/pci/atiixp_modem.c                |  40 +++--
 sound/pci/au88x0/au88x0.c               |  77 +++++----
 sound/pci/au88x0/au88x0_a3d.c           |  28 +--
 sound/pci/au88x0/au88x0_core.c          |  47 ++---
 sound/pci/au88x0/au88x0_eq.c            |  20 ++-
 sound/pci/au88x0/au88x0_mixer.c         |   3 +-
 sound/pci/au88x0/au88x0_mpu401.c        |  14 +-
 sound/pci/au88x0/au88x0_pcm.c           |  15 +-
 sound/pci/azt3328.c                     |   3 +-
 sound/pci/bt87x.c                       |   3 +-
 sound/pci/ca0106/ca0106_main.c          |  18 +-
 sound/pci/ca0106/ca_midi.c              |   3 +-
 sound/pci/cmipci.c                      |  83 ++++++---
 sound/pci/cs4281.c                      |  54 ++++--
 sound/pci/cs46xx/cs46xx.c               |  31 ++--
 sound/pci/cs46xx/cs46xx_lib.c           |  51 ++++--
 sound/pci/cs46xx/dsp_spos.c             |   3 +-
 sound/pci/cs5535audio/cs5535audio.c     |  28 +--
 sound/pci/cs5535audio/cs5535audio_pcm.c |  10 +-
 sound/pci/echoaudio/darla20_dsp.c       |   6 +-
 sound/pci/echoaudio/darla24_dsp.c       |   6 +-
 sound/pci/echoaudio/echo3g_dsp.c        |   3 +-
 sound/pci/echoaudio/echoaudio.c         | 220 ++++++++++++++----------
 sound/pci/echoaudio/echoaudio_dsp.c     |  12 +-
 sound/pci/echoaudio/echoaudio_gml.c     |   3 +-
 sound/pci/echoaudio/gina20_dsp.c        |   6 +-
 sound/pci/echoaudio/gina24_dsp.c        |   6 +-
 sound/pci/echoaudio/indigo_dsp.c        |   6 +-
 sound/pci/echoaudio/indigodj_dsp.c      |   6 +-
 sound/pci/echoaudio/indigoio_dsp.c      |   6 +-
 sound/pci/echoaudio/layla20_dsp.c       |   6 +-
 sound/pci/echoaudio/layla24_dsp.c       |   9 +-
 sound/pci/echoaudio/mia_dsp.c           |   6 +-
 sound/pci/echoaudio/midi.c              |   4 +-
 sound/pci/echoaudio/mona_dsp.c          |   6 +-
 sound/pci/emu10k1/emu10k1.c             |  42 +++--
 sound/pci/emu10k1/emu10k1_callback.c    |   3 +-
 sound/pci/emu10k1/emu10k1x.c            |  85 +++++----
 sound/pci/emu10k1/emufx.c               |  13 +-
 sound/pci/emu10k1/emumixer.c            |  78 ++++++---
 sound/pci/emu10k1/emumpu401.c           |  12 +-
 sound/pci/emu10k1/emupcm.c              |  24 ++-
 sound/pci/emu10k1/memory.c              |  21 ++-
 sound/pci/emu10k1/p16v.c                |  13 +-
 sound/pci/emu10k1/timer.c               |   3 +-
 sound/pci/ens1370.c                     |  45 +++--
 sound/pci/es1938.c                      |  42 +++--
 sound/pci/es1968.c                      |  75 ++++----
 sound/pci/fm801.c                       |  63 ++++---
 sound/pci/ice1712/delta.c               |   6 +-
 sound/pci/ice1712/ews.c                 |  24 ++-
 sound/pci/intel8x0.c                    |  46 +++--
 sound/pci/intel8x0m.c                   |  36 ++--
 sound/pci/korg1212/korg1212.c           |  24 ++-
 sound/pci/maestro3.c                    |  21 ++-
 sound/pci/mixart/mixart.c               |  29 ++--
 sound/pci/mixart/mixart_hwdep.c         |  17 +-
 sound/pci/mixart/mixart_mixer.c         |  33 ++--
 sound/pci/nm256/nm256.c                 |  27 ++-
 sound/pci/pcxhr/pcxhr.c                 |  22 ++-
 sound/pci/pcxhr/pcxhr_hwdep.c           |   9 +-
 sound/pci/riptide/riptide.c             |  88 ++++++----
 sound/pci/rme32.c                       |  76 +++++---
 sound/pci/rme96.c                       | 148 +++++++++-------
 sound/pci/rme9652/hdsp.c                | 121 ++++++++-----
 sound/pci/rme9652/rme9652.c             |  98 ++++++-----
 sound/pci/sonicvibes.c                  |  67 +++++---
 sound/pci/trident/trident.c             |  41 +++--
 sound/pci/trident/trident_main.c        |  84 ++++++---
 sound/pci/via82xx.c                     |  78 ++++++---
 sound/pci/via82xx_modem.c               |  52 ++++--
 sound/pci/vx222/vx222.c                 |  18 +-
 sound/pci/vx222/vx222_ops.c             |  12 +-
 sound/pci/ymfpci/ymfpci.c               |  71 ++++----
 sound/pci/ymfpci/ymfpci_main.c          |  72 +++++---
 sound/pcmcia/pdaudiocf/pdaudiocf.c      |   3 +-
 sound/pcmcia/vx/vxp_mixer.c             |   6 +-
 sound/pcmcia/vx/vxp_ops.c               |   6 +-
 sound/pcmcia/vx/vxpocket.c              |   3 +-
 sound/ppc/beep.c                        |   5 +-
 sound/ppc/daca.c                        |  24 ++-
 sound/ppc/keywest.c                     |   6 +-
 sound/ppc/pmac.c                        |   6 +-
 sound/ppc/powermac.c                    |  21 ++-
 sound/ppc/tumbler.c                     |  72 +++++---
 sound/sparc/amd7930.c                   |  14 +-
 sound/sparc/cs4231.c                    |  10 +-
 sound/sparc/dbri.c                      |  11 +-
 sound/synth/emux/emux.c                 |   3 +-
 sound/synth/emux/emux_effect.c          |  13 +-
 sound/synth/emux/emux_hwdep.c           |   6 +-
 sound/synth/emux/soundfont.c            |  40 +++--
 177 files changed, 3186 insertions(+), 1831 deletions(-)

-- 
2.26.2


             reply	other threads:[~2021-06-08 14:09 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 14:04 Takashi Iwai [this message]
2021-06-08 14:04 ` [PATCH 01/66] ALSA: sb: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 02/66] ALSA: sb: Minor coding style fixes Takashi Iwai
2021-06-08 14:04 ` [PATCH 03/66] ALSA: sb: Fix potential double-free of CSP mixer elements Takashi Iwai
2021-06-08 14:04 ` [PATCH 04/66] ALSA: gus: Fix assignment in if condition Takashi Iwai
2021-06-08 14:04 ` [PATCH 05/66] ALSA: ad1816a: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 06/66] ALSA: wavefront: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 07/66] ALSA: cs423x: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 08/66] ALSA: opti9xx: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 09/66] ALSA: opl3sa2: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 10/66] ALSA: es18xx: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 11/66] ALSA: cmi8330: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 12/66] ALSA: als100: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 13/66] ALSA: azt2320: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 14/66] ALSA: isa: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 15/66] ALSA: ad1889: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 16/66] ALSA: ak4531: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 17/66] ALSA: als300: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 18/66] ALSA: als4000: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 19/66] ALSA: atiixp: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 20/66] ALSA: azt3328: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 21/66] ALSA: bt87x: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 22/66] ALSA: cmipci: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 23/66] ALSA: cs4281: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 24/66] ALSA: ens137x: " Takashi Iwai
2021-06-08 14:04 ` [PATCH 25/66] ALSA: es1938: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 26/66] ALSA: es1968: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 27/66] ALSA: fm801: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 28/66] ALSA: intel8x0: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 29/66] ALSA: maestro3: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 30/66] ALSA: rme32: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 31/66] ALSA: rme96: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 32/66] ALSA: sonicvibes: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 33/66] ALSA: via82xx: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 34/66] ALSA: ac97: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 35/66] ALSA: au88x0: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 36/66] ALSA: ca0106: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 37/66] ALSA: cs46xx: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 38/66] ALSA: cs5535audio: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 39/66] ALSA: echoaudio: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 40/66] ALSA: emu10k1: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 41/66] ALSA: emu10k1x: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 42/66] ALSA: ice1712: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 43/66] ALSA: korg1212: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 44/66] ALSA: mixart: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 45/66] ALSA: nm256: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 46/66] ALSA: pcxhr: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 47/66] ALSA: riptide: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 48/66] ALSA: hdsp: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 49/66] ALSA: rme9652: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 50/66] ALSA: trident: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 51/66] ALSA: vx222: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 52/66] ALSA: ymfpci: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 53/66] ALSA: core: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 54/66] ALSA: pcm: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 55/66] ALSA: oss: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 56/66] ALSA: seq: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 57/66] ALSA: pcmcia: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 58/66] ALSA: sparc: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 59/66] ALSA: mpu401: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 60/66] ALSA: vx: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 61/66] ALSA: opl3: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 62/66] ALSA: serial: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 63/66] ALSA: synth: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 64/66] ALSA: poewrmac: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 65/66] ALSA: i2c: " Takashi Iwai
2021-06-08 14:05 ` [PATCH 66/66] ALSA: parisc: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608140540.17885-1-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --subject='Re: [PATCH 00/66] ALSA: Fix assignment in if condition' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.