提交 b602d113 编写于 作者: M Mika Westerberg 提交者: Yang Yingliang

ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro

commit 1dade3a7048ccfc675650cd2cf13d578b095e5fb upstream.

Sometimes it is useful to find the access_width field value in bytes and
not in bits so add a helper that can be used for this purpose.
Suggested-by: NJean Delvare <jdelvare@suse.de>
Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: NJean Delvare <jdelvare@suse.de>
Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2468e7d2
...@@ -528,11 +528,12 @@ typedef u64 acpi_integer; ...@@ -528,11 +528,12 @@ typedef u64 acpi_integer;
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
/* /*
* Algorithm to obtain access bit width. * Algorithm to obtain access bit or byte width.
* Can be used with access_width of struct acpi_generic_address and access_size of * Can be used with access_width of struct acpi_generic_address and access_size of
* struct acpi_resource_generic_register. * struct acpi_resource_generic_register.
*/ */
#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2)) #define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
#define ACPI_ACCESS_BYTE_WIDTH(size) (1 << ((size) - 1))
/******************************************************************************* /*******************************************************************************
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册