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

Submitted by Cyrill Gorcunov on July 5, 2019, 5:47 p.m.

Details

Message ID 20190705174710.GA4602@uranus.lan
State Accepted
Series "mem: Cleanup and fixups"
Commit 9d3eb6ca9aa191db01158be80efcbdb1e3249deb
Headers show

Commit Message

Cyrill Gorcunov July 5, 2019, 5:47 p.m.
Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
---
 criu/shmem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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;
 
 	old_size = si->size;
 	si->size = new_size;
+
 	if (!is_shmem_tracking_en())
 		return 0;
 

Comments

Mike Rapoport July 8, 2019, 5:09 p.m.
On Fri, Jul 05, 2019 at 08:47:10PM +0300, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov@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@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
>