aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-08-25 12:47:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-25 12:47:06 -0400
commita206e9417f19cf42156249953b72223a0076dc6b (patch)
treea4eb2fded0b3be74e529a8a916a7f7d5592f469c /sound/core
parent7cafe60550469ad80e990d9223c4b5d501635015 (diff)
parentb1ddaf681e362ed453182ddee1699d7487069a16 (diff)
Merge branch 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: sound: pcm_lib: fix unsorted list constraint handling sound: vx222: fix input level control range check ALSA: ali5451: fix timeout handling in snd_ali_{codecs,timer}_ready()
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 72cfd47af6b8..9db60d831bb2 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -943,47 +943,24 @@ static int snd_interval_ratden(struct snd_interval *i,
943int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) 943int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask)
944{ 944{
945 unsigned int k; 945 unsigned int k;
946 int changed = 0; 946 struct snd_interval list_range;
947 947
948 if (!count) { 948 if (!count) {
949 i->empty = 1; 949 i->empty = 1;
950 return -EINVAL; 950 return -EINVAL;
951 } 951 }
952 snd_interval_any(&list_range);
953 list_range.min = UINT_MAX;
954 list_range.max = 0;
952 for (k = 0; k < count; k++) { 955 for (k = 0; k < count; k++) {
953 if (mask && !(mask & (1 << k))) 956 if (mask && !(mask & (1 << k)))
954 continue; 957 continue;
955 if (i->min == list[k] && !i->openmin) 958 if (!snd_interval_test(i, list[k]))
956 goto _l1;
957 if (i->min < list[k]) {
958 i->min = list[k];
959 i->openmin = 0;
960 changed = 1;
961 goto _l1;
962 }
963 }
964 i->empty = 1;
965 return -EINVAL;
966 _l1:
967 for (k = count; k-- > 0;) {
968 if (mask && !(mask & (1 << k)))
969 continue; 959 continue;
970 if (i->max == list[k] && !i->openmax) 960 list_range.min = min(list_range.min, list[k]);
971 goto _l2; 961 list_range.max = max(list_range.max, list[k]);
972 if (i->max > list[k]) {
973 i->max = list[k];
974 i->openmax = 0;
975 changed = 1;
976 goto _l2;
977 }
978 } 962 }
979 i->empty = 1; 963 return snd_interval_refine(i, &list_range);
980 return -EINVAL;
981 _l2:
982 if (snd_interval_checkempty(i)) {
983 i->empty = 1;
984 return -EINVAL;
985 }
986 return changed;
987} 964}
988 965
989EXPORT_SYMBOL(snd_interval_list); 966EXPORT_SYMBOL(snd_interval_list);