All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] acpi compile fix
@ 2003-04-03 21:05 Andrew Morton
  2003-04-04  6:48 ` J Sloan
  2003-04-04 12:18 ` Dave Jones
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Morton @ 2003-04-03 21:05 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: jjs, Grover, Andrew, linux-kernel


ACPI is performing a spin_lock() on a `void *'.  That's OK when spin_lock is
implemented via an inline function.  But when it is implemented via macros
(eg, with spinlock debugging enabled) we get:

drivers/acpi/osl.c:739: warning: dereferencing `void *' pointer
drivers/acpi/osl.c:739: request for member `owner' in something not a structure or union

So cast it to the right type.


diff -puN drivers/acpi/osl.c~acpi-spinlock-casts drivers/acpi/osl.c
--- 25/drivers/acpi/osl.c~acpi-spinlock-casts	Thu Apr  3 13:00:54 2003
+++ 25-akpm/drivers/acpi/osl.c	Thu Apr  3 13:01:25 2003
@@ -736,7 +736,7 @@ acpi_os_acquire_lock (
 	if (flags & ACPI_NOT_ISR)
 		ACPI_DISABLE_IRQS();
 
-	spin_lock(handle);
+	spin_lock((spinlock_t *)handle);
 
 	return_VOID;
 }
@@ -755,7 +755,7 @@ acpi_os_release_lock (
 	ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Releasing spinlock[%p] from %s level\n", handle,
 		((flags & ACPI_NOT_ISR) ? "non-interrupt" : "interrupt")));
 
-	spin_unlock(handle);
+	spin_unlock((spinlock_t *)handle);
 
 	if (flags & ACPI_NOT_ISR)
 		ACPI_ENABLE_IRQS();

_


^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: [patch] acpi compile fix
@ 2003-04-04 21:41 Grover, Andrew
  0 siblings, 0 replies; 7+ messages in thread
From: Grover, Andrew @ 2003-04-04 21:41 UTC (permalink / raw)
  To: Dave Jones, Andrew Morton; +Cc: torvalds, jjs, linux-kernel

> From: Dave Jones [mailto:davej@codemonkey.org.uk] 
> I don't see how putting a spinlock_t cast in the code is any 
> more portable between OS's than spinlock_t as a function parameter.

The code that calls osl.c does not know about spinlock_t. Either the
function's definition and declaration don't match, or the other code
needs to know what a spinlock_t is, doesn't it?

>  > If the above guesses (I'd prefer not to look) are correct then
>  > 	struct acpi_handle_t {
>  > 		spinlock_t lock;
>  > 	};
>  > 
>  > would make a ton more sense.
> 
> That would solve the portability argument in my eyes if that 
> is indeed the case here. It's still ugly, but it at least 
> kills the problem in a slightly more tasteful way.

I don't see the cast as being particularly onerous. It's just a cookie.
osl.c knows what it actually points to, the rest doesn't.

Regards -- Andy

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] ACPI compile fix
@ 2002-07-26 18:42 Andy Grover
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Grover @ 2002-07-26 18:42 UTC (permalink / raw)
  To: torvalds-Lhe3bsMrZseB+jHODAdFcQ; +Cc: acpi-devel-pyega4qmqnRoyOMFzWx49A

Hi Linus,

This fixes the ACPI_DEBUG compile issue that turned up.

(acpi-devel people, I'll be updating sf.net patches with this asap)

Regards -- Andy

diff -Naur -X bin/dontdiff acpi-old/drivers/acpi/include/aclocal.h linux/drivers/acpi/include/aclocal.h
--- acpi-old/drivers/acpi/include/aclocal.h	Fri Jul 26 11:27:34 2002
+++ linux/drivers/acpi/include/aclocal.h	Fri Jul 26 11:20:05 2002
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: aclocal.h - Internal data types used across the ACPI subsystem
- *       $Revision: 172 $
+ *       $Revision: 173 $
  *
  *****************************************************************************/
 
@@ -567,7 +567,7 @@
  */
 typedef struct acpi_opcode_info
 {
-#ifdef ACPI_DISASSEMBLER
+#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG)
 	NATIVE_CHAR             *name;          /* Opcode name (disassembler/debug only) */
 #endif
 	u32                     parse_args;     /* Grammar/Parse time arguments */
diff -Naur -X bin/dontdiff acpi-old/drivers/acpi/include/acmacros.h linux/drivers/acpi/include/acmacros.h
--- acpi-old/drivers/acpi/include/acmacros.h	Fri Jul 26 11:27:34 2002
+++ linux/drivers/acpi/include/acmacros.h	Fri Jul 26 11:20:05 2002
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acmacros.h - C macros for the entire subsystem.
- *       $Revision: 125 $
+ *       $Revision: 126 $
  *
  *****************************************************************************/
 
@@ -287,11 +287,15 @@
 /*
  * Macros for the master AML opcode table
  */
-#ifdef ACPI_DISASSEMBLER
+#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG)
 #define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags)    {name,Pargs,Iargs,flags,obj_type,class,type}
-#define ACPI_DISASM_ONLY_MEMBERS(a)      a;
 #else
 #define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags)    {Pargs,Iargs,flags,obj_type,class,type}
+#endif
+
+#ifdef ACPI_DISASSEMBLER
+#define ACPI_DISASM_ONLY_MEMBERS(a)      a;
+#else
 #define ACPI_DISASM_ONLY_MEMBERS(a)
 #endif
 
diff -Naur -X bin/dontdiff acpi-old/drivers/acpi/parser/psutils.c linux/drivers/acpi/parser/psutils.c
--- acpi-old/drivers/acpi/parser/psutils.c	Fri Jul 26 11:27:34 2002
+++ linux/drivers/acpi/parser/psutils.c	Fri Jul 26 11:20:05 2002
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: psutils - Parser miscellaneous utilities (Parser only)
- *              $Revision: 53 $
+ *              $Revision: 54 $
  *
  *****************************************************************************/
 
@@ -88,7 +88,7 @@
 	op->common.data_type = ACPI_DESC_TYPE_PARSER;
 	op->common.aml_opcode = opcode;
 
-	ACPI_DEBUG_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name,
+	ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name,
 			(acpi_ps_get_opcode_info (opcode))->name, sizeof (op->common.aml_op_name)));
 }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

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

end of thread, other threads:[~2003-04-04 21:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-03 21:05 [patch] acpi compile fix Andrew Morton
2003-04-04  6:48 ` J Sloan
2003-04-04 12:18 ` Dave Jones
2003-04-04 19:57   ` Andrew Morton
2003-04-04 20:27     ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2003-04-04 21:41 Grover, Andrew
2002-07-26 18:42 [PATCH] ACPI " Andy Grover

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.