Skip to content

Commit

Permalink
ACPI: APEI: Remove unneeded result variables
Browse files Browse the repository at this point in the history
Return the erst_get_record_id_begin() and apei_exec_write_register()
return values directly instead of storing them in redundant local
variables.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
ye xingchen authored and Rafael J. Wysocki committed Sep 24, 2022
1 parent 3709642 commit 382c5fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions drivers/acpi/apei/apei-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,9 @@ EXPORT_SYMBOL_GPL(apei_exec_write_register);
int apei_exec_write_register_value(struct apei_exec_context *ctx,
struct acpi_whea_header *entry)
{
int rc;

ctx->value = entry->value;
rc = apei_exec_write_register(ctx, entry);

return rc;
return apei_exec_write_register(ctx, entry);
}
EXPORT_SYMBOL_GPL(apei_exec_write_register_value);

Expand Down
6 changes: 1 addition & 5 deletions drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,14 +1020,10 @@ static int reader_pos;

static int erst_open_pstore(struct pstore_info *psi)
{
int rc;

if (erst_disable)
return -ENODEV;

rc = erst_get_record_id_begin(&reader_pos);

return rc;
return erst_get_record_id_begin(&reader_pos);
}

static int erst_close_pstore(struct pstore_info *psi)
Expand Down

0 comments on commit 382c5fe

Please sign in to comment.