History log of /linux-master/sound/drivers/vx/vx_pcm.c
Revision Date Author Comments
# a5ed0c54 23-Aug-2022 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Drop superfluous GFP setup

The extra setup with GFP_DMA32 is superfluous for this driver. The
whole operation is a simple copy loop, and there is no memory address
restriction at all. Drop the useless GFP setup.

Link: https://lore.kernel.org/r/20220823115740.14123-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ed1567c1 08-Jun-2021 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Fix assignment in if condition

VX driver helper 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-61-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# af102a88 23-Dec-2020 Lars-Peter Clausen <lars@metafoo.de>

ALSA: vx: Use roundup() instead of open-coding it

Use roundup() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((((x) + (y) - 1) / (y)) * y)
+roundup(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-12-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b248b9dd 02-Sep-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: vx: vx_pcm: remove redundant assignment

Fix cppcheck warning:

sound/drivers/vx/vx_pcm.c:63:7: style: Variable 'buf' is assigned a
value that is never used. [unreadVariable]
buf = (unsigned char *)runtime->dma_area;
^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e408ab06 02-Sep-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ALSA: vx: vx_pcm: remove redundant assignment

Fix cppcheck warning:

sound/drivers/vx/vx_pcm.c:539:30: style: Variable
'chip->playback_pipes[audio]' is reassigned a value before the old one
has been used. [redundantAssignment]
chip->playback_pipes[audio] = pipe;
^
sound/drivers/vx/vx_pcm.c:533:31: note: chip->playback_pipes[audio] is
assigned
chip->playback_pipes[audio] = pipe;
^
sound/drivers/vx/vx_pcm.c:539:30: note: chip->playback_pipes[audio] is
overwritten
chip->playback_pipes[audio] = pipe;
^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ae531486 09-Dec-2019 Takashi Iwai <tiwai@suse.de>

ALSA: drivers: Drop superfluous ioctl PCM ops

PCM core deals the empty ioctl field now as default(*).
Let's kill the redundant lines.

(*) commit fc033cbf6fb7 ("ALSA: pcm: Allow NULL ioctl ops")

Link: https://lore.kernel.org/r/20191210061145.24641-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8f326303 09-Dec-2019 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Use managed buffer allocation

Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and got
dropped.

Link: https://lore.kernel.org/r/20191209094943.14984-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 748a76b2 05-Nov-2019 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Convert to the common vmalloc memalloc

The recent change (*) in the ALSA memalloc core allows us to drop the
special vmalloc-specific allocation and page handling. This patch
coverts to the common code.
(*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
support
7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
default mmap handler

Since the driver requires the DMA32 allocation, it passes the
specially encoded device to snd_pcm_lib_preallocate_pages().

Link: https://lore.kernel.org/r/20191105151856.10785-16-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156

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>


# fa84cf09 17-Jul-2018 Takashi Iwai <tiwai@suse.de>

ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc()

snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with
somewhat special for vmalloc handling, but in the end, this turned to
just the default handler, i.e. NULL. As the situation has never
changed over decades, let's rip it off.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b6c0b715 17-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ALSA: drivers: make snd_pcm_hardware const

Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# bf833484 08-Jun-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

ALSA: vx: vx_pcm: constify vx_pcm_playback_ops and vx_pcm_capture_ops.

File size before:
text data bss dec hex filename
7126 240 0 7366 1cc6 sound/drivers/vx/vx_pcm.o

File size After adding 'const':
text data bss dec hex filename
7382 0 0 7382 1cd6 sound/drivers/vx/vx_pcm.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ed3c177d 03-Jan-2017 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Don't try to update capture stream before running

The update of stream costs significantly, and we should avoid it
unless the stream really has started. Check pipe->running flag
instead of pipe->prepared.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 874e1f6f 03-Jan-2017 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Fix possible transfer overflow

The pseudo DMA transfer codes in VX222 and VX-pocket driver have a
slight bug where they check the buffer boundary wrongly, and may
overflow. Also, the zero sample count might be handled badly for the
playback (although it shouldn't happen in theory). This patch
addresses these issues.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=141541
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# db0a5214 09-Sep-2014 Takashi Iwai <tiwai@suse.de>

ALSA: vx: Use nonatomic PCM ops

Rewrite VXpocket and VX222 drivers to use the new PCM nonatomic ops.
The former irq tasklet is replaced with a threaded irq handler, and
the tasklet for the PCM delayed start is simply merged into the normal
PCM trigger, as well as the replacement of spinlock with mutex.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 395d9dd5 28-Sep-2012 Peter Senna Tschudin <peter.senna@gmail.com>

sound: Remove unnecessary semicolon

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# c32d977b 18-Jan-2010 Takashi Iwai <tiwai@suse.de>

ALSA: pcm - Call pgprot_noncached() for vmalloc'ed buffers

pgprot_noncached() can be set for vmalloc'ed buffers safely, and we'd
need non-cached behavior more or less, even for the intermediate ring-
buffers.

Now snd_pcm_lib_mmap_vmalloc() is added as the common PCM mmap callback
that is coupled with snd_pcm_lib_alloc_vmalloc_buffer() & co.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 149feef5 18-Dec-2009 Clemens Ladisch <clemens@ladisch.de>

sound: vx: use vmalloc buffer helper functions

Remove this duplicate of snd_pcm_alloc_vmalloc_buffer and use the
equivalent core functions instead.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1f04128a 17-Dec-2008 Takashi Iwai <tiwai@suse.de>

ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule()

Replace all tasklet_hi_schedule() callers with the normal
tasklet_schedule(). The former often causes troubles with
RT-kernels, and has actually no merit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5e246b85 08-Aug-2008 Takashi Iwai <tiwai@suse.de>

ALSA: Kill snd_assert() in other places

Kill snd_assert() in other places, either removed or replaced with
if () with snd_BUG_ON().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 9004acc7 08-Jan-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove sound/driver.h

This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 59feddb2 25-Jul-2006 Panagiotis Issaris <takis@issaris.org>

[ALSA] Conversions from kmalloc+memset to k(z|c)alloc

sound: Conversions from kmalloc+memset to k(c|z)alloc.

Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# ac57b849 06-Mar-2006 Alexey Dobriyan <adobriyan@gmail.com>

[ALSA] vx - Fix memory leak on error path

Modules: Digigram VX core

Noticed by Eric Sesterhenn on kernel-janitors@

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9c4be3d3 09-Feb-2006 Jesper Juhl <jesper.juhl@gmail.com>

[ALSA] no need to check pointers passed to vfree() for NULL

Modules: Digigram VX core,USB generic driver

There's no need to check pointers passed to vfree() for NULL.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# af26367f 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove xxx_t typedefs: VXdriver

Remove xxx_t typedefs from the VXdriver codes
(vx_core support, vx222 and vxpocket).

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b1d5776d 10-Oct-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove vmalloc wrapper, kfree_nocheck()

- Remove vmalloc wrapper
- Add release_and_free_resource() to remove kfree_nocheck() from each driver
and simplify the code

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 561b220a 09-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Replace with kzalloc() - others

Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3
OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers
AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver
SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth
USB generic driver,USB USX2Y
Replace kcalloc(1,..) with kzalloc().

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 41e4845c 18-Aug-2005 Jaroslav Kysela <perex@suse.cz>

[ALSA] PCM resume cleanups

Digigram VX core,CS4231 driver,ATIIXP driver,VIA82xx driver
VIA82xx-modem driver,au88x0 driver,CS46xx driver,Trident driver
This patch disables SNDRV_PCM_INFO_RESUME flag for drivers which does not
support the full resume.

Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 4d572776 30-May-2005 Jesper Juhl <juhl-lkml@dif.dk>

[ALSA] Remove redundant NULL checks before kfree

Timer Midlevel,ALSA sequencer,ALSA<-OSS sequencer,Digigram VX core
I2C tea6330t,GUS Library,VIA82xx driver,VIA82xx-modem driver
CA0106 driver,CS46xx driver,EMU10K1/EMU10K2 driver,YMFPCI driver
Digigram VX Pocket driver,Common EMU synth,USB generic driver,USB USX2Y
Checking a pointer for NULL before calling kfree() on it is redundant,
kfree() deals with NULL pointers just fine.
This patch removes such checks from sound/

This patch also makes another, but closely related, change.
It avoids casting pointers about to be kfree()'ed.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!