* [PATCH 2.5.56] Sound core not compiling without /proc support
@ 2003-01-12 12:00 Paul Rolland
2003-01-12 12:56 ` Sam Ravnborg
2003-01-12 13:59 ` Jaroslav Kysela
0 siblings, 2 replies; 4+ messages in thread
From: Paul Rolland @ 2003-01-12 12:00 UTC (permalink / raw)
To: linux-kernel, Perex; +Cc: rol
Hello,
Here is a quick patch to allow sound support to compile correctly
when not using /proc support.
Regards,
Paul Rolland, rol@as2917.net
15 [12:53] rol@donald:/kernels> diff -uN linux-2.5.56/sound/core/init.c
linux-2.5.56-work/sound/core/init.c
--- linux-2.5.56/sound/core/init.c 2003-01-10 21:11:28.000000000
+0100
+++ linux-2.5.56-work/sound/core/init.c 2003-01-12 12:52:13.000000000
+0100
@@ -115,16 +115,20 @@
snd_printd("unable to register control minors\n");
goto __error;
}
+#ifdef CONFIG_PROC_FS
if ((err = snd_info_card_create(card)) < 0) {
snd_printd("unable to create card info\n");
goto __error_ctl;
}
+#endif
if (extra_size > 0)
card->private_data = (char *)card + sizeof(snd_card_t);
return card;
+#ifdef CONFIG_PROC_FS
__error_ctl:
snd_ctl_unregister(card);
+#endif
__error:
kfree(card);
return NULL;
@@ -273,10 +277,12 @@
if (card->private_free)
card->private_free(card);
snd_info_free_entry(card->proc_id);
+#ifdef CONFIG_PROC_FS
if (snd_info_card_free(card) < 0) {
snd_printk(KERN_WARNING "unable to free card info\n");
/* Not fatal error */
}
+#endif
while (card->s_f_ops) {
s_f_ops = card->s_f_ops;
card->s_f_ops = s_f_ops->next;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 2.5.56] Sound core not compiling without /proc support
2003-01-12 12:00 [PATCH 2.5.56] Sound core not compiling without /proc support Paul Rolland
@ 2003-01-12 12:56 ` Sam Ravnborg
2003-01-12 13:59 ` Jaroslav Kysela
1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2003-01-12 12:56 UTC (permalink / raw)
To: Paul Rolland; +Cc: linux-kernel, Perex, rol
On Sun, Jan 12, 2003 at 01:00:40PM +0100, Paul Rolland wrote:
> Hello,
>
> Here is a quick patch to allow sound support to compile correctly
> when not using /proc support.
You are making all users of functions manipulating /proc condentional.
A simpler approach would be to make the functions that actually
minipulate /proc conditional.
For example snd_info_card_create() could be a noop if CONFIG_PROC_FS
is not defined.
Then you minimize the number of #ifdef's, and they are placed logically
where they belongs.
Furhtermore you make less code conditional which imply that the execution
path - and thus code getting more test - is more similar for the two cases.
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.56] Sound core not compiling without /proc support
2003-01-12 12:00 [PATCH 2.5.56] Sound core not compiling without /proc support Paul Rolland
2003-01-12 12:56 ` Sam Ravnborg
@ 2003-01-12 13:59 ` Jaroslav Kysela
2003-01-12 14:15 ` Paul Rolland
1 sibling, 1 reply; 4+ messages in thread
From: Jaroslav Kysela @ 2003-01-12 13:59 UTC (permalink / raw)
To: Paul Rolland; +Cc: linux-kernel@vger.kernel.org, Perex@suze.cz, rol@as2917.net
On Sun, 12 Jan 2003, Paul Rolland wrote:
> Hello,
>
> Here is a quick patch to allow sound support to compile correctly
> when not using /proc support.
It's a bad fix. The null function declarations should go to
include/sound/info.h.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.56] Sound core not compiling without /proc support
2003-01-12 13:59 ` Jaroslav Kysela
@ 2003-01-12 14:15 ` Paul Rolland
0 siblings, 0 replies; 4+ messages in thread
From: Paul Rolland @ 2003-01-12 14:15 UTC (permalink / raw)
To: 'Jaroslav Kysela'; +Cc: linux-kernel, Perex, rol
Hello,
> > Here is a quick patch to allow sound support to compile
> correctly when
> > not using /proc support.
>
> It's a bad fix. The null function declarations should go to
> include/sound/info.h.
>
As I wrote, it is a "quick fix".
Sure there are better way to do it, my intention was mainly :
- to mention the problem,
- give a quick (though dirty) workaround for people missing it.
Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-12 14:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-12 12:00 [PATCH 2.5.56] Sound core not compiling without /proc support Paul Rolland
2003-01-12 12:56 ` Sam Ravnborg
2003-01-12 13:59 ` Jaroslav Kysela
2003-01-12 14:15 ` Paul Rolland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox