summaryrefslogtreecommitdiff
path: root/sound/pci/rme9652
AgeCommit message (Collapse)Author
2017-10-26ALSA: Convert timers to use timer_setup()Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. These are all the "mechanical" changes remaining in the sound subsystem. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-09-07ALSA: hdspm: Use common error handling code in snd_hdspm_probe()Markus Elfring
Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-09-07ALSA: rme9652: Use common code in hdsp_get_iobox_version()Markus Elfring
Add a jump target so that a bit of common code can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-15ALSA: rme9652: Use common error handling code in two functionsMarkus Elfring
Add a jump target so that a bit of exception handling can be better reused in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12ALSA: rme9652: make snd_pcm_hardware constBhumika Goyal
Make these const as they are only used during a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12ALSA: rme9652: Adjust seven checks for null pointersMarkus Elfring
The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12ALSA: rme9652: Improve eight size determinationsMarkus Elfring
Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12ALSA: rme9652: Delete an error message for a failed memory allocation in ↵Markus Elfring
snd_hdspm_create() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-07-18ALSA: rme9652: fix format overflow warningsArnd Bergmann
gcc-7 warns about a possible sprintf format string overflow with a temporary buffer that is used to print from another buffer of the same size: sound/pci/rme9652/hdspm.c: In function 'snd_hdspm_create_alsa_devices': sound/pci/rme9652/hdspm.c:2123:17: error: ' MIDIoverMADI' directive writing 13 bytes into a region of size between 1 and 32 [-Werror=format-overflow=] This extends the temporary buffer to twice the size, and changes the code to use the safer snprintf() across the entire file. The longer buffer is still necessary to avoid a format-truncation warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-09ALSA: rme9652: Constify hw_constraintsTakashi Iwai
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-09ALSA: hdspm: Constify hw_constraintsTakashi Iwai
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-09ALSA: hdsp: Constify hw_constraintsTakashi Iwai
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02ALSA: hdsp: Convert to the new PCM opsTakashi Iwai
Replace the copy and the silence ops with the new PCM ops. The conversion is straightforward with standard helper functions. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02ALSA: rme9652: Convert to the new PCM opsTakashi Iwai
Replace the copy and the silence ops with the new PCM ops. The conversion is straightforward with standard helper functions. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12ALSA: pci: Constify snd_rawmidi_opsTakashi Iwai
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02ALSA: constify snd_pcm_ops structuresJulia Lawall
Check for snd_pcm_ops structures that are only stored in the ops field of a snd_soc_platform_driver structure or passed as the third argument to snd_pcm_set_ops. The corresponding field or parameter is declared const, so snd_pcm_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_pcm_ops i@p = { ... }; @ok1@ identifier r.i; struct snd_soc_platform_driver e; position p; @@ e.ops = &i@p; @ok2@ identifier r.i; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22ALSA: hdspm: fix spelling mistake "Externel" -> "External"Colin Ian King
Trivial fix to spelling mistake in dev_warn message. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-29ALSA: hdsp: Fix wrong boolean ctl value accessesTakashi Iwai
snd-hdsp driver accesses enum item values (int) instead of boolean values (long) wrongly for some ctl elements. This patch fixes them. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-29ALSA: hdspm: Fix zero-divisionTakashi Iwai
HDSPM driver contains a code issuing zero-division potentially in system sample rate ctl code. This patch fixes it by not processing a zero or invalid rate value as a divisor, as well as excluding the invalid value to be passed via the given ctl element. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-29ALSA: hdspm: Fix wrong boolean ctl value accessesTakashi Iwai
snd-hdspm driver accesses enum item values (int) instead of boolean values (long) wrongly for some ctl elements. This patch fixes them. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-23Merge branch 'topic/hw-constraint-single' into for-nextTakashi Iwai
2015-10-21ALSA: rme9652: Use snd_pcm_hw_constraint_single()Lars-Peter Clausen
Use the new snd_pcm_hw_constraint_single() helper function instead of calling snd_pcm_hw_constraint_minmax() with the same value for min and max to install a constraint that limits the possible configuration values to a single value. Using snd_pcm_hw_constraint_single() makes the indented result clearer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-11ALSA: hdsp: fix memory leakSudip Mukherjee
If the size of the firmware is less than expected size then we are exiting with the error code but we missed releasing the firmware. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-22ALSA: hdsp: silence a sprinft() overflow warningDan Carpenter
card->shortname is a 32 char string so the sprintf() can theoretically overflow. snd_rawmidi_new() can accept strings up to 64 bytes long. I have made the temporay buf[] array 40 bytes long and changed the sprintf() to snprintf(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-21ALSA: hdsp: silence and underflow warningDan Carpenter
I believe this probably cannot happen, as the code suggests. There would have to be an kcontrol->index.id which was zero, otherwise this would be prevented in snd_ctl_find_id(). But snd_BUG_ON() is just a WARN() or a no-op so static checkers complain that we keep on going with a negative offset. Let's just handle the error as well as printing a warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17ALSA: hdspm - DRY cleanup of snd_pcm_opsAdrian Knoth
This commit removes code duplication between snd_hdspm_{capture,playback}_ops. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17ALSA: hdspm - DRY cleanup in .release callbackAdrian Knoth
This commit removes code duplication between snd_hdspm_{capture,playback}_release. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17ALSA: hdspm - DRY cleanup in .open callbacksAdrian Knoth
This commit removes code duplication between snd_hdspm_{capture,playback}_open. No semantic changes intended, this is purely cosmetic. Signed-off-by: Adrian Knoth <aknoth@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-13ALSA: hdspm - Constrain periods to 2 on older cardsAdrian Knoth
RME RayDAT and AIO use a fixed buffer size of 16384 samples. With period sizes of 32-4096, this translates to 4-512 periods. The older RME cards have a variable buffer size but require exactly two periods. This patch enforces nperiods=2 on those cards. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Cc: <stable@vger.kernel.org> # 2.6.39+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: Include linux/io.h instead of asm/io.hTakashi Iwai
Nowadays it's recommended. Replace all in a shot. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19ALSA: hdspm: Use setup_timer() and mod_timer()Takashi Iwai
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19ALSA: hdsp: Use setup_timer() and mod_timer()Takashi Iwai
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-04ALSA: Deletion of checks before the function call "iounmap"Markus Elfring
The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-17ALSA: hdsp: Deletion of an unnecessary check before the function call ↵Markus Elfring
"release_firmware" The release_firmware() function tests whether its argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-11ALSA: Fix invalid kerneldoc markersTakashi Iwai
They are no real kerneldoc comments, so drop such markers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-29ALSA: hdspm: remove unused variableSudip Mukherjee
removed the unused variables. These variables were only being assigned some value, but the values were never being used. it has been build tested after removing the variables. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21ALSA: rme9652: Use snd_ctl_enum_info()Takashi Iwai
... and reduce the open codes. Also add missing const to text arrays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21ALSA: hdspm: Use snd_ctl_enum_info()Takashi Iwai
... and reduce the open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21ALSA: hdsp: Use snd_ctl_enum_info()Takashi Iwai
... and reduce the open codes. Also add missing const to text arrays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-02-26ALSA: rme9652: Use standard printk helpersTakashi Iwai
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26ALSA: hdspm: Use standard printk helpersTakashi Iwai
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26ALSA: hdsp: Use standard printk helpersTakashi Iwai
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12ALSA: pci: Convert to snd_card_new() with a device pointerTakashi Iwai
Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09ALSA: Remove memory reservation code from memalloc helperTakashi Iwai
Nowadays we have CMA for obtaining the contiguous memory pages efficiently. Let's kill the old kludge for reserving the memory pages for large buffers. It was rarely useful (only for preserving pages among module reloading or a little help by an early boot scripting), used only by a couple of drivers, and yet it gives too much ugliness than its benefit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-05ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]Takashi Iwai
The lack of comma leads to the wrong channel for an SPDIF channel. Unfortunately this wasn't caught by compiler because it's still a valid expression. Reported-by: Alexander Aristov <aristov.alexander@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29ALSA: Use strlcpy() instead of strncpy()Takashi Iwai
We tend to make stupid mistakes with strncpy(). Let's take a safer one, strlcpy(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-25Merge tag 'asoc-v3.13' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.13 - Further work on the dmaengine helpers, including support for configuring the parameters for DMA by reading the capabilities of the DMA controller which removes some guesswork and magic numbers fromm drivers. - A refresh of the documentation. - Conversions of many drivers to direct regmap API usage in order to allow the ASoC level register I/O code to be removed, this will hopefully be completed by v3.14. - Support for using async register I/O in DAPM, reducing the time taken to implement power transitions on systems that support it.
2013-10-16ALSA: hdsp - info leak in snd_hdsp_hwdep_ioctl()Dan Carpenter
In GCC the sizeof(hdsp_version) is 8 because there is a 2 byte hole at the end of the struct after ->firmware_rev. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-13ALSA: rme9652: Remove redundant breakSachin Kamat
'break' after return statement is not necessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>