check return code for request_region() in gus_wave.c
Subsystems (2)
PATCH 1/1 check return code for request_region() in gus_wave.c
This is an attempt to handle return code of request_region() in 2 places in gus_wave.c
Tested by compiling using the option: make dir/ (is this OK?).
sound/oss/gus_wave.c +3 -5
@@ -2938,8 +2938,7 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -if (!request_region (u_MixSelect,1 ,"GUS mixer" )) -return ; +request_region (u_MixSelect,1 ,"GUS mixer" ); }else {
@@ -3030,7 +3029,7 @@ void __init gus_wave_init(struct address samples = (struct patch_info *)vmalloc ((MAX_SAMPLE +1 ) *sizeof (*samples));if (samples =NULL ) { -printk (KERN_WARNING "gus_init: Cannot allocate memory for instrument tables\n" ); +printk (KERN_WARNING "gus_init: Cant allocate memory for instrument tables\n" );return ; }conf_printf (tmp, hw_config);
@@ -3085,8 +3084,7 @@ void __init gus_wave_init(struct addresscase ICS2101 : gus_mic_vol = gus_line_vol = gus_pcm_volume =100 ; gus_wave_volume =90 ; -if (!request_region (u_MixSelect,1 ,"GUS mixer" )) -return ; +request_region (u_MixSelect,1 ,"GUS mixer" ); hw_config->slots[5 ] =ics2101_mixer_init (); audio_devs[gus_devnum]->mixer_dev = hw_config->slots[5 ];/* Next mixer# */ return ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
PATCH 1/1 check return code for request_region() in gus_wave.c
Sorry, ignore the previous message. This is the correct patch.
sound/oss/gus_wave.c +5 -3
@@ -2938,7 +2938,8 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) +return ; }else {
@@ -3029,7 +3030,7 @@ void __init gus_wave_init(struct address samples = (struct patch_info *)vmalloc ((MAX_SAMPLE +1 ) *sizeof (*samples));if (samples =NULL ) { -printk (KERN_WARNING "gus_init: Cant allocate memory for instrument tables\n" ); +printk (KERN_WARNING "gus_init: Cannot allocate memory for instrument tables\n" );return ; }conf_printf (tmp, hw_config);
@@ -3084,7 +3085,8 @@ void __init gus_wave_init(struct addresscase ICS2101 : gus_mic_vol = gus_line_vol = gus_pcm_volume =100 ; gus_wave_volume =90 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) +return ; hw_config->slots[5 ] =ics2101_mixer_init (); audio_devs[gus_devnum]->mixer_dev = hw_config->slots[5 ];/* Next mixer# */ return ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Re: [KJ] [PATCH] check return code for request_region()
In reply to Hashem MasoudQuoted 1 line · Hashem Masoud
Sorry, ignore the previous message. This is the correct patch.
Still not correct ;-).
Please read
1. www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
2. Documentation/SubmittingPatches
sound/oss/gus_wave.c void __init gus_wave_init(struct address · line 2942
Quoted 12 lines
Signed-off-by Hashem Masoud <[email protected]>sound/oss/gus_wave.c +2
-1@@ -2938,7 +2938,8 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) +return ;
You way want to add a printk before returning
sound/oss/gus_wave.c void __init gus_wave_init(struct address · line 3033
Quoted 9 lines
sound/oss/gus_wave.c +1
-1}else {@@ -3029,7 +3030,7 @@ void __init gus_wave_init(struct address samples = (struct patch_info *)vmalloc ((MAX_SAMPLE +1 ) *sizeof (*samples));if (samples =NULL ) { -printk (KERN_WARNING "gus_init: Cant allocate memory for instrument tables\n" ); +printk (KERN_WARNING "gus_init: Cannot allocate memory for instrument tables\n" );
This change has nothing to do with request_region. One _logical_ change per patch
Quoted 14 lines
sound/oss/gus_wave.c +2
-1return ; }conf_printf (tmp, hw_config);@@ -3084,7 +3085,8 @@ void __init gus_wave_init(struct addresscase ICS2101 : gus_mic_vol = gus_line_vol = gus_pcm_volume =100 ; gus_wave_volume =90 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) +return ; hw_config->slots[5 ] =ics2101_mixer_init (); audio_devs[gus_devnum]->mixer_dev = hw_config->slots[5 ];/* Next mixer# */ return ;
Quoted 6 lines
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
PATCH 1/1 check return code for request_region() in gus_wave.c
In reply to Hashem MasoudThanks for your directions. The following is the newest attempt (sorry, without compilation as my time is short!)
--- gus_wave.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
---
sound/oss/gus_wave.c +8 -2
@@ -2938,7 +2938,10 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); + if !(request_region(u_MixSelect, 1, "GUS mixer")) { +printk (KERN_ERR "request_region failed\n" ); +return ; + } }else {
@@ -3084,7 +3087,10 @@ void __init gus_wave_init(struct addresscase ICS2101 : gus_mic_vol = gus_line_vol = gus_pcm_volume =100 ; gus_wave_volume =90 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) { +printk (KERN_ERR "request_region failed\n" ); +return ; + } hw_config->slots[5 ] =ics2101_mixer_init (); audio_devs[gus_devnum]->mixer_dev = hw_config->slots[5 ];/* Next mixer# */ return ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Re: [KJ] [PATCH] check return code for request_region() in
In reply to Hashem MasoudQuoted 3 lines · Hashem Masoud
Thanks for your directions. The following is the newest attempt (sorry, without compilation as my time is short!)
If you don't even have time to test compile your changes then you are in too much of a hurry ...
Quoted 9 lines
Signed-off-by Hashem Masoud <[email protected]>--- gus_wave.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)---
diff -urplinux-2.6.17.13/sound/oss/gus_wave.clinux/sound/oss/gus_wave.c
sound/oss/gus_wave.c 2006-09-28 20:17:41.093694160 -0300 void __init gus_wave_init(struct address · line 2941
Quoted 5 lines
sound/oss/gus_wave.c 2006-09-28 20:17:41.093694160 -0300 renamed from sound/oss/gus_wave.c 2006-09-27 19:03:42.000000000 -0300 +1
-1@@ -2938,7 +2938,10 @@ void __init gus_wave_init(struct address model_num = "3.7"; gus_type = 0x37; mixer_type = ICS2101; - request_region(u_MixSelect, 1, "GUS mixer"); + if !(request_region(u_MixSelect, 1, "GUS mixer")) {
... and it shows ^^^^^
Please take the time to do minimal testing. Not doing so is a waste of a lot of peoples time.
Signature · 7 lines
Jesper Juhl <[email protected]> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors
Re: [KJ] [PATCH] check return code for request_region() in
In reply to Hashem MasoudQuoted 11 lines · Jesper Juhl
sound/oss/gus_wave.c void __init gus_wave_init(struct address · line 2942
Quoted 8 lines
+++
linux/sound/oss/gus_wave.c2006-09-28 20:17:41.093694160 -0300sound/oss/gus_wave.c +1
-1@@ -2938,7 +2938,10 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); + if !(request_region(u_MixSelect, 1, "GUS mixer")) {... and it shows ^^^^^
BTW, Google web mail access automatically translates tabs into spaces, but if you download your e-mails using POP access this won't happen. Also, check the patch posted to list, it is intact: http://lists.osdl.org/pipermail/kernel-janitors/2006-September/007352.html
Quoted 5 lines
Please take the time to do minimal testing. Not doing so is a waste of a lot of peoples time.
Thanks. I Tested the 2 previous patches through make allmodconfig and make sound/oss/ .
Signature · 5 lines
Hashem Masoud _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors
Re: [KJ] [PATCH] check return code for request_region() in
In reply to Hashem MasoudQuoted 14 lines · Hashem Masoud
Quoted 11 lines · Jesper Juhl
sound/oss/gus_wave.c void __init gus_wave_init(struct address · line 2942
Quoted 8 lines
+++
linux/sound/oss/gus_wave.c2006-09-28 20:17:41.093694160 -0300sound/oss/gus_wave.c +1
-1@@ -2938,7 +2938,10 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); + if !(request_region(u_MixSelect, 1, "GUS mixer")) {... and it shows ^^^^^
Quoted 1 line
BTW, Google web mail access automatically translates tabs into spaces, but if you download your e-mails using POP access this won't happen.
I'm quite aware of that. That's not what I was talking about, and btw, you'll notice that any mails I send with patches I do *not* send via the gmail webinterface...
Now, what I *was* talking about was this bit of your patch: "if !(request_region"
That should have been "if (!request_region"
Quoted 1 line
Also, check the patch posted to list, it is intact:
Again, that's not what I was talking about..
Signature · 7 lines
Jesper Juhl <[email protected]> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors
Re: [KJ] [PATCH] check return code for request_region() in
In reply to Hashem MasoudQuoted 3 lines
Now, what I *was* talking about was this bit of your patch: "if !(request_region"
That should have been "if (!request_region"
This is a corrected patch compile-tested with allmodconfig and make sound/oss/ .
--- gus_wave.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
---
sound/oss/gus_wave.c +8 -2
@@ -2938,7 +2938,10 @@ void __init gus_wave_init(struct address model_num ="3.7" ; gus_type =0x37 ; mixer_type =ICS2101 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) { +printk (KERN_ERR "request_region failed\n" ); +return ; + } }else {
@@ -3084,7 +3087,10 @@ void __init gus_wave_init(struct addresscase ICS2101 : gus_mic_vol = gus_line_vol = gus_pcm_volume =100 ; gus_wave_volume =90 ; -request_region (u_MixSelect,1 ,"GUS mixer" ); +if (!request_region (u_MixSelect,1 ,"GUS mixer" )) { +printk (KERN_ERR "request_region failed\n" ); +return ; + } hw_config->slots[5 ] =ics2101_mixer_init (); audio_devs[gus_devnum]->mixer_dev = hw_config->slots[5 ];/* Next mixer# */ return ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors