Commit 74641458 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown

regmap: Reorder fields in 'struct regmap_bus' to save some memory

Group some bool variables to reduce hole and avoid padding.
On x86_64, this shrinks the size from 136 to 128 bytes.

As an example:

$ size drivers/base/regmap/regmap-fsi.o (Before)
   text	   data	    bss	    dec	    hex	filename
   4837	    136	      0	   4973	   136d	drivers/base/regmap/regmap-fsi.o

$ size drivers/base/regmap/regmap-fsi.o (After)
   text	   data	    bss	    dec	    hex	filename
   4701	    136	      0	   4837	   12e5	drivers/base/regmap/regmap-fsi.o
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/077ca39622c8870a3ea932298a9cec34f7a8295a.1676363976.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7b3c4c37
...@@ -520,6 +520,7 @@ typedef void (*regmap_hw_free_context)(void *context); ...@@ -520,6 +520,7 @@ typedef void (*regmap_hw_free_context)(void *context);
* to perform locking. This field is ignored if custom lock/unlock * to perform locking. This field is ignored if custom lock/unlock
* functions are used (see fields lock/unlock of * functions are used (see fields lock/unlock of
* struct regmap_config). * struct regmap_config).
* @free_on_exit: kfree this on exit of regmap
* @write: Write operation. * @write: Write operation.
* @gather_write: Write operation with split register/value, return -ENOTSUPP * @gather_write: Write operation with split register/value, return -ENOTSUPP
* if not implemented on a given device. * if not implemented on a given device.
...@@ -548,10 +549,10 @@ typedef void (*regmap_hw_free_context)(void *context); ...@@ -548,10 +549,10 @@ typedef void (*regmap_hw_free_context)(void *context);
* DEFAULT, BIG is assumed. * DEFAULT, BIG is assumed.
* @max_raw_read: Max raw read size that can be used on the bus. * @max_raw_read: Max raw read size that can be used on the bus.
* @max_raw_write: Max raw write size that can be used on the bus. * @max_raw_write: Max raw write size that can be used on the bus.
* @free_on_exit: kfree this on exit of regmap
*/ */
struct regmap_bus { struct regmap_bus {
bool fast_io; bool fast_io;
bool free_on_exit;
regmap_hw_write write; regmap_hw_write write;
regmap_hw_gather_write gather_write; regmap_hw_gather_write gather_write;
regmap_hw_async_write async_write; regmap_hw_async_write async_write;
...@@ -568,7 +569,6 @@ struct regmap_bus { ...@@ -568,7 +569,6 @@ struct regmap_bus {
enum regmap_endian val_format_endian_default; enum regmap_endian val_format_endian_default;
size_t max_raw_read; size_t max_raw_read;
size_t max_raw_write; size_t max_raw_write;
bool free_on_exit;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment