vserver 1.9.5.x5
[linux-2.6.git] / drivers / acpi / utilities / utmath.c
index 573176c..2525c1a 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2004, R. Byron Moore
+ * Copyright (C) 2000 - 2005, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
  *
  * FUNCTION:    acpi_ut_short_divide
  *
- * PARAMETERS:  in_dividend         - Pointer to the dividend
+ * PARAMETERS:  Dividend            - 64-bit dividend
  *              Divisor             - 32-bit divisor
  *              out_quotient        - Pointer to where the quotient is returned
  *              out_remainder       - Pointer to where the remainder is returned
 
 acpi_status
 acpi_ut_short_divide (
-       acpi_integer                    *in_dividend,
+       acpi_integer                    dividend,
        u32                             divisor,
        acpi_integer                    *out_quotient,
        u32                             *out_remainder)
 {
-       union uint64_overlay            dividend;
+       union uint64_overlay            dividend_ovl;
        union uint64_overlay            quotient;
        u32                             remainder32;
 
 
        ACPI_FUNCTION_TRACE ("ut_short_divide");
 
-       dividend.full = *in_dividend;
 
        /* Always check for a zero divisor */
 
@@ -95,13 +94,15 @@ acpi_ut_short_divide (
                return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
        }
 
+       dividend_ovl.full = dividend;
+
        /*
         * The quotient is 64 bits, the remainder is always 32 bits,
         * and is generated by the second divide.
         */
-       ACPI_DIV_64_BY_32 (0, dividend.part.hi, divisor,
+       ACPI_DIV_64_BY_32 (0, dividend_ovl.part.hi, divisor,
                          quotient.part.hi, remainder32);
-       ACPI_DIV_64_BY_32 (remainder32, dividend.part.lo,  divisor,
+       ACPI_DIV_64_BY_32 (remainder32, dividend_ovl.part.lo, divisor,
                          quotient.part.lo, remainder32);
 
        /* Return only what was requested */
@@ -121,8 +122,8 @@ acpi_ut_short_divide (
  *
  * FUNCTION:    acpi_ut_divide
  *
- * PARAMETERS:  in_dividend         - Pointer to the dividend
- *              in_divisor          - Pointer to the divisor
+ * PARAMETERS:  in_dividend         - Dividend
+ *              in_divisor          - Divisor
  *              out_quotient        - Pointer to where the quotient is returned
  *              out_remainder       - Pointer to where the remainder is returned
  *
@@ -134,8 +135,8 @@ acpi_ut_short_divide (
 
 acpi_status
 acpi_ut_divide (
-       acpi_integer                    *in_dividend,
-       acpi_integer                    *in_divisor,
+       acpi_integer                    in_dividend,
+       acpi_integer                    in_divisor,
        acpi_integer                    *out_quotient,
        acpi_integer                    *out_remainder)
 {
@@ -155,13 +156,13 @@ acpi_ut_divide (
 
        /* Always check for a zero divisor */
 
-       if (*in_divisor == 0) {
+       if (in_divisor == 0) {
                ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
                return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
        }
 
-       divisor.full  = *in_divisor;
-       dividend.full = *in_dividend;
+       divisor.full  = in_divisor;
+       dividend.full = in_dividend;
        if (divisor.part.hi == 0) {
                /*
                 * 1) Simplest case is where the divisor is 32 bits, we can
@@ -269,7 +270,7 @@ acpi_ut_divide (
 
 acpi_status
 acpi_ut_short_divide (
-       acpi_integer                    *in_dividend,
+       acpi_integer                    in_dividend,
        u32                             divisor,
        acpi_integer                    *out_quotient,
        u32                             *out_remainder)
@@ -288,10 +289,10 @@ acpi_ut_short_divide (
        /* Return only what was requested */
 
        if (out_quotient) {
-               *out_quotient = *in_dividend / divisor;
+               *out_quotient = in_dividend / divisor;
        }
        if (out_remainder) {
-               *out_remainder = (u32) *in_dividend % divisor;
+               *out_remainder = (u32) in_dividend % divisor;
        }
 
        return_ACPI_STATUS (AE_OK);
@@ -299,8 +300,8 @@ acpi_ut_short_divide (
 
 acpi_status
 acpi_ut_divide (
-       acpi_integer                    *in_dividend,
-       acpi_integer                    *in_divisor,
+       acpi_integer                    in_dividend,
+       acpi_integer                    in_divisor,
        acpi_integer                    *out_quotient,
        acpi_integer                    *out_remainder)
 {
@@ -309,7 +310,7 @@ acpi_ut_divide (
 
        /* Always check for a zero divisor */
 
-       if (*in_divisor == 0) {
+       if (in_divisor == 0) {
                ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
                return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
        }
@@ -318,10 +319,10 @@ acpi_ut_divide (
        /* Return only what was requested */
 
        if (out_quotient) {
-               *out_quotient = *in_dividend / *in_divisor;
+               *out_quotient = in_dividend / in_divisor;
        }
        if (out_remainder) {
-               *out_remainder = *in_dividend % *in_divisor;
+               *out_remainder = in_dividend % in_divisor;
        }
 
        return_ACPI_STATUS (AE_OK);