提交 06865077 编写于 作者: S Stefan Binding 提交者: Rafael J. Wysocki

ACPI: property: Fix type detection of unified integer reading functions

The current code expects the type of the value to be an integer type,
instead the value passed to the macro is a pointer.
Ensure the size comparison uses the correct pointer type to choose the
max value, instead of using the integer type.

Fixes: 92304413 ("ACPI: property: Unify integer value reading functions")
Signed-off-by: NStefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: NJohn Garry <john.garry@huawei.com>
Acked-by: NArd Biesheuvel <ardb@kernel.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 1c23f9e6
......@@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data,
break; \
} \
if (__items[i].integer.value > _Generic(__val, \
u8: U8_MAX, \
u16: U16_MAX, \
u32: U32_MAX, \
u64: U64_MAX, \
u8 *: U8_MAX, \
u16 *: U16_MAX, \
u32 *: U32_MAX, \
u64 *: U64_MAX, \
default: 0U)) { \
ret = -EOVERFLOW; \
break; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册