Commit graph

7970 commits

Author SHA1 Message Date
Linus Torvalds
99897b1e99 sound fixes for 4.19-rc1
no surprises here: a regression fix for virmidi code refactoring,
 three fixes for the new AC97 bus compat and runtime PM, and a usual
 HD-audio quirk.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlt+hRUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9ukQ/+Ou8QjdFM8hghYiLWUiNdzFhut6k3CyzJpSyr
 BD3oUEuCUp+rsI3HuTIaerdTezT4xdIwFozbXZ51f3OWxqGkP0lSBASfpxBOELRi
 i2fAfExgWnvTY34EFuW8Zf/H2grl14wixC4IQN2IqlRWwnQbcrOI+wEizaXcLrrb
 KcItJVmjsNzwJrtg51MA8eLPWeyZ2dCeDXcSawLe8qHkpUyAX4kpt2oOyYcTeGJe
 +kM2x6MWoDN5cdWzkJxkayO+wiffCZXQv3NUq+EFY0p1yAO9Bsz3zq42RsxEl0E8
 l8WL/FXvroc4VGO38ksicyZp4iy6YSMPv6PHijHHDqVAh5hmdAwMhdzi5LWExV12
 b6GBbd8WajqQ0nShRtnx/uFHG0PrmS59k17JdP9kK8z6YSekD5vmS8NkF8ibXr5T
 NySqyrK4BGxolB/cXyImzCvdkxvPbTKe2sy5VD8kevRKZcloQ7N8lghP1JMMNa/i
 qqjuDIG9wUhf6Ksw63eksG6u27v6kki+TbmteyBLl0y6iTdbZ+xmLsragcm/LD35
 +nebpqQBDNOGtMY8llZ+Y8QAuhnWy5YFlnYg16T8K0lnE84YtwyQzG5uV34fJ8Qw
 iVkS89pAZHnf6OkyOi3yWTyykzlTpq6DL7zulXXs0/KCcZCl9qj9yreHq+0lYYVe
 WrFv6PE=
 =381l
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "No surprises here: a regression fix for virmidi code refactoring,
  three fixes for the new AC97 bus compat and runtime PM, and a usual
  HD-audio quirk"

* tag 'sound-fix-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek - Fix HP Headset Mic can't record
  ALSA: ac97: fix unbalanced pm_runtime_enable
  ALSA: ac97: fix check of pm_runtime_get_sync failure
  ALSA: ac97: fix device initialization in the compat layer
  ALSA: seq: virmidi: Fix discarding the unsubscribed output
