提交 1ad3790a 编写于 作者: M Mika Westerberg 提交者: Rafael J. Wysocki

ACPI / hotplug / PCI: Sanitize acpiphp_get_(latch)|(adapter)_status()

There is no need for a temporary variable and all the tricks with
ternary operators in acpiphp_get_(latch)|(adapter)_status(). Change
those functions to be a bit more straightforward.

[rjw: Changelog]
Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 c38f82cf
...@@ -1107,11 +1107,7 @@ u8 acpiphp_get_power_status(struct acpiphp_slot *slot) ...@@ -1107,11 +1107,7 @@ u8 acpiphp_get_power_status(struct acpiphp_slot *slot)
*/ */
u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) u8 acpiphp_get_latch_status(struct acpiphp_slot *slot)
{ {
unsigned int sta; return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI);
sta = get_slot_status(slot);
return (sta & ACPI_STA_DEVICE_UI) ? 0 : 1;
} }
...@@ -1121,9 +1117,5 @@ u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) ...@@ -1121,9 +1117,5 @@ u8 acpiphp_get_latch_status(struct acpiphp_slot *slot)
*/ */
u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot)
{ {
unsigned int sta; return !!get_slot_status(slot);
sta = get_slot_status(slot);
return (sta == 0) ? 0 : 1;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册