diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-11-30 17:11:32 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-07 02:29:22 +0100 |
commit | 66586baba56679baa2da1a10a96ccf15b1e96b95 (patch) | |
tree | e3d941455d6478cb071edc6ef307ba3f7b45fcf3 /include/linux/property.h | |
parent | 318a1971826103ecf560875b17236dd4a93e8c88 (diff) | |
download | linux-66586baba56679baa2da1a10a96ccf15b1e96b95.tar.gz linux-66586baba56679baa2da1a10a96ccf15b1e96b95.tar.bz2 linux-66586baba56679baa2da1a10a96ccf15b1e96b95.zip |
device property: keep single value inplace
We may save a lot of lines of code and space by keeping single values inside
the struct property_entry. Refactor the implementation to do so.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/property.h')
-rw-r--r-- | include/linux/property.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/include/linux/property.h b/include/linux/property.h index c29460a0e521..69a8a0817fd3 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -145,19 +145,34 @@ static inline int fwnode_property_read_u64(struct fwnode_handle *fwnode, * struct property_entry - "Built-in" device property representation. * @name: Name of the property. * @length: Length of data making up the value. - * @value: Value of the property (an array of items of the given type). + * @is_array: True when the property is an array. + * @is_string: True when property is a string. + * @pointer: Pointer to the property (an array of items of the given type). + * @value: Value of the property (when it is a single item of the given type). */ struct property_entry { const char *name; size_t length; + bool is_array; + bool is_string; union { - void *raw_data; - u8 *u8_data; - u16 *u16_data; - u32 *u32_data; - u64 *u64_data; - const char **str; - } value; + union { + void *raw_data; + u8 *u8_data; + u16 *u16_data; + u32 *u32_data; + u64 *u64_data; + const char **str; + } pointer; + union { + unsigned long long raw_data; + u8 u8_data; + u16 u16_data; + u32 u32_data; + u64 u64_data; + const char *str; + } value; + }; }; /** |