[PATCH v1 3/5] ALSA: hda: Drop duplicate check for size parameter of memremap()

From: Andy Shevchenko
Date: Fri Nov 15 2019 - 13:01:04 EST


Since memremap() returns NULL pointer for size = 0, there is no need
to duplicate this check in the callers.

Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: Jaroslav Kysela <perex@xxxxxxxx>
Cc: Takashi Iwai <tiwai@xxxxxxxx>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
sound/hda/intel-nhlt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c
index 097ff6c10099..5fc10f1b244c 100644
--- a/sound/hda/intel-nhlt.c
+++ b/sound/hda/intel-nhlt.c
@@ -16,7 +16,7 @@ struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
acpi_handle handle;
union acpi_object *obj;
struct nhlt_resource_desc *nhlt_ptr;
- struct nhlt_acpi_table *nhlt_table = NULL;
+ struct nhlt_acpi_table *nhlt_table;

handle = ACPI_HANDLE(dev);
if (!handle) {
@@ -36,8 +36,7 @@ struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
}

nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer;
- if (nhlt_ptr->length)
- nhlt_table = (struct nhlt_acpi_table *)
+ nhlt_table = (struct nhlt_acpi_table *)
memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
MEMREMAP_WB);
ACPI_FREE(obj);
--
2.24.0