From: Markus Pargmann <mpa@pengutronix.de>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: broonie@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC V3] regmap: change bool to 1 bit variable in struct regmap
Date: Mon, 12 Oct 2015 12:48:58 +0200 [thread overview]
Message-ID: <20151012104858.GA6786@pengutronix.de> (raw)
In-Reply-To: <1444377082-22525-1-git-send-email-yalin.wang2010@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3542 bytes --]
Hi,
On Fri, Oct 09, 2015 at 03:51:22PM +0800, yalin wang wrote:
> 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 | 39 +++++++++++++++++++--------------------
> 1 file changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
> index 3df9770..dac341c 100644
> --- a/drivers/base/regmap/internal.h
> +++ b/drivers/base/regmap/internal.h
> @@ -68,7 +68,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;
> @@ -102,8 +101,26 @@ struct regmap {
> int (*reg_update_bits)(void *context, unsigned int reg,
> unsigned int mask, unsigned int val);
>
> - bool defer_caching;
> + u8 async:1;
> + u8 defer_caching:1;
> + /* if set, remember to free reg_defaults_raw */
> + u8 cache_free:1;
> + /* if set, the HW registers are known to match map->reg_defaults */
> + u8 no_sync_defaults:1;
>
> + /* if set, converts bulk read to single read */
> + u8 use_single_read:1;
> + /* if set, converts bulk read to single read */
> + u8 use_single_write:1;
> + /* if set, the device supports multi write mode */
> + u8 can_multi_write:1;
> +
> + /* if set, only the cache is modified not the HW */
> + bool cache_only;
> + /* if set, only the HW is modified not the cache */
> + bool cache_bypass;
> + /* if set, the cache contains newer data than the HW */
> + bool cache_dirty;
Why are these last three variables just moved and not changed to u8 of
size 1?
Regards,
Markus
> u8 read_flag_mask;
> u8 write_flag_mask;
>
> @@ -124,31 +141,13 @@ struct regmap {
> /* number of entries in reg_defaults_raw */
> unsigned int num_reg_defaults_raw;
>
> - /* if set, only the cache is modified not the HW */
> - bool cache_only;
> - /* if set, only the HW is modified not the cache */
> - bool 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 */
> - bool 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 read to single read */
> - bool use_single_read;
> - /* if set, converts bulk read to single read */
> - bool use_single_write;
> - /* if set, the device supports multi write mode */
> - bool can_multi_write;
> -
> /* if set, raw reads/writes are limited to this size */
> size_t max_raw_read;
> size_t max_raw_write;
> --
> 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/
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-10-12 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 7:51 yalin wang
2015-10-09 11:35 ` Mark Brown
2015-10-10 1:24 ` yalin wang
2015-10-12 10:48 ` Markus Pargmann [this message]
2015-10-12 16:26 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151012104858.GA6786@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yalin.wang2010@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®