03 Jan, 2020
2 commits
-
Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.There should be no functional changes by this patch.
Link: https://lore.kernel.org/r/20200103081714.9560-35-tiwai@suse.de
Signed-off-by: Takashi Iwai -
Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.There should be no functional changes by this patch.
Link: https://lore.kernel.org/r/20200103081714.9560-7-tiwai@suse.de
Signed-off-by: Takashi Iwai
26 Jul, 2019
1 commit
-
In build_adc_controls(), there is an if statement on line 773 to check
whether ak->adc_info is NULL:
if (! ak->adc_info ||
! ak->adc_info[mixer_ch].switch_name)When ak->adc_info is NULL, it is used on line 792:
knew.name = ak->adc_info[mixer_ch].selector_name;Thus, a possible null-pointer dereference may occur.
To fix this bug, referring to lines 773 and 774, ak->adc_info
and ak->adc_info[mixer_ch].selector_name are checked before being used.This bug is found by a static analysis tool STCheck written by us.
Signed-off-by: Jia-Ju Bai
Signed-off-by: Takashi Iwai
31 May, 2019
1 commit
-
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 usaextracted 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
Reviewed-by: Allison Randal
Reviewed-by: Richard Fontana
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman
07 Feb, 2019
1 commit
-
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
Signed-off-by: Takashi Iwai
18 Oct, 2018
1 commit
-
Compiling with clang yields the following warning:
sound/i2c/cs8427.c:140:31: warning: implicit conversion from 'int'
to 'char' changes value from 160 to -96 [-Wconstant-conversion]
data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~Because CS8427_REG_AUTOINC is defined as 128, it is too big for a
char field.
So change data from char to unsigned char, that it can hold the value.This patch does not change the generated code.
Signed-off-by: Philipp Klocke
Signed-off-by: Takashi Iwai
03 Aug, 2018
1 commit
-
For a sake of code simplification, remove the init and the exit
entries that do nothing.Notes for readers: actually it's OK to remove *both* init and exit,
but not OK to remove the exit entry. By removing only the exit while
keeping init, the module becomes permanently loaded; i.e. you cannot
unload it any longer!Signed-off-by: Takashi Iwai
13 Nov, 2017
1 commit
-
…e/sound into for-linus
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.
02 Nov, 2017
1 commit
-
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
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
26 Oct, 2017
1 commit
-
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
Acked-by: Mark Brown
Signed-off-by: Takashi Iwai
17 May, 2017
1 commit
-
The ak4113, ak4114 and ak4117 i2c drivers have some tricky codes to
access the struct fields in the callback. This can be simplified by
replacing the struct fields with the array.Signed-off-by: Takashi Iwai
12 Jul, 2016
2 commits
-
snd_ak4114_create checks if the error return err is less than zero
or not. This is a redundant check, err can only be < 0 to get to
the __fail label, in which case just return err and remove the
redundant check (since we never return -EIO).Signed-off-by: Colin Ian King
Signed-off-by: Takashi Iwai -
snd_ak4117_create checks if the error return err is less than zero
or not. This is a redundant check, err can only be < 0 to get to
the __fail label, in which case just return err and remove the
redundant check (since we never return -EIO).Signed-off-by: Colin Ian King
Signed-off-by: Takashi Iwai
30 Nov, 2015
1 commit
-
The snd_i2c_ops structures are never modified, so declare them as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall
Signed-off-by: Takashi Iwai
29 May, 2015
1 commit
-
The compiler can optimize it away if not needed.
Signed-off-by: Takashi Iwai
23 Mar, 2015
1 commit
-
"err" is always a negative error code here, so there is no point in
checking. Removing the check silences a static checker warning and
makes the code a bit more clear. Also we don't need to initialize "err".Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
29 Jan, 2015
5 commits
-
Protect the call with a mutex, as this may be called in parallel
(either from the PCM rate change and the clock change).Acked-by: Jaroslav Kysela
Tested-by: Pavel Hofman
Signed-off-by: Takashi Iwai -
Define snd_ak4114_suspend() and snd_ak4114_resume() functions to
handle PM properly, stopping and restarting the work at PM.
Currently only ice1712/juli.c deals with the PM and ak4114, so fix the
calls there appropriately.The same PM functions are defined in ak4113.c, too, although they
aren't currently called yet (ice1712/quartet.c may be enhanced to
support PM later).Acked-by: Jaroslav Kysela
Tested-by: Pavel Hofman
Signed-off-by: Takashi Iwai -
... just to follow the standard coding style.
Acked-by: Jaroslav Kysela
Tested-by: Pavel Hofman
Signed-off-by: Takashi Iwai -
When ak4114 work calls its callback and the callback invokes
ak4114_reinit(), it stalls due to flush_delayed_work(). For avoiding
this, control the reentrance by introducing a refcount. Also
flush_delayed_work() is replaced with cancel_delayed_work_sync().The exactly same bug is present in ak4113.c and fixed as well.
Reported-by: Pavel Hofman
Acked-by: Jaroslav Kysela
Tested-by: Pavel Hofman
Cc:
Signed-off-by: Takashi Iwai
28 Jan, 2015
1 commit
-
Nowadays it's recommended. Replace all in a shot.
Signed-off-by: Takashi Iwai
19 Jan, 2015
1 commit
-
No functional change, refactoring with the standard helpers.
Signed-off-by: Takashi Iwai
21 Oct, 2014
1 commit
-
... and reduce the open codes. Also add missing const to the text array.
Signed-off-by: Takashi Iwai
03 Apr, 2014
1 commit
-
Separate HW initialization from device creation.
This is needed for suspend/resume support.Signed-off-by: Ondrej Zary
Signed-off-by: Takashi Iwai
14 Feb, 2014
2 commits
-
Function del_timer() does not guarantee that timer was really deleted.
If the timer handler is beeing executed at the moment, the function
does nothing. So, it's possible to use already freed memory in the handler:[ref: Documentation/DocBook/kernel-locking.tmpl]
This was found using grep and compile-tested only.
Signed-off-by: Kirill Tkhai
Signed-off-by: Takashi Iwai -
... instead of SNDRV_DEV_LOWLEVEL.
No functional change at this point.Signed-off-by: Takashi Iwai
29 Oct, 2013
2 commits
-
The size of the register cache array is actually 6 instead of 7,
as it caches up to AK4114_REG_INT1_MASK. This resulted in unexpected
access out of array range, although most of them aren't so serious
(just reading one more byte on the stack at snd_ak4114_create()).Also, the check of cache size was wrongly done by checking with
sizeof() instead of ARRAY_SIZE(). Fixed this together.(And yes, hardcoded numbers are bad, but I keep the coding style as is
for making it clear what this patch actually does.)Spotted by coverity among several CIDs, e.g. 711621.
Signed-off-by: Takashi Iwai
-
We tend to make stupid mistakes with strncpy(). Let's take a safer
one, strlcpy().Signed-off-by: Takashi Iwai
18 Aug, 2013
2 commits
-
Move tea575x from sound/i2c/other to drivers/media/radio
Includes Kconfig changes by Hans Verkuil.Signed-off-by: Hans Verkuil
Signed-off-by: Ondrej Zary
Acked-by: Takashi Iwai
Signed-off-by: Mauro Carvalho Chehab -
Move include/sound/tea575x-tuner.h to include/media/tea575x.h and update files that include it.
Signed-off-by: Ondrej Zary
Acked-by: Takashi Iwai
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
27 Jul, 2013
1 commit
-
Move HW initialization to separate function to allow using the code without
the v4l parts. This is needed for use in the bttv driver.Signed-off-by: Ondrej Zary
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
26 Jun, 2013
1 commit
-
"idx" is controled by the user and can be a negative offset into the
input_names[] array.Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
24 Mar, 2013
2 commits
-
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil
Acked-by: Laurent Pinchart
Acked-by: Alexey Klimov
Signed-off-by: Mauro Carvalho Chehab -
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
04 Nov, 2012
1 commit
-
Correct spelling typo in debug messages within drivers/sound
Signed-off-by: Masanari Iida
Signed-off-by: Takashi Iwai
07 Oct, 2012
1 commit
-
Pull media updates from Mauro Carvalho Chehab:
"The first part of the media updates for Kernel 3.7.This series contain:
- A major tree renaming patch series: now, drivers are organized
internally by their used bus, instead of by V4L2 and/or DVB API,
providing a cleaner driver location for hybrid drivers that
implement both APIs, and allowing to cleanup the Kconfig items and
make them more intuitive for the end user;- Media Kernel developers are typically very lazy with their duties
of keeping the MAINTAINERS entries for their drivers updated. As
now the tree is more organized, we're doing an effort to add/update
those entries for the drivers that aren't currently orphan;- Several DVB USB drivers got moved to a new DVB USB v2 core; the new
core fixes several bugs (as the existing one that got bitroted).
Now, suspend/resume finally started to work fine (at least with
some devices - we should expect more work with regards to it);- added multistream support for DVB-T2, and unified the API for
DVB-S2 and ISDB-S. Backward binary support is preserved;- as usual, a few new drivers, some V4L2 core improvements and lots
of drivers improvements and fixes.There are some points to notice on this series:
1) you should expect a trivial merge conflict on your tree, with the
removal of Documentation/feature-removal-schedule.txt: this series
would be adding two additional entries there. I opted to not
rebase it due to this recent change;2) With regards to the PCTV 520e udev-related breakage, I opted to
fix it in a way that the patches can be backported to 3.5 even
without your firmware fix patch. This way, Greg doesn't need to
rush backporting your patch (as there are still the firmware cache
and firmware path customization issues to be addressed there).I'll send later a patch (likely after the end of the merge window)
reverting the rest of the DRX-K async firmware request, fully
restoring its original behaviour to allow media drivers to
initialize everything serialized as before for 3.7 and upper.3) I'm planning to work on this weekend to test the DMABUF patches
for V4L2. The patches are on my queue for several Kernel cycles,
but, up to now, there is/was no way to test the series locally.I have some concerns about this particular changeset with regards
to security issues, and with regards to the replacement of the old
VIDIOC_OVERLAY ioctl's that is broken on modern systems, due to
GPU drivers change. The Overlay API allows direct PCI2PCI
transfers from a media capture card into the GPU framebuffer, but
its API is crappy. Also, the only existing X11 driver that
implements it requires a XV extension that is not available
anymore on modern drivers. The DMABUF can do the same thing, but
with it is promising to be a properly-designed API. If I can
successfully test this series and be happy with it, I should be
asking you to pull them next week."* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (717 commits)
em28xx: regression fix: use DRX-K sync firmware requests on em28xx
drxk: allow loading firmware synchrousnously
em28xx: Make all em28xx extensions to be initialized asynchronously
[media] tda18271: properly report read errors in tda18271_get_id
[media] tda18271: delay IR & RF calibration until init() if delay_cal is set
[media] MAINTAINERS: add Michael Krufky as tda827x maintainer
[media] MAINTAINERS: add Michael Krufky as tda8290 maintainer
[media] MAINTAINERS: add Michael Krufky as cxusb maintainer
[media] MAINTAINERS: add Michael Krufky as lg2160 maintainer
[media] MAINTAINERS: add Michael Krufky as lgdt3305 maintainer
[media] MAINTAINERS: add Michael Krufky as mxl111sf maintainer
[media] MAINTAINERS: add Michael Krufky as mxl5007t maintainer
[media] MAINTAINERS: add Michael Krufky as tda18271 maintainer
[media] s5p-tv: Report only multi-plane capabilities in vidioc_querycap
[media] s5p-mfc: Fix misplaced return statement in s5p_mfc_suspend()
[media] exynos-gsc: Add missing static storage class specifiers
[media] exynos-gsc: Remove header file inclusion
[media] s5p-fimc: Fix incorrect condition in fimc_lite_reqbufs()
[media] s5p-tv: Fix potential NULL pointer dereference error
[media] s5k6aa: Fix possible NULL pointer dereference
...
27 Sep, 2012
1 commit
-
VIDIOC_S_HW_FREQ_SEEK should return EAGAIN when called in non-blocking
mode. This might change in the future if we add support for this in the
future, but right now this is not supported.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
26 Sep, 2012
1 commit
-
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_freq_hw_seek.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
14 Sep, 2012
1 commit
-
Signed-off-by: Hans de Goede
Signed-off-by: Mauro Carvalho Chehab