[PATCH 5/6] ACPI/OSL: Cleanup branch logics.
This patch cleans up trivial branch logics in acpi_os_unmap_iomem() to eliminate several lines. No functional changes. Signed-off-by: Lv Zheng Tested-by: Fei Yang --- drivers/acpi/mem.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/mem.c b/drivers/acpi/mem.c index c472237..c7c35f7 100644 --- a/drivers/acpi/mem.c +++ b/drivers/acpi/mem.c @@ -194,12 +194,10 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) mutex_lock(_ioremap_lock); map = acpi_map_lookup_virt(virt, size); - if (!map) { - mutex_unlock(_ioremap_lock); + if (map) + acpi_map_put(map); + else WARN(true, PREFIX "%s: bad address %p\n", __func__, virt); - return; - } - acpi_map_put(map); mutex_unlock(_ioremap_lock); acpi_map_cleanup(map); -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/6] ACPI/OSL: Cleanup branch logics.
This patch cleans up trivial branch logics in acpi_os_unmap_iomem() to eliminate several lines. No functional changes. Signed-off-by: Lv Zheng lv.zh...@intel.com Tested-by: Fei Yang fei.y...@intel.com --- drivers/acpi/mem.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/mem.c b/drivers/acpi/mem.c index c472237..c7c35f7 100644 --- a/drivers/acpi/mem.c +++ b/drivers/acpi/mem.c @@ -194,12 +194,10 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) mutex_lock(acpi_ioremap_lock); map = acpi_map_lookup_virt(virt, size); - if (!map) { - mutex_unlock(acpi_ioremap_lock); + if (map) + acpi_map_put(map); + else WARN(true, PREFIX %s: bad address %p\n, __func__, virt); - return; - } - acpi_map_put(map); mutex_unlock(acpi_ioremap_lock); acpi_map_cleanup(map); -- 1.7.10 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/