bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 1/4] x86_64: fix some compiler warnings


From: Samuel Thibault
Subject: Re: [PATCH 1/4] x86_64: fix some compiler warnings
Date: Thu, 16 Feb 2023 23:26:37 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Luca Dariz, le jeu. 16 févr. 2023 22:33:15 +0100, a ecrit:
> * i386/include/mach/i386/vm_param.h: extend the vm constants to ULL on
>   x86_64 to avoid a shift overflow warning
> * i386/intel/pmap.c: fix cast and unused variables
> ---
>  i386/include/mach/i386/vm_param.h | 4 ++--
>  i386/intel/pmap.c                 | 8 +++-----
>  2 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/i386/include/mach/i386/vm_param.h 
> b/i386/include/mach/i386/vm_param.h
> index e98f032c..f09049a5 100644
> --- a/i386/include/mach/i386/vm_param.h
> +++ b/i386/include/mach/i386/vm_param.h
> @@ -72,9 +72,9 @@
>     not be increased to more than 3GB as glibc and hurd servers would not cope
>     with that.
>     */
> -#define VM_MIN_ADDRESS               (0)
> +#define VM_MIN_ADDRESS               (0ULL)
>  #ifdef __x86_64__
> -#define VM_MAX_ADDRESS               (0xC0000000UL)
> +#define VM_MAX_ADDRESS               (0xc0000000ULL)
>  #else
>  #define VM_MAX_ADDRESS               (0xc0000000UL)
>  #endif
> diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
> index 67c55e7d..302a60cb 100644
> --- a/i386/intel/pmap.c
> +++ b/i386/intel/pmap.c
> @@ -1376,7 +1376,7 @@ pmap_t pmap_create(vm_size_t size)
>               pt_entry_t *user_page_dir = (pt_entry_t *) 
> kmem_cache_alloc(&pd_cache);
>               memset(user_page_dir, 0, INTEL_PGBYTES);
>               WRITE_PTE(&pdp_user[i + lin2pdpnum(VM_MIN_USER_ADDRESS)],  // 
> pdp_user
> -                       pa_to_pte(kvtophys(user_page_dir))
> +                       pa_to_pte(kvtophys((vm_offset_t)user_page_dir))
>                         | INTEL_PTE_VALID
>  #if (defined(__x86_64__) && !defined(MACH_HYP)) || 
> defined(MACH_PV_PAGETABLES)
>                         | INTEL_PTE_WRITE | INTEL_PTE_USER
> @@ -3136,14 +3136,13 @@ pmap_unmap_page_zero (void)
>  void
>  pmap_make_temporary_mapping(void)
>  {
> -     int i;
> -
>       /*
>        * We'll have to temporarily install a direct mapping
>        * between physical memory and low linear memory,
>        * until we start using our new kernel segment descriptors.
>        */
>  #if INIT_VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS
> +     int i;
>       vm_offset_t delta = INIT_VM_MIN_KERNEL_ADDRESS - 
> LINEAR_MIN_KERNEL_ADDRESS;
>       if ((vm_offset_t)(-delta) < delta)
>               delta = (vm_offset_t)(-delta);
> @@ -3191,9 +3190,8 @@ pmap_set_page_dir(void)
>  void
>  pmap_remove_temporary_mapping(void)
>  {
> -     int i;
> -
>  #if INIT_VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS
> +     int i;
>       vm_offset_t delta = INIT_VM_MIN_KERNEL_ADDRESS - 
> LINEAR_MIN_KERNEL_ADDRESS;
>       if ((vm_offset_t)(-delta) < delta)
>               delta = (vm_offset_t)(-delta);
> -- 
> 2.30.2
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

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