git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
sound
/
isa
/
gus
/
gus_mem.c
diff --git
a/sound/isa/gus/gus_mem.c
b/sound/isa/gus/gus_mem.c
index
783f5dd
..
e8bdb86
100644
(file)
--- a/
sound/isa/gus/gus_mem.c
+++ b/
sound/isa/gus/gus_mem.c
@@
-21,16
+21,17
@@
#include <sound/driver.h>
#include <linux/slab.h>
#include <sound/driver.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
#ifdef CONFIG_SND_DEBUG
#include <sound/core.h>
#include <sound/gus.h>
#include <sound/info.h>
#ifdef CONFIG_SND_DEBUG
-static void snd_gf1_mem_info_read(s
nd_info_entry_t
*entry,
- s
nd_info_buffer_t *
buffer);
+static void snd_gf1_mem_info_read(s
truct snd_info_entry
*entry,
+ s
truct snd_info_buffer *
buffer);
#endif
#endif
-void snd_gf1_mem_lock(s
nd_gf1_mem_t
* alloc, int xup)
+void snd_gf1_mem_lock(s
truct snd_gf1_mem
* alloc, int xup)
{
if (!xup) {
down(&alloc->memory_mutex);
{
if (!xup) {
down(&alloc->memory_mutex);
@@
-39,12
+40,12
@@
void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup)
}
}
}
}
-s
nd_gf1_mem_block_t *snd_gf1_mem_xalloc(snd_gf1_mem_t
* alloc,
-
snd_gf1_mem_block_t
* block)
+s
tatic struct snd_gf1_mem_block *snd_gf1_mem_xalloc(struct snd_gf1_mem
* alloc,
+
struct snd_gf1_mem_block
* block)
{
{
- s
nd_gf1_mem_block_t
*pblock, *nblock;
+ s
truct snd_gf1_mem_block
*pblock, *nblock;
- nblock =
(snd_gf1_mem_block_t *) kmalloc(sizeof(snd_gf1_mem_block_t
), GFP_KERNEL);
+ nblock =
kmalloc(sizeof(struct snd_gf1_mem_block
), GFP_KERNEL);
if (nblock == NULL)
return NULL;
*nblock = *block;
if (nblock == NULL)
return NULL;
*nblock = *block;
@@
-75,7
+76,7
@@
snd_gf1_mem_block_t *snd_gf1_mem_xalloc(snd_gf1_mem_t * alloc,
return nblock;
}
return nblock;
}
-int snd_gf1_mem_xfree(s
nd_gf1_mem_t * alloc, snd_gf1_mem_block_t
* block)
+int snd_gf1_mem_xfree(s
truct snd_gf1_mem * alloc, struct snd_gf1_mem_block
* block)
{
if (block->share) { /* ok.. shared block */
block->share--;
{
if (block->share) { /* ok.. shared block */
block->share--;
@@
-100,16
+101,15
@@
int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block)
if (block->prev)
block->prev->next = block->next;
}
if (block->prev)
block->prev->next = block->next;
}
- if (block->name)
- kfree(block->name);
+ kfree(block->name);
kfree(block);
return 0;
}
kfree(block);
return 0;
}
-s
nd_gf1_mem_block_t *snd_gf1_mem_look(snd_gf1_mem_t
* alloc,
- unsigned int address)
+s
tatic struct snd_gf1_mem_block *snd_gf1_mem_look(struct snd_gf1_mem
* alloc,
+
unsigned int address)
{
{
- s
nd_gf1_mem_block_t
*block;
+ s
truct snd_gf1_mem_block
*block;
for (block = alloc->first; block; block = block->next) {
if (block->ptr == address) {
for (block = alloc->first; block; block = block->next) {
if (block->ptr == address) {
@@
-119,10
+119,10
@@
snd_gf1_mem_block_t *snd_gf1_mem_look(snd_gf1_mem_t * alloc,
return NULL;
}
return NULL;
}
-s
nd_gf1_mem_block_t *snd_gf1_mem_share(snd_gf1_mem_t
* alloc,
- unsigned int *share_id)
+s
tatic struct snd_gf1_mem_block *snd_gf1_mem_share(struct snd_gf1_mem
* alloc,
+
unsigned int *share_id)
{
{
- s
nd_gf1_mem_block_t
*block;
+ s
truct snd_gf1_mem_block
*block;
if (!share_id[0] && !share_id[1] &&
!share_id[2] && !share_id[3])
if (!share_id[0] && !share_id[1] &&
!share_id[2] && !share_id[3])
@@
-133,14
+133,14
@@
snd_gf1_mem_block_t *snd_gf1_mem_share(snd_gf1_mem_t * alloc,
return NULL;
}
return NULL;
}
-static int snd_gf1_mem_find(s
nd_gf1_mem_t
* alloc,
- s
nd_gf1_mem_block_t
* block,
+static int snd_gf1_mem_find(s
truct snd_gf1_mem
* alloc,
+ s
truct snd_gf1_mem_block
* block,
unsigned int size, int w_16, int align)
{
unsigned int size, int w_16, int align)
{
- s
nd_gf1_bank_info_t
*info = w_16 ? alloc->banks_16 : alloc->banks_8;
+ s
truct snd_gf1_bank_info
*info = w_16 ? alloc->banks_16 : alloc->banks_8;
unsigned int idx, boundary;
int size1;
unsigned int idx, boundary;
int size1;
- s
nd_gf1_mem_block_t
*pblock;
+ s
truct snd_gf1_mem_block
*pblock;
unsigned int ptr1, ptr2;
align--;
unsigned int ptr1, ptr2;
align--;
@@
-186,11
+186,11
@@
static int snd_gf1_mem_find(snd_gf1_mem_t * alloc,
return -ENOMEM;
}
return -ENOMEM;
}
-s
nd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t
* alloc, int owner,
+s
truct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem
* alloc, int owner,
char *name, int size, int w_16, int align,
unsigned int *share_id)
{
char *name, int size, int w_16, int align,
unsigned int *share_id)
{
- s
nd_gf1_mem_block_t
block, *nblock;
+ s
truct snd_gf1_mem_block
block, *nblock;
snd_gf1_mem_lock(alloc, 0);
if (share_id != NULL) {
snd_gf1_mem_lock(alloc, 0);
if (share_id != NULL) {
@@
-198,7
+198,7
@@
snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner,
if (nblock != NULL) {
if (size != (int)nblock->size) {
/* TODO: remove in the future */
if (nblock != NULL) {
if (size != (int)nblock->size) {
/* TODO: remove in the future */
- snd_printk("snd_gf1_mem_alloc - share: sizes differ\n");
+ snd_printk(
KERN_ERR
"snd_gf1_mem_alloc - share: sizes differ\n");
goto __std;
}
nblock->share++;
goto __std;
}
nblock->share++;
@@
-214,16
+214,16
@@
snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner,
if (share_id != NULL)
memcpy(&block.share_id, share_id, sizeof(block.share_id));
block.owner = owner;
if (share_id != NULL)
memcpy(&block.share_id, share_id, sizeof(block.share_id));
block.owner = owner;
- block.name =
snd_kmalloc_
strdup(name, GFP_KERNEL);
+ block.name =
k
strdup(name, GFP_KERNEL);
nblock = snd_gf1_mem_xalloc(alloc, &block);
snd_gf1_mem_lock(alloc, 1);
return nblock;
}
nblock = snd_gf1_mem_xalloc(alloc, &block);
snd_gf1_mem_lock(alloc, 1);
return nblock;
}
-int snd_gf1_mem_free(s
nd_gf1_mem_t
* alloc, unsigned int address)
+int snd_gf1_mem_free(s
truct snd_gf1_mem
* alloc, unsigned int address)
{
int result;
{
int result;
- s
nd_gf1_mem_block_t
*block;
+ s
truct snd_gf1_mem_block
*block;
snd_gf1_mem_lock(alloc, 0);
if ((block = snd_gf1_mem_look(alloc, address)) != NULL) {
snd_gf1_mem_lock(alloc, 0);
if ((block = snd_gf1_mem_look(alloc, address)) != NULL) {
@@
-235,12
+235,12
@@
int snd_gf1_mem_free(snd_gf1_mem_t * alloc, unsigned int address)
return -EINVAL;
}
return -EINVAL;
}
-int snd_gf1_mem_init(s
nd_gus_card_t
* gus)
+int snd_gf1_mem_init(s
truct snd_gus_card
* gus)
{
{
- s
nd_gf1_mem_t
*alloc;
- s
nd_gf1_mem_block_t
block;
+ s
truct snd_gf1_mem
*alloc;
+ s
truct snd_gf1_mem_block
block;
#ifdef CONFIG_SND_DEBUG
#ifdef CONFIG_SND_DEBUG
- s
nd_info_entry_t
*entry;
+ s
truct snd_info_entry
*entry;
#endif
alloc = &gus->gf1.mem_alloc;
#endif
alloc = &gus->gf1.mem_alloc;
@@
-254,13
+254,13
@@
int snd_gf1_mem_init(snd_gus_card_t * gus)
if (gus->gf1.enh_mode) {
block.ptr = 0;
block.size = 1024;
if (gus->gf1.enh_mode) {
block.ptr = 0;
block.size = 1024;
- block.name =
snd_kmalloc_
strdup("InterWave LFOs", GFP_KERNEL);
+ block.name =
k
strdup("InterWave LFOs", GFP_KERNEL);
if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM;
}
block.ptr = gus->gf1.default_voice_address;
block.size = 4;
if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM;
}
block.ptr = gus->gf1.default_voice_address;
block.size = 4;
- block.name =
snd_kmalloc_
strdup("Voice default (NULL's)", GFP_KERNEL);
+ block.name =
k
strdup("Voice default (NULL's)", GFP_KERNEL);
if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM;
#ifdef CONFIG_SND_DEBUG
if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM;
#ifdef CONFIG_SND_DEBUG
@@
-272,10
+272,10
@@
int snd_gf1_mem_init(snd_gus_card_t * gus)
return 0;
}
return 0;
}
-int snd_gf1_mem_done(s
nd_gus_card_t
* gus)
+int snd_gf1_mem_done(s
truct snd_gus_card
* gus)
{
{
- s
nd_gf1_mem_t
*alloc;
- s
nd_gf1_mem_block_t
*block, *nblock;
+ s
truct snd_gf1_mem
*alloc;
+ s
truct snd_gf1_mem_block
*block, *nblock;
alloc = &gus->gf1.mem_alloc;
block = alloc->first;
alloc = &gus->gf1.mem_alloc;
block = alloc->first;
@@
-288,16
+288,16
@@
int snd_gf1_mem_done(snd_gus_card_t * gus)
}
#ifdef CONFIG_SND_DEBUG
}
#ifdef CONFIG_SND_DEBUG
-static void snd_gf1_mem_info_read(s
nd_info_entry_t
*entry,
- s
nd_info_buffer_t *
buffer)
+static void snd_gf1_mem_info_read(s
truct snd_info_entry
*entry,
+ s
truct snd_info_buffer *
buffer)
{
{
- s
nd_gus_card_t
*gus;
- s
nd_gf1_mem_t
*alloc;
- s
nd_gf1_mem_block_t
*block;
+ s
truct snd_gus_card
*gus;
+ s
truct snd_gf1_mem
*alloc;
+ s
truct snd_gf1_mem_block
*block;
unsigned int total, used;
int i;
unsigned int total, used;
int i;
- gus =
snd_magic_cast(snd_gus_card_t, entry->private_data, return)
;
+ gus =
entry->private_data
;
alloc = &gus->gf1.mem_alloc;
down(&alloc->memory_mutex);
snd_iprintf(buffer, "8-bit banks : \n ");
alloc = &gus->gf1.mem_alloc;
down(&alloc->memory_mutex);
snd_iprintf(buffer, "8-bit banks : \n ");