mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
hw/pci-host/pam: Replace magic number by PAM_REGIONS_COUNT definition
While this change helps triskaidekaphobic developers, it is a good practice to avoid magic values and using constant definitions instead. Introduce the PAM_REGIONS_COUNT and use it. No logical change. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Julia Suvorova <jusual@redhat.com> Message-Id: <20201202132038.1276404-1-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
01d152c0bf
commit
f6a3c86ebd
5 changed files with 6 additions and 4 deletions
|
@ -62,7 +62,7 @@ void init_pam(DeviceState *dev, MemoryRegion *ram_memory,
|
|||
|
||||
void pam_update(PAMMemoryRegion *pam, int idx, uint8_t val)
|
||||
{
|
||||
assert(0 <= idx && idx <= 12);
|
||||
assert(0 <= idx && idx < PAM_REGIONS_COUNT);
|
||||
|
||||
memory_region_set_enabled(&pam->alias[pam->current], false);
|
||||
pam->current = (val >> ((!(idx & 1)) * 4)) & PAM_ATTR_MASK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue