All of lore.kernel.org
 help / color / mirror / Atom feed
* + rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device.patch added to -mm tree
@ 2009-10-15 23:18 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-10-15 23:18 UTC (permalink / raw)
  To: mm-commits; +Cc: anemo, alessandro.zummo, andy.sharp, david-b, thomas.hommel


The patch titled
     rtc: do not use container_of macro as an argument for to_platform_device
has been added to the -mm tree.  Its filename is
     rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: rtc: do not use container_of macro as an argument for to_platform_device
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

The to_platform_device macro itself uses container_of macro.  Nested use
of container_of macro causes following sparse warnings:

rtc-ds1553.c:259:3: warning: symbol '__mptr' shadows an earlier one
rtc-ds1553.c:259:3: originally declared here

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Andrew Sharp <andy.sharp@lsi.com>
Cc: Thomas Hommel <thomas.hommel@gefanuc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


diff -puN drivers/rtc/rtc-ds1553.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device drivers/rtc/rtc-ds1553.c
--- a/drivers/rtc/rtc-ds1553.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device
+++ a/drivers/rtc/rtc-ds1553.c
@@ -255,8 +255,8 @@ static ssize_t ds1553_nvram_read(struct 
 				 struct bin_attribute *bin_attr,
 				 char *buf, loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 	ssize_t count;
@@ -270,8 +270,8 @@ static ssize_t ds1553_nvram_write(struct
 				  struct bin_attribute *bin_attr,
 				  char *buf, loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 	ssize_t count;
diff -puN drivers/rtc/rtc-ds1742.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device drivers/rtc/rtc-ds1742.c
--- a/drivers/rtc/rtc-ds1742.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device
+++ a/drivers/rtc/rtc-ds1742.c
@@ -131,8 +131,8 @@ static ssize_t ds1742_nvram_read(struct 
 				 struct bin_attribute *bin_attr,
 				 char *buf, loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr_nvram;
 	ssize_t count;
@@ -146,8 +146,8 @@ static ssize_t ds1742_nvram_write(struct
 				  struct bin_attribute *bin_attr,
 				  char *buf, loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr_nvram;
 	ssize_t count;
diff -puN drivers/rtc/rtc-stk17ta8.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device drivers/rtc/rtc-stk17ta8.c
--- a/drivers/rtc/rtc-stk17ta8.c~rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device
+++ a/drivers/rtc/rtc-stk17ta8.c
@@ -247,8 +247,8 @@ static ssize_t stk17ta8_nvram_read(struc
 				 struct bin_attribute *attr, char *buf,
 				 loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 	ssize_t count;
@@ -262,8 +262,8 @@ static ssize_t stk17ta8_nvram_write(stru
 				  struct bin_attribute *attr, char *buf,
 				  loff_t pos, size_t size)
 {
-	struct platform_device *pdev =
-		to_platform_device(container_of(kobj, struct device, kobj));
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 	ssize_t count;
_

Patches currently in -mm which might be from anemo@mba.ocn.ne.jp are

rtc-fix-driver-data-issues-in-several-rtc-drivers.patch
rtc-ds1511-fix-races-around-device-registration.patch
rtc-tx4939-fix-races-around-device-registration.patch
rtc-ds1553-fix-races-around-device-registration.patch
rtc-ds1742-fix-races-around-device-registration.patch
rtc-stk17ta8-fix-races-around-device-registration.patch
rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-15 23:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-15 23:18 + rtc-do-not-use-container_of-macro-as-an-argument-for-to_platform_device.patch added to -mm tree akpm

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.