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
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
core
/
seq
/
seq_instr.c
diff --git
a/sound/core/seq/seq_instr.c
b/sound/core/seq/seq_instr.c
index
3151967
..
f30d171
100644
(file)
--- a/
sound/core/seq/seq_instr.c
+++ b/
sound/core/seq/seq_instr.c
@@
-31,36
+31,36
@@
MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer instrument libra
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
-static void snd_instr_lock_ops(s
nd_seq_kinstr_list_
t *list)
+static void snd_instr_lock_ops(s
truct snd_seq_kinstr_lis
t *list)
{
if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) {
spin_lock_irqsave(&list->ops_lock, list->ops_flags);
} else {
{
if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) {
spin_lock_irqsave(&list->ops_lock, list->ops_flags);
} else {
-
down
(&list->ops_mutex);
+
mutex_lock
(&list->ops_mutex);
}
}
}
}
-static void snd_instr_unlock_ops(s
nd_seq_kinstr_list_
t *list)
+static void snd_instr_unlock_ops(s
truct snd_seq_kinstr_lis
t *list)
{
if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) {
spin_unlock_irqrestore(&list->ops_lock, list->ops_flags);
} else {
{
if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) {
spin_unlock_irqrestore(&list->ops_lock, list->ops_flags);
} else {
-
up
(&list->ops_mutex);
+
mutex_unlock
(&list->ops_mutex);
}
}
}
}
-static s
nd_seq_kinstr_t
*snd_seq_instr_new(int add_len, int atomic)
+static s
truct snd_seq_kinstr
*snd_seq_instr_new(int add_len, int atomic)
{
{
- s
nd_seq_kinstr_t
*instr;
+ s
truct snd_seq_kinstr
*instr;
- instr = k
calloc(1, sizeof(snd_seq_kinstr_t
) + add_len, atomic ? GFP_ATOMIC : GFP_KERNEL);
+ instr = k
zalloc(sizeof(struct snd_seq_kinstr
) + add_len, atomic ? GFP_ATOMIC : GFP_KERNEL);
if (instr == NULL)
return NULL;
instr->add_len = add_len;
return instr;
}
if (instr == NULL)
return NULL;
instr->add_len = add_len;
return instr;
}
-static int snd_seq_instr_free(s
nd_seq_kinstr_t
*instr, int atomic)
+static int snd_seq_instr_free(s
truct snd_seq_kinstr
*instr, int atomic)
{
int result = 0;
{
int result = 0;
@@
-73,25
+73,25
@@
static int snd_seq_instr_free(snd_seq_kinstr_t *instr, int atomic)
return result;
}
return result;
}
-s
nd_seq_kinstr_list_
t *snd_seq_instr_list_new(void)
+s
truct snd_seq_kinstr_lis
t *snd_seq_instr_list_new(void)
{
{
- s
nd_seq_kinstr_list_
t *list;
+ s
truct snd_seq_kinstr_lis
t *list;
- list = k
calloc(1, sizeof(snd_seq_kinstr_list_
t), GFP_KERNEL);
+ list = k
zalloc(sizeof(struct snd_seq_kinstr_lis
t), GFP_KERNEL);
if (list == NULL)
return NULL;
spin_lock_init(&list->lock);
spin_lock_init(&list->ops_lock);
if (list == NULL)
return NULL;
spin_lock_init(&list->lock);
spin_lock_init(&list->ops_lock);
-
init_MUTEX
(&list->ops_mutex);
+
mutex_init
(&list->ops_mutex);
list->owner = -1;
return list;
}
list->owner = -1;
return list;
}
-void snd_seq_instr_list_free(s
nd_seq_kinstr_list_
t **list_ptr)
+void snd_seq_instr_list_free(s
truct snd_seq_kinstr_lis
t **list_ptr)
{
{
- s
nd_seq_kinstr_list_
t *list;
- s
nd_seq_kinstr_t
*instr;
- s
nd_seq_kcluster_t
*cluster;
+ s
truct snd_seq_kinstr_lis
t *list;
+ s
truct snd_seq_kinstr
*instr;
+ s
truct snd_seq_kcluster
*cluster;
int idx;
unsigned long flags;
int idx;
unsigned long flags;
@@
-109,8
+109,7
@@
void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr)
spin_lock_irqsave(&list->lock, flags);
while (instr->use) {
spin_unlock_irqrestore(&list->lock, flags);
spin_lock_irqsave(&list->lock, flags);
while (instr->use) {
spin_unlock_irqrestore(&list->lock, flags);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
+ schedule_timeout_interruptible(1);
spin_lock_irqsave(&list->lock, flags);
}
spin_unlock_irqrestore(&list->lock, flags);
spin_lock_irqsave(&list->lock, flags);
}
spin_unlock_irqrestore(&list->lock, flags);
@@
-126,8
+125,8
@@
void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr)
kfree(list);
}
kfree(list);
}
-static int instr_free_compare(s
nd_seq_kinstr_t
*instr,
- s
nd_seq_instr_header_t
*ifree,
+static int instr_free_compare(s
truct snd_seq_kinstr
*instr,
+ s
truct snd_seq_instr_header
*ifree,
unsigned int client)
{
switch (ifree->cmd) {
unsigned int client)
{
switch (ifree->cmd) {
@@
-161,12
+160,12
@@
static int instr_free_compare(snd_seq_kinstr_t *instr,
return 1;
}
return 1;
}
-int snd_seq_instr_list_free_cond(s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_instr_header_t
*ifree,
+int snd_seq_instr_list_free_cond(s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_instr_header
*ifree,
int client,
int atomic)
{
int client,
int atomic)
{
- s
nd_seq_kinstr_t
*instr, *prev, *next, *flist;
+ s
truct snd_seq_kinstr
*instr, *prev, *next, *flist;
int idx;
unsigned long flags;
int idx;
unsigned long flags;
@@
-199,10
+198,8
@@
int snd_seq_instr_list_free_cond(snd_seq_kinstr_list_t *list,
while (flist) {
instr = flist;
flist = instr->next;
while (flist) {
instr = flist;
flist = instr->next;
- while (instr->use) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while (instr->use)
+ schedule_timeout_interruptible(1);
if (snd_seq_instr_free(instr, atomic)<0)
snd_printk(KERN_WARNING "instrument free problem\n");
instr = next;
if (snd_seq_instr_free(instr, atomic)<0)
snd_printk(KERN_WARNING "instrument free problem\n");
instr = next;
@@
-212,7
+209,7
@@
int snd_seq_instr_list_free_cond(snd_seq_kinstr_list_t *list,
return 0;
}
return 0;
}
-static int compute_hash_instr_key(s
nd_seq_instr_t
*instr)
+static int compute_hash_instr_key(s
truct snd_seq_instr
*instr)
{
int result;
{
int result;
@@
-236,7
+233,7
@@
static int compute_hash_cluster_key(snd_seq_instr_cluster_t cluster)
}
#endif
}
#endif
-static int compare_instr(s
nd_seq_instr_t *i1, snd_seq_instr_t
*i2, int exact)
+static int compare_instr(s
truct snd_seq_instr *i1, struct snd_seq_instr
*i2, int exact)
{
if (exact) {
if (i1->cluster != i2->cluster ||
{
if (exact) {
if (i1->cluster != i2->cluster ||
@@
-265,14
+262,14
@@
static int compare_instr(snd_seq_instr_t *i1, snd_seq_instr_t *i2, int exact)
}
}
}
}
-s
nd_seq_kinstr_t *snd_seq_instr_find(snd_seq_kinstr_list_
t *list,
-
snd_seq_instr_t
*instr,
- int exact,
- int follow_alias)
+s
truct snd_seq_kinstr *snd_seq_instr_find(struct snd_seq_kinstr_lis
t *list,
+
struct snd_seq_instr
*instr,
+
int exact,
+
int follow_alias)
{
unsigned long flags;
int depth = 0;
{
unsigned long flags;
int depth = 0;
- s
nd_seq_kinstr_t
*result;
+ s
truct snd_seq_kinstr
*result;
if (list == NULL || instr == NULL)
return NULL;
if (list == NULL || instr == NULL)
return NULL;
@@
-282,7
+279,7
@@
snd_seq_kinstr_t *snd_seq_instr_find(snd_seq_kinstr_list_t *list,
while (result) {
if (!compare_instr(&result->instr, instr, exact)) {
if (follow_alias && (result->type == SNDRV_SEQ_INSTR_ATYPE_ALIAS)) {
while (result) {
if (!compare_instr(&result->instr, instr, exact)) {
if (follow_alias && (result->type == SNDRV_SEQ_INSTR_ATYPE_ALIAS)) {
- instr = (s
nd_seq_instr_t
*)KINSTR_DATA(result);
+ instr = (s
truct snd_seq_instr
*)KINSTR_DATA(result);
if (++depth > 10)
goto __not_found;
goto __again;
if (++depth > 10)
goto __not_found;
goto __again;
@@
-298,8
+295,8
@@
snd_seq_kinstr_t *snd_seq_instr_find(snd_seq_kinstr_list_t *list,
return NULL;
}
return NULL;
}
-void snd_seq_instr_free_use(s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_kinstr_t
*instr)
+void snd_seq_instr_free_use(s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_kinstr
*instr)
{
unsigned long flags;
{
unsigned long flags;
@@
-314,7
+311,8
@@
void snd_seq_instr_free_use(snd_seq_kinstr_list_t *list,
spin_unlock_irqrestore(&list->lock, flags);
}
spin_unlock_irqrestore(&list->lock, flags);
}
-static snd_seq_kinstr_ops_t *instr_ops(snd_seq_kinstr_ops_t *ops, char *instr_type)
+static struct snd_seq_kinstr_ops *instr_ops(struct snd_seq_kinstr_ops *ops,
+ char *instr_type)
{
while (ops) {
if (!strcmp(ops->instr_type, instr_type))
{
while (ops) {
if (!strcmp(ops->instr_type, instr_type))
@@
-324,11
+322,11
@@
static snd_seq_kinstr_ops_t *instr_ops(snd_seq_kinstr_ops_t *ops, char *instr_ty
return NULL;
}
return NULL;
}
-static int instr_result(s
nd_seq_event_
t *ev,
+static int instr_result(s
truct snd_seq_even
t *ev,
int type, int result,
int atomic)
{
int type, int result,
int atomic)
{
- s
nd_seq_event_
t sev;
+ s
truct snd_seq_even
t sev;
memset(&sev, 0, sizeof(sev));
sev.type = SNDRV_SEQ_EVENT_RESULT;
memset(&sev, 0, sizeof(sev));
sev.type = SNDRV_SEQ_EVENT_RESULT;
@@
-348,9
+346,9
@@
static int instr_result(snd_seq_event_t *ev,
return snd_seq_kernel_client_dispatch(sev.source.client, &sev, atomic, 0);
}
return snd_seq_kernel_client_dispatch(sev.source.client, &sev, atomic, 0);
}
-static int instr_begin(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_begin(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
unsigned long flags;
int atomic, int hop)
{
unsigned long flags;
@@
-365,9
+363,9
@@
static int instr_begin(snd_seq_kinstr_ops_t *ops,
return instr_result(ev, SNDRV_SEQ_EVENT_INSTR_BEGIN, 0, atomic);
}
return instr_result(ev, SNDRV_SEQ_EVENT_INSTR_BEGIN, 0, atomic);
}
-static int instr_end(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_end(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
unsigned long flags;
int atomic, int hop)
{
unsigned long flags;
@@
-383,54
+381,55
@@
static int instr_end(snd_seq_kinstr_ops_t *ops,
return instr_result(ev, SNDRV_SEQ_EVENT_INSTR_END, -EINVAL, atomic);
}
return instr_result(ev, SNDRV_SEQ_EVENT_INSTR_END, -EINVAL, atomic);
}
-static int instr_info(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_info(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_format_info(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_format_info(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_reset(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_reset(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_status(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_status(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_put(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_put(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
unsigned long flags;
int atomic, int hop)
{
unsigned long flags;
- s
nd_seq_instr_header_t
put;
- s
nd_seq_kinstr_t
*instr;
+ s
truct snd_seq_instr_header
put;
+ s
truct snd_seq_kinstr
*instr;
int result = -EINVAL, len, key;
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARUSR)
goto __return;
int result = -EINVAL, len, key;
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARUSR)
goto __return;
- if (ev->data.ext.len < sizeof(s
nd_seq_instr_header_t
))
+ if (ev->data.ext.len < sizeof(s
truct snd_seq_instr_header
))
goto __return;
goto __return;
- if (copy_from_user(&put, ev->data.ext.ptr, sizeof(snd_seq_instr_header_t))) {
+ if (copy_from_user(&put, (void __user *)ev->data.ext.ptr,
+ sizeof(struct snd_seq_instr_header))) {
result = -EFAULT;
goto __return;
}
result = -EFAULT;
goto __return;
}
@@
-452,7
+451,7
@@
static int instr_put(snd_seq_kinstr_ops_t *ops,
}
len = ops->add_len;
if (put.data.type == SNDRV_SEQ_INSTR_ATYPE_ALIAS)
}
len = ops->add_len;
if (put.data.type == SNDRV_SEQ_INSTR_ATYPE_ALIAS)
- len = sizeof(s
nd_seq_instr_t
);
+ len = sizeof(s
truct snd_seq_instr
);
instr = snd_seq_instr_new(len, atomic);
if (instr == NULL) {
snd_instr_unlock_ops(list);
instr = snd_seq_instr_new(len, atomic);
if (instr == NULL) {
snd_instr_unlock_ops(list);
@@
-466,8
+465,8
@@
static int instr_put(snd_seq_kinstr_ops_t *ops,
if (instr->type == SNDRV_SEQ_INSTR_ATYPE_DATA) {
result = ops->put(ops->private_data,
instr,
if (instr->type == SNDRV_SEQ_INSTR_ATYPE_DATA) {
result = ops->put(ops->private_data,
instr,
-
ev->data.ext.ptr + sizeof(snd_seq_instr_header_t
),
- ev->data.ext.len - sizeof(s
nd_seq_instr_header_t
),
+
(void __user *)ev->data.ext.ptr + sizeof(struct snd_seq_instr_header
),
+ ev->data.ext.len - sizeof(s
truct snd_seq_instr_header
),
atomic,
put.cmd);
if (result < 0) {
atomic,
put.cmd);
if (result < 0) {
@@
-489,21
+488,21
@@
static int instr_put(snd_seq_kinstr_ops_t *ops,
return result;
}
return result;
}
-static int instr_get(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_get(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_free(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_free(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
int atomic, int hop)
{
- s
nd_seq_instr_header_t
ifree;
- s
nd_seq_kinstr_t
*instr, *prev;
+ s
truct snd_seq_instr_header
ifree;
+ s
truct snd_seq_kinstr
*instr, *prev;
int result = -EINVAL;
unsigned long flags;
unsigned int hash;
int result = -EINVAL;
unsigned long flags;
unsigned int hash;
@@
-511,9
+510,10
@@
static int instr_free(snd_seq_kinstr_ops_t *ops,
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARUSR)
goto __return;
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARUSR)
goto __return;
- if (ev->data.ext.len < sizeof(s
nd_seq_instr_header_t
))
+ if (ev->data.ext.len < sizeof(s
truct snd_seq_instr_header
))
goto __return;
goto __return;
- if (copy_from_user(&ifree, ev->data.ext.ptr, sizeof(snd_seq_instr_header_t))) {
+ if (copy_from_user(&ifree, (void __user *)ev->data.ext.ptr,
+ sizeof(struct snd_seq_instr_header))) {
result = -EFAULT;
goto __return;
}
result = -EFAULT;
goto __return;
}
@@
-551,11
+551,11
@@
static int instr_free(snd_seq_kinstr_ops_t *ops,
list->hash[hash] = instr->next;
}
if (instr->ops && instr->ops->notify)
list->hash[hash] = instr->next;
}
if (instr->ops && instr->ops->notify)
- instr->ops->notify(instr->ops->private_data, instr, SNDRV_SEQ_INSTR_NOTIFY_REMOVE);
+ instr->ops->notify(instr->ops->private_data, instr,
+ SNDRV_SEQ_INSTR_NOTIFY_REMOVE);
while (instr->use) {
spin_unlock_irqrestore(&list->lock, flags);
while (instr->use) {
spin_unlock_irqrestore(&list->lock, flags);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
+ schedule_timeout_interruptible(1);
spin_lock_irqsave(&list->lock, flags);
}
spin_unlock_irqrestore(&list->lock, flags);
spin_lock_irqsave(&list->lock, flags);
}
spin_unlock_irqrestore(&list->lock, flags);
@@
-569,25
+569,25
@@
static int instr_free(snd_seq_kinstr_ops_t *ops,
return result;
}
return result;
}
-static int instr_list(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_list(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-static int instr_cluster(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+static int instr_cluster(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int atomic, int hop)
{
return -ENXIO;
}
int atomic, int hop)
{
return -ENXIO;
}
-int snd_seq_instr_event(s
nd_seq_kinstr_ops_t
*ops,
- s
nd_seq_kinstr_list_
t *list,
- s
nd_seq_event_
t *ev,
+int snd_seq_instr_event(s
truct snd_seq_kinstr_ops
*ops,
+ s
truct snd_seq_kinstr_lis
t *list,
+ s
truct snd_seq_even
t *ev,
int client,
int atomic,
int hop)
int client,
int atomic,
int hop)