ACPICA: Cleanup useless memset invocations.
authorLv Zheng <lv.zheng@intel.com>
Thu, 31 Oct 2013 01:30:48 +0000 (09:30 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 31 Oct 2013 13:37:34 +0000 (14:37 +0100)
This patch removes unnecessary memset() invocations where
kmem_cache_zalloc() is used for allocating memory.  It also helps to
reduce source code differences between ACPICA upstream and Linux.

[rjw: Changelog]
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/utobject.c
drivers/acpi/acpica/utstate.c

index d2a7b61237434c2155e8c990566ddeabe8728fba..13e045025c3366f00e4912aa1063f538d44f4687 100644 (file)
@@ -396,7 +396,6 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
 
        /* Mark the descriptor type */
 
-       memset(object, 0, sizeof(union acpi_operand_object));
        ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND);
 
        ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
index a6b729d4c1dc9c3a3696f8c7ea8fb396c2a8ab7f..03c4c2febd84c54b19eaa0cf397cd5e03549449d 100644 (file)
@@ -161,7 +161,6 @@ union acpi_generic_state *acpi_ut_create_generic_state(void)
        if (state) {
 
                /* Initialize */
-               memset(state, 0, sizeof(union acpi_generic_state));
                state->common.descriptor_type = ACPI_DESC_TYPE_STATE;
        }