[CRIU] [PATCH v2 14/16] mem/shmem: More elegant entries declaration

Mike Rapoport rppt at linux.ibm.com
Mon Jul 8 20:09:42 MSK 2019


On Fri, Jul 05, 2019 at 08:47:10PM +0300, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
> ---
>  criu/shmem.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/shmem.c b/criu/shmem.c
> index da9242674291..1e7013a06088 100644
> --- a/criu/shmem.c
> +++ b/criu/shmem.c
> @@ -179,11 +179,12 @@ static void set_pstate(unsigned long *pstate_map, unsigned long pfn,
>  
>  static int expand_shmem(struct shmem_info *si, unsigned long new_size)
>  {
> -	unsigned long nr_pages, nr_map_items, map_size,
> -				nr_new_map_items, new_map_size, old_size;
> +	unsigned long nr_pages, nr_map_items, map_size;
> +	unsigned long nr_new_map_items, new_map_size, old_size;

Maybe also swap the lines and make the declarations follow Reverse
Christmas Tree? ;-)

>  
>  	old_size = si->size;
>  	si->size = new_size;
> +
>  	if (!is_shmem_tracking_en())
>  		return 0;
>  
> -- 
> 2.20.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
> 

-- 
Sincerely yours,
Mike.



More information about the CRIU mailing list