diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-11-08 05:22:21 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-12-03 11:46:19 +0100 |
commit | 996b0830f95d132e50891a5568fef9e2965e4af2 (patch) | |
tree | d3e36383f0501db16b19b2f7f3eded9bd7b14d0f /drivers/base/topology.c | |
parent | software node: replace is_array with is_inline (diff) | |
download | linux-996b0830f95d132e50891a5568fef9e2965e4af2.tar.xz linux-996b0830f95d132e50891a5568fef9e2965e4af2.zip |
software node: allow embedding of small arrays into property_entry
We should not conflate whether a property data is an array or a single
value with where it is stored (embedded into property_entry structure or
out-of-line). All single-value properties are in effect 1-element
arrays, and we can figure the amount of data stored in a property by
examining its length and the data type. And arrays can be as easily
stored in property entry instances as single values are, provided that
we have enough space (we have up to 8 bytes). We can embed:
- up to 8 bytes from U8 arrays
- up to 4 words
- up to 2 double words
- one U64 value
- one (on 64 bit architectures) or 2 (on 32 bit) strings.
This change also has an effect of switching properties with small amount
of data to embed it instead of keeping it separate when copying such
properties.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/topology.c')
0 files changed, 0 insertions, 0 deletions