public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alvin of Diaspar <ioshadi@sltnet.lk>
To: linux-kernel@vger.kernel.org
Cc: james@and.org
Subject: [patch] A slightly smarter dmi_scan.c ?
Date: Mon, 31 Dec 2001 11:26:09 -0600	[thread overview]
Message-ID: <3C309FB1.63544633@sltnet.lk> (raw)

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

Greetings everyone,

	OK. This is the last thing of this nature I'm going to submit... After
all, I started this. No need to take this above informal spring
cleaning...
	James, Alan is right. No need for #ifdef's *when* (and only when)
there's a better way to do it. Thanks.

This is against 2.4.17.

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

--- linux/arch/i386/kernel/dmi_scan.c	Mon Dec 31 10:52:52 2001
+++ linux/arch/i386/kernel/dmi_scan.c.mod	Mon Dec 31 11:12:10 2001
@@ -256,7 +256,7 @@ static __init int set_smp_bios_reboot(st
 
 static __init int set_realmode_power_off(struct dmi_blacklist *d)
 {
-       if (apm_info.realmode_power_off == 0)
+       if (apm_info.bios.version && (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);
@@ -271,7 +271,7 @@ static __init int set_realmode_power_off
 
 static __init int set_apm_ints(struct dmi_blacklist *d)
 {
-	if (apm_info.allow_ints == 0)
+	if (apm_info.bios.version && (apm_info.allow_ints == 0))
 	{
 		apm_info.allow_ints = 1;
 		printk(KERN_INFO "%s machine detected. Enabling interrupts during APM calls.\n", d->ident);
@@ -285,7 +285,7 @@ static __init int set_apm_ints(struct dm
 
 static __init int apm_is_horked(struct dmi_blacklist *d)
 {
-	if (apm_info.disabled == 0)
+	if (apm_info.bios.version && (apm_info.disabled == 0))
 	{
 		apm_info.disabled = 1;
 		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
@@ -342,8 +342,10 @@ static __init int sony_vaio_laptop(struc
  
 static __init int swab_apm_power_in_minutes(struct dmi_blacklist *d)
 {
-	apm_info.get_power_status_swabinminutes = 1;
-	printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
+	if (apm_info.bios.version) {
+		apm_info.get_power_status_swabinminutes = 1;
+		printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
+	}
 	return 0;
 }
 

             reply	other threads:[~2001-12-31  5:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-31 17:26 Alvin of Diaspar [this message]
2001-12-31 13:23 ` [patch] A slightly smarter dmi_scan.c ? Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C309FB1.63544633@sltnet.lk \
    --to=ioshadi@sltnet.lk \
    --cc=james@and.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox