public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: ACPI mailing list
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Rusty trivial patch monkey Russell
	<trivial-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
Subject: Teach acpi how to get power-of-two
Date: Sat, 28 Feb 2004 16:44:44 +0100	[thread overview]
Message-ID: <20040228154444.GA10309@elf.ucw.cz> (raw)

Hi!

I do not know why ACPI people did this... computing 1<<x using lookup
table. Its not even funny. Please apply,


								Pavel

--- tmp/linux/drivers/acpi/processor.c	2004-02-20 12:29:21.000000000 +0100
+++ linux/drivers/acpi/processor.c	2004-02-28 15:30:52.000000000 +0100
@@ -66,9 +66,6 @@
 #define C2_OVERHEAD			4	/* 1us (3.579 ticks per us) */
 #define C3_OVERHEAD			4	/* 1us (3.579 ticks per us) */
 
-
-const u32 POWER_OF_2[] = {1,2,4,8,16,32,64};
-
 #define ACPI_PROCESSOR_LIMIT_USER	0
 #define ACPI_PROCESSOR_LIMIT_THERMAL	1
 
@@ -1489,7 +1486,7 @@
 		return_VALUE(0);
 	}
 
-	pr->throttling.state_count = POWER_OF_2[acpi_fadt.duty_width];
+	pr->throttling.state_count = 1<<acpi_fadt.duty_width;
 
 	/*
 	 * Compute state values. Note that throttling displays a linear power/

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

                 reply	other threads:[~2004-02-28 15:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040228154444.GA10309@elf.ucw.cz \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=trivial-8n+1lVoiYb80n/F98K4Iww@public.gmane.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