tree 5310047939d79cf5163047fbe1153ae769104fad
parent 8dc003359cc3996abad9e53a7b2280b272610283
author Russell King <[EMAIL PROTECTED]> Thu, 08 Sep 2005 22:46:00 +0100
committer Russell King <[EMAIL PROTECTED]> Thu, 08 Sep 2005 22:46:00 +0100

[MMC] Ensure correct mmc_priv() behaviour

mmc_priv() has some nasty effects if the wrong pointer type is
passed to it.  Introduce type checking, which also means we get
the right type.  Also add an additional member to mmc_host which
is used to align host-private data appropriately.

Signed-off-by: Russell King <[EMAIL PROTECTED]>

 include/linux/mmc/host.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -109,6 +109,8 @@ struct mmc_host {
        struct mmc_card         *card_selected; /* the selected MMC card */
 
        struct work_struct      detect;
+
+       unsigned long           private[0] ____cacheline_aligned;
 };
 
 extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
@@ -116,7 +118,11 @@ extern int mmc_add_host(struct mmc_host 
 extern void mmc_remove_host(struct mmc_host *);
 extern void mmc_free_host(struct mmc_host *);
 
-#define mmc_priv(x)    ((void *)((x) + 1))
+static inline void *mmc_priv(struct mmc_host *host)
+{
+       return (void *)host->private;
+}
+
 #define mmc_dev(x)     ((x)->dev)
 #define mmc_hostname(x)        ((x)->class_dev.class_id)
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to