Skip to content

Commit

Permalink
hw:aspeed: drop warning and bogus ram_size fixup
Browse files Browse the repository at this point in the history
It was useless to try fixup ram_size and print warning
on guest access to config register to begin with.

Now previous patch made sure that SDMC can not be realized
with invalid RAM size, so there is no case where warning
and not used ram_size fixup could be triggered.

So remove now dead code.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
  • Loading branch information
Igor Mammedov committed Dec 20, 2019
1 parent a5f60c7 commit 5cf8556
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions hw/misc/aspeed_sdmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,8 @@ static int aspeed_get_ram_feat(AspeedSDMCState *s)
{
AspeedSDMCClass *asc = ASPEED_SDMC_GET_CLASS(s);
int ram_mb = s->ram_size >> 20;
gpointer val;
gpointer val = g_hash_table_lookup(asc->ram2feat, GINT_TO_POINTER(ram_mb));

if (g_hash_table_contains(asc->ram2feat, GINT_TO_POINTER(ram_mb))) {
val = g_hash_table_lookup(asc->ram2feat, GINT_TO_POINTER(ram_mb));
return GPOINTER_TO_INT(val);
}

warn_report("Invalid RAM size 0x%" PRIx64 ". Using default %dM",
s->ram_size, asc->fallback_ram_size);
s->ram_size = asc->fallback_ram_size << 20;
val = g_hash_table_lookup(asc->ram2feat, &asc->fallback_ram_size);
return GPOINTER_TO_INT(val);
}

Expand Down

0 comments on commit 5cf8556

Please sign in to comment.