summaryrefslogtreecommitdiffstats
path: root/sound/isa
AgeCommit message (Collapse)AuthorFilesLines
2021-10-26ALSA: gus: fix null pointer dereference on pointer blockChengfeng Ye1-0/+2
The pointer block return from snd_gf1_dma_next_block could be null, so there is a potential null pointer dereference issue. Fix this by adding a null check before dereference. Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk> Link: https://lore.kernel.org/r/20211024104611.9919-1-cyeaa@connect.ust.hk Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-17ALSA: ISA: not for M68KRandy Dunlap1-1/+1
On m68k, compiling drivers under SND_ISA causes build errors: ../sound/core/isadma.c: In function 'snd_dma_program': ../sound/core/isadma.c:33:17: error: implicit declaration of function 'claim_dma_lock' [-Werror=implicit-function-declaration] 33 | flags = claim_dma_lock(); | ^~~~~~~~~~~~~~ ../sound/core/isadma.c:41:9: error: implicit declaration of function 'release_dma_lock' [-Werror=implicit-function-declaration] 41 | release_dma_lock(flags); | ^~~~~~~~~~~~~~~~ ../sound/isa/sb/sb16_main.c: In function 'snd_sb16_playback_prepare': ../sound/isa/sb/sb16_main.c:253:72: error: 'DMA_AUTOINIT' undeclared (first use in this function) 253 | snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); | ^~~~~~~~~~~~ ../sound/isa/sb/sb16_main.c:253:72: note: each undeclared identifier is reported only once for each function it appears in ../sound/isa/sb/sb16_main.c: In function 'snd_sb16_capture_prepare': ../sound/isa/sb/sb16_main.c:322:71: error: 'DMA_AUTOINIT' undeclared (first use in this function) 322 | snd_dma_program(dma, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); | ^~~~~~~~~~~~ and more... Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: linux-m68k@lists.linux-m68k.org Cc: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20211016062602.3588-1-rdunlap@infradead.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-07ALSA: gus: Fix repeated probe for ISA interwave cardTakashi Iwai1-30/+31
The legacy ISA probe tries to probe the card repeatedly, and this would conflict with the refactoring using devres. Put the card creation out of the loop and only probe GUS object repeatedly. Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20210907093930.29009-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-07ALSA: gus: Fix repeated probes of snd_gus_create()Takashi Iwai1-13/+31
GUS card object may be repeatedly probed for the legacy ISA devices, and the behavior doesn't fit with the devres resource management. Revert partially back to the classical way for the snd_gus_card object, so that the repeated calls of snd_gus_create() are allowed. Fixes: 5b88da3c800f ("ALSA: gus: Allocate resources with device-managed APIs") Reported-by: kernel test robot <oliver.sang@intel.com> Link: https://lore.kernel.org/r/20210907093930.29009-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-09ALSA: msnd: Use proper mmap methodTakashi Iwai1-2/+6
The old ISA MSND driver basically maps the iomem as the DMA buffer. For this type of buffer, we have already the standard mmap helper, snd_pcm_lib_mmap_iomem(). Correct the PCM info, set the DMA address and use the standard helper for handling the mmap on all architectures properly. Link: https://lore.kernel.org/r/20210809140532.11006-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-05ALSA: es1688: Avoid devres management for es1688 object creationTakashi Iwai1-9/+20
The recent refactoring of es1688 object creation with the use of devres caused a problem with the non-PnP probe of GUS driver, as it tries to probe multiple times with different parameters That is, this object needs the immediate resource release and the devres doesn't fit for it. This patch reverts partially the commit for restoring the classic resource management for es1688 object. Fixes: 1bb11c1c7f6e ("ALSA: es1688: Allocate resources with device-managed APIs") Reported-by: kernel test robot <oliver.sang@intel.com> Link: https://lore.kernel.org/r/20210805032513.GA30485@xsang-OptiPlex-9020 Link: https://lore.kernel.org/r/20210805062148.30951-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-02Merge branch 'for-linus' into for-nextTakashi Iwai1-0/+4
2021-07-21ALSA: sc6000: Use explicit cast for __iomem pointerTakashi Iwai1-2/+2
The recent optimization to store an iomem pointer in card's private_data field caused sparse warnings. Although they are practically harmless, add the explicit cast for avoiding the spurious warnings. Fixes: 9b7843d1e125 ("ALSA: sc6000: Assign vport directly on card's private_data") Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/202107210511.SnFqlZMa-lkp@intel.com Link: https://lore.kernel.org/r/20210720224902.7169-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-20ALSA: sc6000: Assign vport directly on card's private_dataTakashi Iwai1-10/+9
sc6000 driver tries to allocate an extra pointer for keeping the vport address and point it over card->private_data. But, this indirect access is utterly superfluous, and we can keep the vport address directly in card->private_data instead. This will simply the code and avoid confusion. Link: https://lore.kernel.org/r/20210720162837.6026-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-20ALSA: sc6000: Fix incorrect sizeof operatorColin Ian King1-1/+1
Static analysis is warning that the sizeof being used is should be of *vport and not vport. Although these are the same size it is not a portable assumption to assume this is true for all cases. Fix this by using sizeof(*vport). Addresses-Coverity: ("Sizeof not portable") Fixes: 111601ff76e9 ("ALSA: sc6000: Allocate resources with device-managed APIs") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210720161707.74197-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-20ALSA: opti9xx: fix missing { } around an if blockColin Ian King1-1/+2
Currently the { } braces are missing around an if block causing subsequent code after the return to become unreachable. Fix this by adding the missing { }. Addresses-Coverity: ("Structurally dead code") Fixes: 2973ee4a5b54 ("ALSA: opti9xx: Allocate resources with device-managed APIs") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210720153741.73230-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: wavefront: Allocate resources with device-managed APIsTakashi Iwai1-37/+9
This patch converts the resource management in ISA wavefront driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-72-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: sscape: Allocate resources with device-managed APIsTakashi Iwai1-72/+20
This patch converts the resource management in ISA sscape driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-71-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: sc6000: Allocate resources with device-managed APIsTakashi Iwai1-47/+26
This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The cleanup code was moved from the remove callback to card->private_free, and then the remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-70-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: opl3sa2: Allocate resources with device-managed APIsTakashi Iwai1-49/+11
This patch converts the resource management in ISA opl3sa2 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-69-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: opti9xx: Allocate resources with device-managed APIsTakashi Iwai2-112/+44
This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-68-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: msnd: Allocate resources with device-managed APIsTakashi Iwai1-91/+28
This patch converts the resource management in ISA msnd drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-67-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: gus: Allocate resources with device-managed APIsTakashi Iwai5-161/+68
This patch converts the resource management in ISA gus drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-66-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: galaxy: Allocate resources with device-managed APIsTakashi Iwai1-49/+33
This patch converts the resource management in ISA galaxy drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-65-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: es18xx: Allocate resources with device-managed APIsTakashi Iwai1-92/+20
This patch converts the resource management in ISA es18xx driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-64-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: es1688: Allocate resources with device-managed APIsTakashi Iwai2-44/+18
This patch converts the resource management in ISA es1688 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-63-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: cs423x: Allocate resources with device-managed APIsTakashi Iwai2-60/+13
This patch converts the resource management in ISA cs423x drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-62-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: cmi8330: Allocate resources with device-managed APIsTakashi Iwai1-23/+4
This patch converts the resource management in ISA cmi8330 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-61-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: cmi8328: Allocate resources with device-managed APIsTakashi Iwai1-21/+10
This patch converts the resource management in ISA cmi8328 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-60-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: azt2320: Allocate resources with device-managed APIsTakashi Iwai1-37/+12
This patch converts the resource management in ISA azt2320 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-59-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: als100: Allocate resources with device-managed APIsTakashi Iwai1-31/+10
This patch converts the resource management in ISA als100 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-58-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: adlib: Allocate resources with device-managed APIsTakashi Iwai1-22/+6
This patch converts the resource management in ISA adlib driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-57-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: ad1848: Allocate resources with device-managed APIsTakashi Iwai1-14/+5
This patch converts the resource management in ISA ad1848 driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. The remove callback became superfluous and dropped. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-56-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: sb: Allocate resources with device-managed APIsTakashi Iwai5-189/+52
This patch converts the resource management in ISA sb drivers with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-55-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: wss: Allocate resources with device-managed APIsTakashi Iwai2-58/+11
This patch converts the resource management in ISA wss driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper. Since the whole destructor code could be removed by the conversion, the lowlevel snd_device was dropped as well. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-54-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-19ALSA: ad1816a: Allocate resources with device-managed APIsTakashi Iwai2-74/+16
This patch converts the resource management in ISA ad1816a driver with devres as a clean up. Each manual resource management is converted with the corresponding devres helper, and the card object release is managed now via card->private_free instead of a lowlevel snd_device. This should give no user-visible functional changes. Link: https://lore.kernel.org/r/20210715075941.23332-53-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-17ALSA: sb: Fix potential ABBA deadlock in CSP driverTakashi Iwai1-0/+4
SB16 CSP driver may hit potentially a typical ABBA deadlock in two code paths: In snd_sb_csp_stop(): spin_lock_irqsave(&p->chip->mixer_lock, flags); spin_lock(&p->chip->reg_lock); In snd_sb_csp_load(): spin_lock_irqsave(&p->chip->reg_lock, flags); spin_lock(&p->chip->mixer_lock); Also the similar pattern is seen in snd_sb_csp_start(). Although the practical impact is very small (those states aren't triggered in the same running state and this happens only on a real hardware, decades old ISA sound boards -- which must be very difficult to find nowadays), it's a real scenario and has to be fixed. This patch addresses those deadlocks by splitting the locks in snd_sb_csp_start() and snd_sb_csp_stop() for avoiding the nested locks. Reported-by: Jia-Ju Bai <baijiaju1990@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/7b0fcdaf-cd4f-4728-2eae-48c151a92e10@gmail.com Link: https://lore.kernel.org/r/20210716132723.13216-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-07ALSA: isa: Fix error return code in snd_cmi8330_probe()Zhen Lei1-1/+1
When 'SB_HW_16' check fails, the error code -ENODEV instead of 0 should be returned, which is the same as that returned when 'WSS_HW_CMI8330' check fails. Fixes: 43bcd973d6d0 ("[ALSA] Add snd_card_set_generic_dev() call to ISA drivers") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/20210707074051.2663-1-thunder.leizhen@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-24Merge tag 'asoc-fix-v5.13-rc7' of ↵Takashi Iwai3-23/+10
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Fixes for v5.13 A final batch of fixes for v5.13, this is larger than I'd like due to the fixes for a series of suspend issues that Intel turned up in their testing this week.
2021-06-09ALSA: isa: Fix assignment in if conditionTakashi Iwai2-4/+8
ISA ES1688 and WSS driver code contains a few assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-15-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: azt2320: Fix assignment in if conditionTakashi Iwai1-7/+14
ISA AZT2320 driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: als100: Fix assignment in if conditionTakashi Iwai1-6/+12
ISA ALS100 driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-13-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: cmi8330: Fix assignment in if conditionTakashi Iwai1-14/+23
ISA CMI8330 driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-12-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: es18xx: Fix assignment in if conditionTakashi Iwai1-17/+34
ISA ES18xx driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-11-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: opl3sa2: Fix assignment in if conditionTakashi Iwai1-24/+44
ISA OPL3SA2 driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: opti9xx: Fix assignment in if conditionTakashi Iwai2-18/+36
ISA Opti9xx driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: cs423x: Fix assignment in if conditionTakashi Iwai2-11/+22
ISA CS423x driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: wavefront: Fix assignment in if conditionTakashi Iwai3-32/+50
ISA WaveFront driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-7-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: ad1816a: Fix assignment in if conditionTakashi Iwai2-18/+32
ISA AD1816A driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: gus: Fix assignment in if conditionTakashi Iwai9-67/+124
ISA GUS driver code contains lots of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes, no functional changes. Link: https://lore.kernel.org/r/20210608140540.17885-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: sb: Fix potential double-free of CSP mixer elementsTakashi Iwai1-2/+6
snd_sb_qsound_destroy() contains the calls of removing the previously created mixer controls, but it doesn't clear the pointers. As snd_sb_qsound_destroy() itself may be repeatedly called via ioctl, this could lead to double-free potentially. Fix it by clearing the struct fields properly afterwards. Link: https://lore.kernel.org/r/20210608140540.17885-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: sb: Minor coding style fixesTakashi Iwai2-15/+14
The handling of snd_ctl_new1() and snd_ctl_add() can be sometimes tricky, as snd_ctl_add() automatically removes the passed object at its error path. The recent fix addressed an overlooked issue that is relevant with that in SB driver code, and it can be a bit more simplified by assigning to a temporary variable, i.e. storing to the struct field only after the creation succeeds. Link: https://lore.kernel.org/r/20210608140540.17885-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: sb: Fix assignment in if conditionTakashi Iwai11-89/+130
A lot of code for SB drivers is in a legacy style with assignment in if condition. This also made harder to catch some bugs (e.g. the commit 1c98f574403d "ALSA: emu8000: Fix a use after free in snd_emu8000_create_mixer"). This patch fixes the coding style. All are rather simple conversions and there should be no functional changes. (The changes in snd_emu8000_new() for hw->res_port1, 2 and 3 are slightly different from the older ones, but this shouldn't matter much in practice.) Link: https://lore.kernel.org/r/20210608140540.17885-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-05-14ALSA: gus: Replace unsafe strcpy() with strscpy()YueHaibing1-1/+1
Fix smatch warning: sound/isa/gus/gus_main.c:396 snd_gus_check_version() error: strcpy() 'card->longname' too large for 'card->shortname' (80 vs 32) Even if this is not a real bug since the longest length of card->longname now is 31, replace strcpy() with strscpy() in order to avoid possible future mistake. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210514070507.16600-1-yuehaibing@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-05-13ALSA: sb8: Add a comment note regarding an unused pointerAtul Gopinathan1-1/+5
The field "fm_res" of "struct snd_sb8" is never used/dereferenced throughout the sb8.c code. Therefore there is no need for any null value check after the "request_region()". Add a comment note to make developers know about this and prevent any "NULL check" patches on this part of code. Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com> Link: https://lore.kernel.org/r/20210503115736.2104747-36-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>