aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/emux/soundfont.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/synth/emux/soundfont.c')
-rw-r--r--sound/synth/emux/soundfont.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 36d53bd317ed..63c8f45c0c22 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -133,7 +133,7 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
133 int rc; 133 int rc;
134 134
135 if (count < (long)sizeof(patch)) { 135 if (count < (long)sizeof(patch)) {
136 snd_printk("patch record too small %ld\n", count); 136 snd_printk(KERN_ERR "patch record too small %ld\n", count);
137 return -EINVAL; 137 return -EINVAL;
138 } 138 }
139 if (copy_from_user(&patch, data, sizeof(patch))) 139 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -143,15 +143,16 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
143 data += sizeof(patch); 143 data += sizeof(patch);
144 144
145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) { 145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) {
146 snd_printk("'The wrong kind of patch' %x\n", patch.key); 146 snd_printk(KERN_ERR "The wrong kind of patch %x\n", patch.key);
147 return -EINVAL; 147 return -EINVAL;
148 } 148 }
149 if (count < patch.len) { 149 if (count < patch.len) {
150 snd_printk("Patch too short %ld, need %d\n", count, patch.len); 150 snd_printk(KERN_ERR "Patch too short %ld, need %d\n",
151 count, patch.len);
151 return -EINVAL; 152 return -EINVAL;
152 } 153 }
153 if (patch.len < 0) { 154 if (patch.len < 0) {
154 snd_printk("poor length %d\n", patch.len); 155 snd_printk(KERN_ERR "poor length %d\n", patch.len);
155 return -EINVAL; 156 return -EINVAL;
156 } 157 }
157 158
@@ -195,7 +196,8 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
195 case SNDRV_SFNT_REMOVE_INFO: 196 case SNDRV_SFNT_REMOVE_INFO:
196 /* patch must be opened */ 197 /* patch must be opened */
197 if (!sflist->currsf) { 198 if (!sflist->currsf) {
198 snd_printk("soundfont: remove_info: patch not opened\n"); 199 snd_printk(KERN_ERR "soundfont: remove_info: "
200 "patch not opened\n");
199 rc = -EINVAL; 201 rc = -EINVAL;
200 } else { 202 } else {
201 int bank, instr; 203 int bank, instr;
@@ -531,7 +533,7 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
531 return -EINVAL; 533 return -EINVAL;
532 534
533 if (count < (long)sizeof(hdr)) { 535 if (count < (long)sizeof(hdr)) {
534 printk("Soundfont error: invalid patch zone length\n"); 536 printk(KERN_ERR "Soundfont error: invalid patch zone length\n");
535 return -EINVAL; 537 return -EINVAL;
536 } 538 }
537 if (copy_from_user((char*)&hdr, data, sizeof(hdr))) 539 if (copy_from_user((char*)&hdr, data, sizeof(hdr)))
@@ -541,12 +543,14 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
541 count -= sizeof(hdr); 543 count -= sizeof(hdr);
542 544
543 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) { 545 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) {
544 printk("Soundfont error: Illegal voice number %d\n", hdr.nvoices); 546 printk(KERN_ERR "Soundfont error: Illegal voice number %d\n",
547 hdr.nvoices);
545 return -EINVAL; 548 return -EINVAL;
546 } 549 }
547 550
548 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) { 551 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
549 printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", 552 printk(KERN_ERR "Soundfont Error: "
553 "patch length(%ld) is smaller than nvoices(%d)\n",
550 count, hdr.nvoices); 554 count, hdr.nvoices);
551 return -EINVAL; 555 return -EINVAL;
552 } 556 }
@@ -952,7 +956,7 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
952 int rc; 956 int rc;
953 957
954 if (count < (long)sizeof(patch)) { 958 if (count < (long)sizeof(patch)) {
955 snd_printk("patch record too small %ld\n", count); 959 snd_printk(KERN_ERR "patch record too small %ld\n", count);
956 return -EINVAL; 960 return -EINVAL;
957 } 961 }
958 if (copy_from_user(&patch, data, sizeof(patch))) 962 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -1034,7 +1038,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1034 /* panning position; -128 - 127 => 0-127 */ 1038 /* panning position; -128 - 127 => 0-127 */
1035 zone->v.pan = (patch.panning + 128) / 2; 1039 zone->v.pan = (patch.panning + 128) / 2;
1036#if 0 1040#if 0
1037 snd_printk("gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n", 1041 snd_printk(KERN_DEBUG
1042 "gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n",
1038 (int)patch.base_freq, zone->v.rate_offset, 1043 (int)patch.base_freq, zone->v.rate_offset,
1039 zone->v.root, zone->v.tune, zone->v.low, zone->v.high); 1044 zone->v.root, zone->v.tune, zone->v.low, zone->v.high);
1040#endif 1045#endif
@@ -1068,7 +1073,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1068 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release); 1073 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release);
1069 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]); 1074 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]);
1070#if 0 1075#if 0
1071 snd_printk("gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n", 1076 snd_printk(KERN_DEBUG
1077 "gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n",
1072 zone->v.parm.volatkhld, 1078 zone->v.parm.volatkhld,
1073 zone->v.parm.voldcysus, 1079 zone->v.parm.voldcysus,
1074 zone->v.parm.volrelease, 1080 zone->v.parm.volrelease,