qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/7] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SI


From: Li Qiang
Subject: Re: [PATCH 4/7] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE
Date: Sat, 15 Aug 2020 11:21:52 +0800

Philippe Mathieu-Daudé <f4bug@amsat.org> 于2020年8月14日周五 下午4:31写道:
>
> Use self-explicit definitions instead of magic '512' value.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
>  hw/ide/ahci.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index 009120f88b..b696c6291a 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -1151,7 +1151,7 @@ static void process_ncq_command(AHCIState *s, int port, 
> uint8_t *cmd_fis,
>      if (!ncq_tfs->sector_count) {
>          ncq_tfs->sector_count = 0x10000;
>      }
> -    size = ncq_tfs->sector_count * 512;
> +    size = ncq_tfs->sector_count * BDRV_SECTOR_SIZE;
>      ahci_populate_sglist(ad, &ncq_tfs->sglist, ncq_tfs->cmdh, size, 0);
>
>      if (ncq_tfs->sglist.size < size) {
> @@ -1703,7 +1703,8 @@ static int ahci_state_post_load(void *opaque, int 
> version_id)
>                  return -1;
>              }
>              ahci_populate_sglist(ncq_tfs->drive, &ncq_tfs->sglist,
> -                                 ncq_tfs->cmdh, ncq_tfs->sector_count * 512,
> +                                 ncq_tfs->cmdh,
> +                                 ncq_tfs->sector_count * BDRV_SECTOR_SIZE,
>                                   0);
>              if (ncq_tfs->sector_count != ncq_tfs->sglist.size >> 9) {
>                  return -1;
> --
> 2.21.3
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]