2018-08-23 15:37:24 -07:00
Kailang Yang
8a328ac1f9 ALSA: hda/realtek - Fix HP Headset Mic can't record
This patch will fix HP workstation Headset Mic not recording.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-21 11:53:17 +02:00
Linus Torvalds
70b20dd7f8 ALSA: update dell-wmi mic-mute registration to new world order
Commit c647f806b8 ("ALSA: hda - Allow multiple ADCs for mic mute LED
controls") changed the return value of the snd_hda_gen_add_micmute_led()
without actually updating the callers.

Admittedly, almost no callers actually cared about the return value.
But one call site very much did: the Dell wmi code.  It would see the
registration return zero, which _used_ to mean "failed" but now means
"success", and clear the dell_micmute_led_set_func pointer.

End result: the successful registration would end up calling the Dell
code that thought it had all failed, and call through a NULL pointer.

To make matters worse, it ends up being a tail-call, and with the
retpoline sequence you don't even see the caller (dell_micmute_update())
in the stack trace, so the error ended up way less obvious than it
should have been.

Fixes: c647f806b8 "ALSA: hda - Allow multiple ADCs for mic mute LED controls"
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-15 19:08:10 -07:00
Takashi Iwai
73b383141d Merge branch 'for-next' into for-linus
Preparation for 4.19 merge material.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-12 08:55:10 +02:00
Gustavo A. R. Silva
725097323b ALSA: mixart: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in this particular case, I replaced the code comment with
a proper "fall through" annotation, which is what GCC is expecting
to find.

Addresses-Coverity-ID: 114889 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-09 08:52:04 +02:00
Connor McAdams
2f295f91b7 ALSA: hda/ca0132 - Add exit commands for Recon3D
This patch adds exit functions for the Recon3D, and cleans up the
current exit function.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:41:02 +02:00
Connor McAdams
e25e344504 ALSA: hda/ca0132 - Change mixer controls for Recon3D
This patch adds changes to setup the Recon3D's mixer controls.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:40:39 +02:00
Connor McAdams
42aa3a1690 ALSA: hda/ca0132 - Add Recon3D input and output select commands
This patch adds commands to the alternative input and output select
commands to support the Recon3D.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:40:23 +02:00
Connor McAdams
c986f50ca9 ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D
The Recon3D can use many of the same functions as the Recon3Di, so many
of the r3di prefix function remain the same, but change their names to
the more generic r3d prefix. This patch does this, and adds quirk checks
for things specific to the Recon3Di.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:40:02 +02:00
Connor McAdams
e42c7c7313 ALSA: hda/ca0132 - Add Recon3D startup functions and setup
This patch adds functions for Recon3D startup, and sets values for
things such as use_pci_mmio. It also renames some functions and tables
from the sbz prefix into ca0132, as the Recon3D uses them as well.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:39:19 +02:00
Connor McAdams
08eca6b1f1 ALSA: hda/ca0132 - Add bool variable to enable/disable pci region2 mmio
This patch adds the ability to choose whether or not to map the pci
region2, which is used for things such as GPIO on the Recon3D and Sound
Blaster Z.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:39:09 +02:00
Connor McAdams
7f73df9540 ALSA: hda/ca0132 - Add Recon3D pincfg
This patch adds pin configs from the Recon3D, taken from the Window's
driver.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:38:50 +02:00
Connor McAdams
8f8c523c46 ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D
This patch adds the PCI subsys ID for the Recon3D that has been tested,
and adds the QUIRK_R3D enumeration.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:38:19 +02:00
Connor McAdams
a1b7f016a1 ALSA: hda/ca0132 - Add alt_functions unsolicited response
This patch fixes a previous oversight where the microphone unsolicited
response would use the wrong input selection function.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:37:50 +02:00
Connor McAdams
d97420d2b0 ALSA: hda/ca0132 - Clean up ca0132_init function.
This patch cleans up ca0132_init by removing unnecessary commands and
ordering things better.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:37:36 +02:00
Connor McAdams
a62e473947 ALSA: hda/ca0132 - Create mmio gpio function to make code clearer
This patch adds a new function, ca0132_mmio_gpio_set, to clear up what
is going on with writes to mmio region 0x320.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-08 20:37:25 +02:00
Gustavo A. R. Silva
ef0075280c ALSA: echoaudio: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 115156 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-06 09:33:45 +02:00
Gustavo A. R. Silva
9d5a289a86 ALSA: emu10k1: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in this particular case, I replaced the code comment with
a proper "fall through" annotation, which is what GCC is expecting
to find.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-06 09:33:43 +02:00
Gustavo A. R. Silva
ac69c2f578 ALSA: mixart: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-06 09:33:42 +02:00
Alexandru Gagniuc
56e40eb6d6 ALSA: hda/realtek - Add mute LED quirk for HP Spectre x360
This device has the same issues as the HP x360 wrt the MUTE LED and
the front speakers not working. This patch fixes the MUTE LED issue,
but doesn't touch the HDA verbs. The fix for the x360 does not work
on the Spectre.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-05 18:42:45 +02:00
Takashi Iwai
a7da09fecf ALSA: pci: Remove empty init and exit
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 <tiwai@suse.de>
2018-08-03 16:11:48 +02:00
Hans de Goede
8e82a72879 ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
I added the subsys product-id for the HDMI HDA device rather then for
the PCH one, this commit fixes this.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-02 14:13:49 +02:00
Colin Ian King
0d00085b90 ALSA: sonicvibes: remove redundant pointer 'dir'
Pointer 'dir' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'dir' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-01 14:00:13 +02:00
Colin Ian King
3b0cbc7812 ALSA: ens137x: remove redundant array pcm_devs
The array pcm_devs is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'pcm_devs' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-01 13:59:58 +02:00
Colin Ian King
de42b4b96e ALSA: emu10k1: remove redundant variable attn
Variable attn is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'attn' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-01 13:59:39 +02:00
Colin Ian King
45bf41005a ALSA: cs5535audio: remove redundant pointer 'dma'
Pointer 'dma' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up two clang warnings:
warning: variable 'dma' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-01 13:59:29 +02:00
Colin Ian King
96963dedd0 ALSA: asihpi: remove redundant variable max_streams
Variable max_streams is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'max_streams' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-01 13:59:12 +02:00
Takashi Iwai
16c796e8fa Merge branch 'for-linus' into topic/virmidi
Pull the latest ALSA sequencer fixes for the further development of
virmidi.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-29 22:39:29 +02:00
Takashi Iwai
f69548ffaf ALSA: hda/hdmi: Use single mutex unlock in error paths
Instead of calling mutex_unlock() at each error path multiple times,
take the standard goto-and-a-single-unlock approach.  This will
simplify the code and make easier to find the unbalanced mutex locks.

No functional changes, but only the code readability improvement as a
preliminary work for further changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-29 09:28:12 +02:00
Park Ju Hyung
f59cf9a055 ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
On rare occasions, we are still noticing that the internal speaker
spitting out spurious noises even after adding the problematic codec
to the list.

Adding a 10ms artificial delay before rebooting fixes the issue entirely.

Patch for Realtek codecs also adds the same amount of delay after
entering D3.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-28 18:57:56 +02:00
Park Ju Hyung
d77a4b4a5b ALSA: hda - Turn CX8200 into D3 as well upon reboot
As an equivalent codec with CX20724,
CX8200 is also subject to the reboot bug.

Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims
to this issue, causing extremely loud noises upon reboot.

Now that we know that this bug is subject to multiple codecs,
fix the comment as well.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-28 18:57:33 +02:00
Jia-Ju Bai
fad56c895f ALSA: ctxfi: cthw20k2: Replace mdelay() with msleep() and usleep_range()
hw_pll_init(), hw_dac_stop(), hw_dac_start() and hw_adc_init()
are never called in atomic context.
They call mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 11:49:16 +02:00
Jia-Ju Bai
08fd8325d9 ALSA:: ctxfi: cthw20k1: Replace mdelay() with msleep()
hw_pll_init(), hw_reset_dac() and hw_card_init() are never
called in atomic context.
They calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 11:48:50 +02:00
Takashi Iwai
7e49aadf64 ALSA: atiixp_modem: Proper endian notations
The DMA address table in atiixp modem driver is in little-endian,
hence we should define it with __le32 properly.

Spotted by sparse, a warning like:
  sound/pci/atiixp_modem.c:360:28: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:13 +02:00
Takashi Iwai
c44a81a40a ALSA: atiixp: Proper endian notations
The DMA address table in atiixp driver is in little-endian, hence we should define it with __le32 properly.

Spotted by sparse, a warning like:
  sound/pci/atiixp.c:393:28: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:12 +02:00
Takashi Iwai
58578d1894 ALSA: bt87x: Proper endian notations
The RISC data in bt87x is in little-endian, hence we should define it
with __le32 properly.

Spotted by sparse, a warning like:
  sound/pci/bt87x.c:240:17: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:11 +02:00
Takashi Iwai
2a833a02a1 ALSA: echoaudio: Proper endian notations
Many data fields defined in echoaudio drivers are in little-endian,
hence they should be defined with __le16 or __le32.  This makes it
easier to catch the forgotten conversions.

Spotted by sparse, a warning like:
  sound/pci/echoaudio/echoaudio_dsp.c:990:36: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:09 +02:00
Takashi Iwai
8c0ab942e0 ALSA: maestro3: Proper endian notations
The ASSP data passed to maestro3 driver is in little-endian format,
hence the data pointer should be with __le16.

Spotted by sparse, warnings like:
  sound/pci/maestro3.c:2128:35: warning: cast to restricted __le16

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:08 +02:00
Takashi Iwai
7752a7de25 ALSA: intel8x0m: Proper endian notations
The BD address tables in intel8x0m driver are in little-endian, hence
they should be represented as __le32 instead u32.

Spotted by sparse, warnings like:
  sound/pci/intel8x0m.c:406:40: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:07 +02:00
Takashi Iwai
3c164e2ce6 ALSA: intel8x0: Proper endian notations
The BD address tables in intel8x0 driver are in little-endian, hence
they should be represented as __le32 instead u32.

Spotted by sparse, warnings like:
  sound/pci/intel8x0.c:688:40: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:06 +02:00
Takashi Iwai
0d9a26fc74 ALSA: lola: Proper endian notations
The BDL entries in lola driver are little-endian while we code them as
u32.  This leads to sparse warnings like:
  sound/pci/lola/lola.c:105:40: warning: incorrect type in assignment (different base types)
  sound/pci/lola/lola.c:105:40:    expected unsigned int [unsigned] [usertype] <noident>
  sound/pci/lola/lola.c:105:40:    got restricted __le32 [usertype] <noident>

This patch fixes the declarations to the proper __le32 type.

Also, there was a typo in the original code, where __user was used
that was intended as __iomem.  This was caused also by sparse:
  sound/pci/lola/lola_mixer.c:132:27: warning: incorrect type in assignment (different address spaces)
Fixed in this patch as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:05 +02:00
Takashi Iwai
0e7ca66a97 ALSA: mixart: Proper endian notations
The miXart driver deals with big-endian values as raw data, while it
declares most of variables as u32.  This leads to sparse warnings like
  sound/pci/mixart/mixart.c:1203:23: warning: cast to restricted __be32

Fix them by properly defining the structs and add the explicit cast to
macros.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:03 +02:00
Takashi Iwai
be05e3de3a ALSA: riptide: Properly endian notations
The SG descriptor of Riptide contains the little-endian values, hence
we need to define with __le32 properly.  This fixes sparse warnings
like:
  sound/pci/riptide/riptide.c:1112:40: warning: cast to restricted __le32

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:02 +02:00
Takashi Iwai
752089fea3 ALSA: trident: Proper endian notations
The TLB entries in Trident driver are represented in little-endian,
hence they should be declared as __le32.

This patch fixes the sparse warnings like:
  sound/pci/trident/trident_memory.c:226:17: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:06:00 +02:00
Takashi Iwai
d3c637632d ALSA: ymfpci: Proper endian notations
The bank values are all little-endians, so they should be defined with
__le32.  This fixes lots of sparse warnings like:
  sound/pci/ymfpci/ymfpci_main.c:315:23: warning: cast to restricted __le32
  sound/pci/ymfpci/ymfpci_main.c:342:32: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:05:58 +02:00
Takashi Iwai
a91a0e7749 ALSA: asihpi: Fix PCM format notations
asihpi driver treats -1 as an own invalid PCM format, but this needs
a proper cast with __force prefix since PCM format type is __bitwise.
Define a constant with the proper type and use it allover.

This fixes sparse warnings like:
  sound/pci/asihpi/asihpi.c:315:9: warning: incorrect type in initializer (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:05:30 +02:00
Takashi Iwai
10d3d91e3b ALSA: au88x0: Fix sparse warning wrt PCM format type
The PCM format type is with __bitwise, and it can't be converted from
integer implicitly.  Instead of an ugly cast, declare the function
argument of vortex_alsafmt_aspfmt() with the proper snd_pcm_format_t
type.

This fixes the sparse warning like:
  sound/pci/au88x0/au88x0_core.c:2778:14: warning: restricted snd_pcm_format_t degrades to integer

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:05:28 +02:00
Takashi Iwai
94dfee0c1a ALSA: riptide: Fix PCM format type conversion
The PCM format type is with __bitwise, hence it needs to be explicitly
declared as snd_pcm_format_t, as warned by sparse:
  sound/pci/riptide/riptide.c:1028:34: warning: incorrect type in argument 1 (different base types)
  sound/pci/riptide/riptide.c:1028:34:    expected restricted snd_pcm_format_t [usertype] format
  sound/pci/riptide/riptide.c:1028:34:    got unsigned char [unsigned] format

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27 09:05:26 +02:00
Takashi Iwai
d6b340d7cb ALSA: trident: Suppress gcc string warning
The meddlesome gcc warns about the possible shortname string in
trident driver code:
  sound/pci/trident/trident.c: In function ‘snd_trident_probe’:
  sound/pci/trident/trident.c:126:2: warning: ‘strcat’ accessing 17 or more bytes at offsets 36 and 20 may overlap 1 byte at offset 36 [-Wrestrict]
  strcat(card->shortname, card->driver);

It happens since gcc calculates the possible string size from
card->driver, but this can't be true since we did set the string just
before that, and they are much shorter.

For shutting it up, use the exactly same string set to card->driver
for strcat() to card->shortname, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-26 15:01:37 +02:00
Takashi Iwai
63623646a0 ALSA: emu10k1: Fix missing __force annotation for user/kernel pointer cast
The cast between user-space and kernel-space needs an explicit __force
prefix, but it's missing in many places in emu10k1 driver code.

Spotted by sparse as a warning like:
  sound/pci/emu10k1/emufx.c:529:33: warning: cast removes address space of expression

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-26 08:33:16 +02:00