On 24/11/2023 4:29 pm, Simone Ballarin wrote:
> From: Maria Celeste Cesario <maria.celeste.cesa...@bugseng.com>
>
> Add missing const qualifier in casting to comply with Rule 11.8.
> The type of the formal parameter ivhd_block is const qualified.
> No functional change.
>
> Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesa...@bugseng.com>
> Signed-off-by: Simone Ballarin  <simone.balla...@bugseng.com>
> ---
>  xen/drivers/passthrough/amd/iommu_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c 
> b/xen/drivers/passthrough/amd/iommu_acpi.c
> index 699d33f429..00923a6bb5 100644
> --- a/xen/drivers/passthrough/amd/iommu_acpi.c
> +++ b/xen/drivers/passthrough/amd/iommu_acpi.c
> @@ -1232,7 +1232,7 @@ static int __init get_last_bdf_ivhd(
>      while ( ivhd_block->header.length >=
>              (block_length + sizeof(struct acpi_ivrs_de_header)) )
>      {
> -        ivhd_device = (const void *)((u8 *)ivhd_block + block_length);
> +        ivhd_device = (const void *)((const uint8_t *)ivhd_block + 
> block_length);

This we should simplify into just:

    ivhd_device = (const void *)ivhd_block + block_length;

We use this GCC extension in many other places too.

~Andrew

Reply via email to