Skip to content

Commit

Permalink
ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro
Browse files Browse the repository at this point in the history
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: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Mika Westerberg authored and Rafael J. Wysocki committed Feb 13, 2020
1 parent 3f9e12e commit 1dade3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/acpi/actypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,12 @@ typedef u64 acpi_integer;
strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)

/*
* 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
* struct acpi_resource_generic_register.
*/
#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
#define ACPI_ACCESS_BYTE_WIDTH(size) (1 << ((size) - 1))

/*******************************************************************************
*
Expand Down

0 comments on commit 1dade3a

Please sign in to comment.