public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: typeof(dev->power.saved_state)
Date: Sun, 28 Nov 2004 18:19:25 +0000	[thread overview]
Message-ID: <20041128181925.B18354@flint.arm.linux.org.uk> (raw)

arch/arm/common/sa1111.c: In function `sa1111_suspend':
arch/arm/common/sa1111.c:816: warning: assignment from incompatible pointer type

This is a rather annoying, and IMHO pointless warning.  First
question: what is the reasoning for using an array of unsigned
bytes here?  Are we expecting to power manage devices which only
have byte wide registers?

In reality, devices have half-word and word sized registers as
well, which means that dev->power.saved_state actually points to
device specific data (or even device driver specific data) for
the device.  As such, it makes far more sense for this to be
a 'void *'.

I'd rather not go around the ARM kernel tree adding pointless
casts to 'u8 *' and back again because the wrong type for this
was picked in the structure definition, so here's a patch which
changes this to void *.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej orig/include/linux/pm.h linux/include/linux/pm.h
--- orig/include/linux/pm.h	Mon Nov 15 09:17:10 2004
+++ linux/include/linux/pm.h	Sun Nov 28 18:15:57 2004
@@ -226,7 +226,7 @@ struct dev_pm_info {
 	u32			power_state;
 #ifdef	CONFIG_PM
 	u32			prev_state;
-	u8			* saved_state;
+	void			* saved_state;
 	atomic_t		pm_users;
 	struct device		* pm_parent;
 	struct list_head	entry;


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

                 reply	other threads:[~2004-11-28 18:19 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=20041128181925.B18354@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.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