aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-11-06ALSA: rme: Avoid non-standard macro usageTakashi Iwai3-13/+3
Pass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability. Along with it, drop the unnecessary assignment before the snd_dma_alloc_pages() call and simplify by returning the error code directly. Link: https://lore.kernel.org/r/20191105151856.10785-23-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-11-06ALSA: pci: Drop superfluous snd_pcm_sgbuf_ops_pageTakashi Iwai1-1/+0
snd_pcm_sgbuf_ops_page is no longer needed to be set explicitly to PCM page ops since the recent change in the PCM core (*). Leaving it NULL should work as long as the preallocation has been done properly. This patch drops the redundant lines. (*) 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Link: https://lore.kernel.org/r/20191105151856.10785-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-15ALSA: rme9652: Unneeded variable: "result".Hariprasad Kelam1-2/+1
This patch fixes below issue reported by coccicheck sound/pci/rme9652/rme9652.c:2161:5-11: Unneeded variable: "result". Return "0" on line 2167 Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-08Merge tag 'asoc-v5.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai3-45/+3
ASoC: Updates for v5.3 This is a very big update, mainly thanks to Morimoto-san's refactoring work and some fairly large new drivers. - Lots more work on moving towards a component based framework from Morimoto-san. - Support for force disconnecting muxes from Jerome Brunet. - New drivers for Cirrus Logic CS47L35, CS47L85 and CS47L90, Conexant CX2072X, Realtek RT1011 and RT1308. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner3-45/+3
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-24ALSA: hdspm: Fix single speed ADAT capture and playback with RME HDSPe AIOPhilippe Bekaert1-25/+36
By taking into account the mapping from logical to DMA channels when enabling or disabling audio channels, ADAT channels 3 to 8 on the RME HDSPe AIO card are now correctly captured and played back in single speed mode. Since the mapping is an identity mapping for all cards except AIO and RayDAT, only those cards should be affected by this patch. It was tested on an AIO card. The patch needs testing on other cards, in particular RayDAT. Note: this patch does not solve ADAT capture and playback issues in double or triple speed mode. That seems to be another problem. Signed-off-by: Philippe Bekaert <Philippe.Bekaert@panokkel.be> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-08Merge branch 'topic/memory-device-fixes-2' into for-nextTakashi Iwai1-16/+4
Pull further device memory allocation cleanups (but no API change yet). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-06ALSA: pci: Clean up with new procfs helpersTakashi Iwai3-40/+26
Simplify the proc fs creation code with new helper functions, snd_card_ro_proc_new() and snd_card_rw_proc_new(). Just a code refactoring and no functional changes. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-06ALSA: pci: Drop superfluous PCM preallocation error checksTakashi Iwai1-16/+4
snd_pcm_lib_preallocate_pages() and co always succeed, so the error check is simply redundant. Drop it. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-12-19ALSA: rme9652: Fix potential Spectre v1 vulnerabilityGustavo A. R. Silva1-4/+6
info->channel is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: sound/pci/rme9652/hdsp.c:4100 snd_hdsp_channel_info() warn: potential spectre issue 'hdsp->channel_map' [r] (local cap) Fix this by sanitizing info->channel before using it to index hdsp->channel_map Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. Also, notice that I refactored the code a bit in order to get rid of the following checkpatch warning: ERROR: do not use assignment in if condition FILE: sound/pci/rme9652/hdsp.c:4103: if ((mapped_channel = hdsp->channel_map[info->channel]) < 0) [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-27ALSA: hdspm: fix spelling mistake "Initializeing" -> "Initializing"Colin Ian King1-1/+1
Trivial fix to spelling mistake in dev_dbg message and also remove extraneous white space and repeated question marks. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25ALSA: rme9652: Hardening for potential Spectre v1Takashi Iwai1-2/+4
As recently Smatch suggested, one place in RME9652 driver may expand the array directly from the user-space value with speculation: sound/pci/rme9652/rme9652.c:2074 snd_rme9652_channel_info() warn: potential spectre issue 'rme9652->channel_map' (local cap) This patch puts array_index_nospec() for hardening against it. BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2 Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25ALSA: hdspm: Hardening for potential Spectre v1Takashi Iwai1-10/+14
As recently Smatch suggested, a couple of places in HDSP MADI driver may expand the array directly from the user-space value with speculation: sound/pci/rme9652/hdspm.c:5717 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_out' (local cap) sound/pci/rme9652/hdspm.c:5734 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_in' (local cap) This patch puts array_index_nospec() for hardening against them. BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2 Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-13Merge tag 'asoc-v4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai1-0/+1
ASoC: Updates for v4.15 The biggest thing this release has been the conversion of the AC98 bus to the driver model, that's been a long time coming so thanks to Robert Jarzmik for his dedication there. Due to there being some AC97 MFD there's a few fairly large changes in input and the MFD layer, mainly to the wm97xx driver. There's also some drivers/drm changes to support the new AMD Stoney platform, these are shared with the DRM subsystem and should be being merged via both. Within the subsystem the overwhelming bulk of the changes is in the Intel drivers which continue to need lots of cleanups and fixes, this release they've also gained support for their open source firmware. There's also some large changs in the core as Morimoto-san continues to mirror operations into the component level in preparation for conversion of drivers to that. - The AC97 bus has finally caught up with the driver model thanks to some dedicated and persistent work from Robert Jarzmik. - Continued work from Morimoto-san on moving us towards being able to use components for everything. - Lots of cleanups for the Intel platform code, including support for their open source audio firmware. - Support for scaling MCLK with sample rate in simple-card. - Support for AMD Stoney platform.
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-26ALSA: Convert timers to use timer_setup()Kees Cook2-8/+8
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 Elfring1-8/+8
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 Elfring1-15/+11
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 Elfring2-15/+12
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 Goyal2-4/+4
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 Elfring1-9/+9
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 Elfring1-10/+8
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 snd_hdspm_create()Markus Elfring1-5/+1
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 Bergmann1-20/+28
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 Iwai1-2/+2
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 Iwai1-2/+2
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 Iwai1-4/+4
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 Iwai1-17/+50
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 Iwai1-17/+54
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 Iwai2-4/+4
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 Lawall3-5/+5
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 King1-1/+1
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 Iwai1-2/+2
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 Iwai1-0/+8
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 Iwai1-4/+4
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 Iwai1-5/+4
2015-10-21ALSA: rme9652: Use snd_pcm_hw_constraint_single()Lars-Peter Clausen1-5/+4
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 Mukherjee1-0/+1
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 Carpenter1-2/+2
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 Carpenter1-1/+2
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 Knoth1-15/+3
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 Knoth1-18/+11
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 Knoth1-76/+24
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 Knoth1-0/+6
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 Iwai3-3/+3
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 Iwai1-9/+5
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 Iwai1-9/+5
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 Elfring3-8/+3
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 "release_firmware"Markus Elfring1-2/+1
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 Iwai1-24/+24
They are no real kerneldoc comments, so drop such markers. Signed-off-by: Takashi Iwai <tiwai@suse.de>