[Spice-devel] Move memslot_get_generation() from the header

Submitted by Pavel Grunt on Nov. 25, 2016, 2:17 p.m.

Details

Message ID 20161125141748.6800-1-pgrunt@redhat.com
State New
Headers show
Series "Move memslot_get_generation() from the header" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Pavel Grunt Nov. 25, 2016, 2:17 p.m.
It is used in memslot.c only.
It was moved to header in 34fb3f680618b8735322462bd692fb2923ea3027
---
 server/memslot.c | 5 +++++
 server/memslot.h | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/memslot.c b/server/memslot.c
index fdcd023..53ef45d 100644
--- a/server/memslot.c
+++ b/server/memslot.c
@@ -23,6 +23,11 @@ 
 
 #include "memslot.h"
 
+static inline int memslot_get_generation(RedMemSlotInfo *info, uint64_t addr)
+{
+    return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
+}
+
 static unsigned long __get_clean_virt(RedMemSlotInfo *info, QXLPHYSICAL addr)
 {
     return addr & info->memslot_clean_virt_mask;
diff --git a/server/memslot.h b/server/memslot.h
index 71f1210..997e524 100644
--- a/server/memslot.h
+++ b/server/memslot.h
@@ -48,11 +48,6 @@  static inline int memslot_get_id(RedMemSlotInfo *info, uint64_t addr)
     return addr >> info->memslot_id_shift;
 }
 
-static inline int memslot_get_generation(RedMemSlotInfo *info, uint64_t addr)
-{
-    return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
-}
-
 int memslot_validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
                           uint32_t add_size, uint32_t group_id);
 unsigned long memslot_max_size_virt(RedMemSlotInfo *info,

Comments

> 
> It is used in memslot.c only.
> It was moved to header in 34fb3f680618b8735322462bd692fb2923ea3027
> ---
>  server/memslot.c | 5 +++++
>  server/memslot.h | 5 -----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/server/memslot.c b/server/memslot.c
> index fdcd023..53ef45d 100644
> --- a/server/memslot.c
> +++ b/server/memslot.c
> @@ -23,6 +23,11 @@
>  
>  #include "memslot.h"
>  
> +static inline int memslot_get_generation(RedMemSlotInfo *info, uint64_t
> addr)
> +{
> +    return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
> +}
> +
>  static unsigned long __get_clean_virt(RedMemSlotInfo *info, QXLPHYSICAL
>  addr)
>  {
>      return addr & info->memslot_clean_virt_mask;
> diff --git a/server/memslot.h b/server/memslot.h
> index 71f1210..997e524 100644
> --- a/server/memslot.h
> +++ b/server/memslot.h
> @@ -48,11 +48,6 @@ static inline int memslot_get_id(RedMemSlotInfo *info,
> uint64_t addr)
>      return addr >> info->memslot_id_shift;
>  }
>  
> -static inline int memslot_get_generation(RedMemSlotInfo *info, uint64_t
> addr)
> -{
> -    return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
> -}
> -
>  int memslot_validate_virt(RedMemSlotInfo *info, unsigned long virt, int
>  slot_id,
>                            uint32_t add_size, uint32_t group_id);
>  unsigned long memslot_max_size_virt(RedMemSlotInfo *info,

This looks quite lined up with different changes we made.
On the other hand the structure is public so this don't encapsulate anything.

Acked-by: Frediano Ziglio <fziglio@redhat.com>

I'll wait a bit to understand what other people think of.

Frediano