diff mbox series

[1/2] mips/loongson3_virt: remove useless type cast

Message ID 20240722091728.4334-2-yaoxt.fnst@fujitsu.com (mailing list archive)
State New, archived
Headers show
Series remove useless type cast | expand

Commit Message

Xingtao Yao (Fujitsu) July 22, 2024, 9:17 a.m. UTC
The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast
the pointer of this type to uint64_t* is useless.

Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
---
 hw/mips/loongson3_virt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Maydell July 22, 2024, 11:47 a.m. UTC | #1
On Mon, 22 Jul 2024 at 10:19, Yao Xingtao via <qemu-devel@nongnu.org> wrote:
>
> The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast
> the pointer of this type to uint64_t* is useless.
>
> Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
> ---
>  hw/mips/loongson3_virt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
> index 4ad36f0c5b64..408e3d7054cd 100644
> --- a/hw/mips/loongson3_virt.c
> +++ b/hw/mips/loongson3_virt.c
> @@ -355,8 +355,8 @@ static uint64_t load_kernel(CPUMIPSState *env)
>
>      kernel_size = load_elf(loaderparams.kernel_filename, NULL,
>                             cpu_mips_kseg0_to_phys, NULL,
> -                           (uint64_t *)&kernel_entry,
> -                           (uint64_t *)&kernel_low, (uint64_t *)&kernel_high,
> +                           &kernel_entry,
> +                           &kernel_low, &kernel_high,
>                             NULL, 0, EM_MIPS, 1, 0);
>      if (kernel_size < 0) {
>          error_report("could not load kernel '%s': %s",
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Philippe Mathieu-Daudé July 22, 2024, 12:10 p.m. UTC | #2
On 22/7/24 11:17, Yao Xingtao wrote:
> The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast
> the pointer of this type to uint64_t* is useless.
> 
> Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
> ---
>   hw/mips/loongson3_virt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

and queued, thanks!
Philippe Mathieu-Daudé July 22, 2024, 9:16 p.m. UTC | #3
On 22/7/24 11:17, Yao Xingtao wrote:
> The type of kernel_entry, kernel_low and kernel_high is uint64_t, cast
> the pointer of this type to uint64_t* is useless.
> 
> Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
> ---
>   hw/mips/loongson3_virt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Patch queued, thanks.
diff mbox series

Patch

diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index 4ad36f0c5b64..408e3d7054cd 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -355,8 +355,8 @@  static uint64_t load_kernel(CPUMIPSState *env)
 
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
-                           (uint64_t *)&kernel_entry,
-                           (uint64_t *)&kernel_low, (uint64_t *)&kernel_high,
+                           &kernel_entry,
+                           &kernel_low, &kernel_high,
                            NULL, 0, EM_MIPS, 1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",