From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbbJLKtE (ORCPT ); Mon, 12 Oct 2015 06:49:04 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:59955 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbbJLKtC (ORCPT ); Mon, 12 Oct 2015 06:49:02 -0400 Date: Mon, 12 Oct 2015 12:48:58 +0200 From: Markus Pargmann To: yalin wang 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 Message-ID: <20151012104858.GA6786@pengutronix.de> References: <1444377082-22525-1-git-send-email-yalin.wang2010@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <1444377082-22525-1-git-send-email-yalin.wang2010@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 12:43:41 up 23 days, 5 min, 183 users, load average: 5.82, 7.58, 3.84 User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: yalin wang > --- > drivers/base/regmap/internal.h | 39 +++++++++++++++++++-----------------= --- > 1 file changed, 19 insertions(+), 20 deletions(-) >=20 > diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/interna= l.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; > =20 > - 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); > =20 > - 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; > =20 > + /* 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; > =20 > @@ -124,31 +141,13 @@ struct regmap { > /* number of entries in reg_defaults_raw */ > unsigned int num_reg_defaults_raw; > =20 > - /* 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; > =20 > struct reg_sequence *patch; > int patch_regs; > =20 > - /* 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; > --=20 > 1.9.1 >=20 > -- > 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/ >=20 --=20 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 | --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWG5AaAAoJEEpcgKtcEGQQf/EP/3X5Qa+I+R+h8fbb0iUK760a RFKj8lbsoD5pXSrhalYNVaYJ0pd4XJsOOG0iuH0FaJC1bUwOqMarnJJy80qi+HL0 xJHmaA9YLduvgc9Pcqo13ZAxyhevSJ5iHiTPitedRrHvEMGupl1WTz+y90KhjdW/ GCbizv3S5mk8IwgM0OYhE3QGPim2Ytlr7tLE1x3UjD/5RQQH24SYMDoLlygFVH0Z MvVPBlHVg7hecAKhZYE/lSL8Gwdeom7P/1XantQucYJ2P9wsieWMA/hW5pQ4958T K9E+gzbqpO4eDKQRLu0YMaMVJotuhddQ/A/rnTZ6g72WiPC/0wpKOQyQPDAdhEhR Y/Zw2ej2+7VsEe32Q9GC5Qr76s6hFCpf7fjBCygNl/AjTi0HCo/nnVzKrYyFTA83 7dWpawpzW8WSLsXbvMEdkK/6g4E64tmtlk4ugcdJjzcxfI9UBpjJwwN8n1s2xv0p ooFsx2LBCbONQ4uz77MUHct/wUSUowWE72tFrG00H2WCwe4j+6MkcbmBfWiS2j3r 9kLqF9bmuq4nvOVHbxBvy+FDKlKOq2wO8KbFw7Em9mTmaZt/++N7hXUk3DZErxxr WRMtKRzx8ublqxqzYRESnlVufUzLKJYwWHfR+YGSMhpSljiekx18stqOdjCXR5V6 +1C14QUuPqv+bLD4d5st =5pbh -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--