All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap:change struct regmap's internal locks as union
@ 2014-09-11  8:19 ` Wang, Yalin
  0 siblings, 0 replies; 8+ 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 related	[flat|nested] 8+ messages in thread

* [PATCH] regmap:change struct regmap's internal locks as union
@ 2014-09-11  8:19 ` Wang, Yalin
  0 siblings, 0 replies; 8+ messages in thread
From: Wang, Yalin @ 2014-09-11  8:19 UTC (permalink / raw)
  To: linux-arm-kernel

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 related	[flat|nested] 8+ messages in thread

* Re: [PATCH] regmap:change struct regmap's internal locks as union
  2014-09-11  8:19 ` Wang, Yalin
@ 2014-09-12 13:57   ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-09-12 13:57 UTC (permalink / raw)
  To: Wang, Yalin
  Cc: 'linux-driver@qlogic.com',
	'linux-kernel@vger.kernel.org',
	'linux-arm-kernel@lists.infradead.org',
	'linux@arm.linux.org.uk'

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

On Thu, Sep 11, 2014 at 04:19:49PM +0800, Wang, Yalin wrote:
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH] regmap:change struct regmap's internal locks as union
@ 2014-09-12 13:57   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-09-12 13:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 11, 2014 at 04:19:49PM +0800, Wang, Yalin wrote:
> 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.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140912/da7860fd/attachment.sig>

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

* [PATCH] regmap:change spinlock_flags into the union
  2014-09-11  8:19 ` Wang, Yalin
@ 2014-12-15  8:05   ` Wang, Yalin
  -1 siblings, 0 replies; 8+ messages in thread
From: Wang, Yalin @ 2014-12-15  8:05 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 move struct regmap.spinlock_flags into the union of
spinlock, so that we can shrink struct regmap 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 0da5865..8e94584 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -51,9 +51,11 @@ struct regmap_async {
 struct regmap {
 	union {
 		struct mutex mutex;
-		spinlock_t spinlock;
+		struct {
+			spinlock_t spinlock;
+			unsigned long spinlock_flags;
+		};
 	};
-	unsigned long spinlock_flags;
 	regmap_lock lock;
 	regmap_unlock unlock;
 	void *lock_arg; /* This is passed to lock/unlock functions */
-- 
2.1.3

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

* [PATCH] regmap:change spinlock_flags into the union
@ 2014-12-15  8:05   ` Wang, Yalin
  0 siblings, 0 replies; 8+ messages in thread
From: Wang, Yalin @ 2014-12-15  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

This patch move struct regmap.spinlock_flags into the union of
spinlock, so that we can shrink struct regmap 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 0da5865..8e94584 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -51,9 +51,11 @@ struct regmap_async {
 struct regmap {
 	union {
 		struct mutex mutex;
-		spinlock_t spinlock;
+		struct {
+			spinlock_t spinlock;
+			unsigned long spinlock_flags;
+		};
 	};
-	unsigned long spinlock_flags;
 	regmap_lock lock;
 	regmap_unlock unlock;
 	void *lock_arg; /* This is passed to lock/unlock functions */
-- 
2.1.3

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

* Re: [PATCH] regmap:change spinlock_flags into the union
  2014-12-15  8:05   ` Wang, Yalin
@ 2014-12-15 17:41     ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-12-15 17:41 UTC (permalink / raw)
  To: Wang, Yalin
  Cc: 'linux-driver@qlogic.com',
	'linux-kernel@vger.kernel.org',
	'linux-arm-kernel@lists.infradead.org',
	'linux@arm.linux.org.uk'

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

On Mon, Dec 15, 2014 at 04:05:50PM +0800, Wang, Yalin wrote:
> This patch move struct regmap.spinlock_flags into the union of
> spinlock, so that we can shrink struct regmap size.

Applied, thanks.  Please always remember to CC your posts to the
relevant mailing lists - in the case of regmap that's linux-kernel.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH] regmap:change spinlock_flags into the union
@ 2014-12-15 17:41     ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-12-15 17:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 04:05:50PM +0800, Wang, Yalin wrote:
> This patch move struct regmap.spinlock_flags into the union of
> spinlock, so that we can shrink struct regmap size.

Applied, thanks.  Please always remember to CC your posts to the
relevant mailing lists - in the case of regmap that's linux-kernel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141215/8ad3b2a0/attachment-0001.sig>

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

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

Thread overview: 8+ 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-11  8:19 ` Wang, Yalin
2014-09-12 13:57 ` Mark Brown
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  8:05   ` Wang, Yalin
2014-12-15 17:41   ` Mark Brown
2014-12-15 17:41     ` Mark Brown

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.