All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] A slightly smarter dmi_scan.c
  2001-12-25  5:23 [PATCH] A slightly smarter dmi_scan.c Ishan Oshadi Jayawardena
@ 2001-12-24 18:17 ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2001-12-24 18:17 UTC (permalink / raw)
  To: Ishan Oshadi Jayawardena; +Cc: sfr, lkml

> > APM can also be compiled as a module.
> 
> Right. Thanks. I blatantly ignored that APM can be built as modules ;(
> The fixed patch is here.

I think I prefer it without all the ifdefs being in the code like that. It is
cleaner to read before the change. I agree the messages being printed might
be confusing in some cases but I don't like the cure.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] A slightly smarter dmi_scan.c
@ 2001-12-25  5:23 Ishan Oshadi Jayawardena
  2001-12-24 18:17 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Ishan Oshadi Jayawardena @ 2001-12-25  5:23 UTC (permalink / raw)
  To: sfr, lkml

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

> APM can also be compiled as a module.

Right. Thanks. I blatantly ignored that APM can be built as modules ;(
The fixed patch is here.

Cheerio !

	- ioj

~~~~
    Ask not of race, but ask of conduct: 
    From the stick is born the sacred fire:
    The wise ascetic, though lowly born,
    Is noble in his modest self-control.
                - Gotama Buddha
.

[-- Attachment #2: dmi.patch --]
[-- Type: text/plain, Size: 1982 bytes --]

--- linux/arch/i386/kernel/dmi_scan.c	Mon Dec 24 22:50:41 2001
+++ linux/arch/i386/kernel/dmi_scan.c.c	Mon Dec 24 22:53:21 2001
@@ -255,26 +255,29 @@
 
 static __init int set_realmode_power_off(struct dmi_blacklist *d)
 {
+#if defined (CONFIG_APM) || defined (CONFIG_APM_MODULE)
        if (apm_info.realmode_power_off == 0)
        {
                apm_info.realmode_power_off = 1;
                printk(KERN_INFO "%s bios detected. Using realmode poweroff only.\n", d->ident);
        }
+#endif
        return 0;
 }
 
-
 /* 
  * Some laptops require interrupts to be enabled during APM calls 
  */
 
 static __init int set_apm_ints(struct dmi_blacklist *d)
 {
+#if defined (CONFIG_APM) || defined (CONFIG_APM_MODULE)
 	if (apm_info.allow_ints == 0)
 	{
 		apm_info.allow_ints = 1;
 		printk(KERN_INFO "%s machine detected. Enabling interrupts during APM calls.\n", d->ident);
 	}
+#endif
 	return 0;
 }
 
@@ -284,15 +287,16 @@
 
 static __init int apm_is_horked(struct dmi_blacklist *d)
 {
+#if defined (CONFIG_APM) || defined (CONFIG_APM_MODULE)
 	if (apm_info.disabled == 0)
 	{
 		apm_info.disabled = 1;
 		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
 	}
+#endif
 	return 0;
 }
 
-
 /*
  *  Check for clue free BIOS implementations who use
  *  the following QA technique
@@ -311,10 +315,12 @@
 
 static __init int broken_apm_power(struct dmi_blacklist *d)
 {
+#if defined (CONFIG_APM) || defined (CONFIG_APM_MODULE)
 	apm_info.get_power_status_broken = 1;
 	printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n");
+#endif
 	return 0;
-}		
+}
 
 /*
  * Check for a Sony Vaio system
@@ -341,8 +347,10 @@
  
 static __init int swab_apm_power_in_minutes(struct dmi_blacklist *d)
 {
+#if defined (CONFIG_APM) || defined (CONFIG_APM_MODULE)
 	apm_info.get_power_status_swabinminutes = 1;
 	printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
+#endif
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] A slightly smarter dmi_scan.c
@ 2001-12-26 16:25 Alvin of Diaspar
  0 siblings, 0 replies; 3+ messages in thread
From: Alvin of Diaspar @ 2001-12-26 16:25 UTC (permalink / raw)
  To: linux-kernel, alan

> > > APM can also be compiled as a module.
> >
> > Right. Thanks. I blatantly ignored that APM can be built as modules ;(
> > The fixed patch is here.
  
> I think I prefer it without all the ifdefs being in the code like that. It is
> cleaner to read before the change. I agree the messages being printed might
> be confusing in some cases but I don't like the cure.

	I agree. The code in dmi_scan.c runs very elegantly now, and changing
that flow, although might be more efficient by something like 0.001%,
isn't worth the touble.
	Sorry about adding to the ambient background radiation :)

	- ioj

~~~~
    Ask not of race, but ask of conduct: 
    From the stick is born the sacred fire:
    The wise ascetic, though lowly born,
    Is noble in his modest self-control.
                - Gotama Buddha
.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-26  4:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-25  5:23 [PATCH] A slightly smarter dmi_scan.c Ishan Oshadi Jayawardena
2001-12-24 18:17 ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-12-26 16:25 Alvin of Diaspar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.