mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regmap:change struct regmap's internal locks as union
@ 2014-09-11  8:19 Wang, Yalin
  2014-09-12 13:57 ` Mark Brown
  2014-12-15  8:05 ` [PATCH] regmap:change spinlock_flags into the union Wang, Yalin
  0 siblings, 2 replies; 4+ messages in thread
From: Wang, Yalin @ 2014-09-11  8:19 UTC (permalink / raw)
  To: 'broonie@kernel.org', 'linux-driver@qlogic.com',
	'linux-kernel@vger.kernel.org',
	'linux-arm-kernel@lists.infradead.org',
	'linux@arm.linux.org.uk'

this patch change struct regmap->mutex and struct regmap->spinlock
as an union, because these 2 members are only used one of them,
we change it to shrink the struct size.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
---
 drivers/base/regmap/internal.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index bfc90b8..0da5865 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -49,8 +49,10 @@ struct regmap_async {
 };
 
 struct regmap {
-	struct mutex mutex;
-	spinlock_t spinlock;
+	union {
+		struct mutex mutex;
+		spinlock_t spinlock;
+	};
 	unsigned long spinlock_flags;
 	regmap_lock lock;
 	regmap_unlock unlock;
-- 
2.1.0


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

end of thread, other threads:[~2014-12-15 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11  8:19 [PATCH] regmap:change struct regmap's internal locks as union Wang, Yalin
2014-09-12 13:57 ` Mark Brown
2014-12-15  8:05 ` [PATCH] regmap:change spinlock_flags into the union Wang, Yalin
2014-12-15 17:41   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®