Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241959

[RFC] regmap: change bool to 1 bit variable in struct regmap

From yalin wang <yalin.wang2010@gmail.com>
Newsgroups linux.kernel
Subject [RFC] regmap: change bool to 1 bit variable in struct regmap
Date 2015-10-08 06:30 +0200
Message-ID <qhb06-13p-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patch change some bool variables in struct regmap {  }
to be u8 v : 1 type, so that we can shrink the sizeof of struct regmap.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
 drivers/base/regmap/internal.h | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 873ddf9..f4a5f7b 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -67,7 +67,6 @@ struct regmap {
 	void *bus_context;
 	const char *name;
 
-	bool async;
 	spinlock_t async_lock;
 	wait_queue_head_t async_waitq;
 	struct list_head async_list;
@@ -99,7 +98,16 @@ struct regmap {
 	int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
 	int (*reg_write)(void *context, unsigned int reg, unsigned int val);
 
-	bool defer_caching;
+	u8 async : 1,
+	defer_caching : 1,
+	/* if set, remember to free reg_defaults_raw */
+	cache_free : 1,
+	/* if set, the HW registers are known to match map->reg_defaults */
+	no_sync_defaults : 1,
+	/* if set, converts bulk rw to single rw */
+	use_single_rw : 1,
+	/* if set, the device supports multi write mode */
+	can_multi_write : 1;
 
 	u8 read_flag_mask;
 	u8 write_flag_mask;
@@ -125,25 +133,16 @@ struct regmap {
 	u32 cache_only;
 	/* if set, only the HW is modified not the cache */
 	u32 cache_bypass;
-	/* if set, remember to free reg_defaults_raw */
-	bool cache_free;
 
 	struct reg_default *reg_defaults;
 	const void *reg_defaults_raw;
 	void *cache;
 	/* if set, the cache contains newer data than the HW */
 	u32 cache_dirty;
-	/* if set, the HW registers are known to match map->reg_defaults */
-	bool no_sync_defaults;
 
 	struct reg_sequence *patch;
 	int patch_regs;
 
-	/* if set, converts bulk rw to single rw */
-	bool use_single_rw;
-	/* if set, the device supports multi write mode */
-	bool can_multi_write;
-
 	struct rb_root range_tree;
 	void *selector_work_buf;	/* Scratch buffer used for selector */
 };
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[RFC] regmap: change bool to 1 bit variable in struct regmap yalin wang <yalin.wang2010@gmail.com> - 2015-10-08 06:30 +0200
  Re: [RFC] regmap: change bool to 1 bit variable in struct regmap Mark Brown <broonie@kernel.org> - 2015-10-08 10:20 +0200
    Re: [RFC] regmap: change bool to 1 bit variable in struct regmap yalin wang <yalin.wang2010@gmail.com> - 2015-10-08 10:30 +0200
      Re: [RFC] regmap: change bool to 1 bit variable in struct regmap Mark Brown <broonie@kernel.org> - 2015-10-08 12:40 +0200
  Re: [RFC] regmap: change bool to 1 bit variable in struct regmap Pavel Machek <pavel@ucw.cz> - 2015-10-08 18:00 +0200

csiph-web