* [Xen-devel] [PATCH v2] x86/mem_sharing: Fix RANDCONFIG build
@ 2020-01-08 17:24 Andrew Cooper
2020-01-08 17:27 ` Tamas K Lengyel
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2020-01-08 17:24 UTC (permalink / raw)
To: Xen-devel; +Cc: Andrew Cooper, Tamas K Lengyel
Travis reports: https://travis-ci.org/andyhhp/xen/jobs/633751811
mem_sharing.c:361:13: error: 'rmap_has_entries' defined but not used [-Werror=unused-function]
static bool rmap_has_entries(const struct page_info *page)
^
cc1: all warnings being treated as errors
This happens in a release build (disables MEM_SHARING_AUDIT) when
CONFIG_MEM_SHARING is enabled.
Expand both trivial helpers into their single callsite.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Tamas K Lengyel <tamas@tklengyel.com>
v2:
* Expand, rather than mark as __maybe_unused
---
xen/arch/x86/mm/mem_sharing.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index ddf1f0f9f9..64dd3689df 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -351,18 +351,6 @@ static gfn_info_t *rmap_retrieve(uint16_t domain_id, unsigned long gfn,
return NULL;
}
-/* Returns true if the rmap has only one entry. O(1) complexity. */
-static bool rmap_has_one_entry(const struct page_info *page)
-{
- return rmap_count(page) == 1;
-}
-
-/* Returns true if the rmap has any entries. O(1) complexity. */
-static bool rmap_has_entries(const struct page_info *page)
-{
- return rmap_count(page) != 0;
-}
-
/*
* The iterator hides the details of how the rmap is implemented. This
* involves splitting the list_for_each_safe macro into two steps.
@@ -531,7 +519,7 @@ static int audit(void)
}
/* Check we have a list */
- if ( (!pg->sharing) || !rmap_has_entries(pg) )
+ if ( (!pg->sharing) || rmap_count(pg) == 0 )
{
MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n",
mfn_x(mfn));
@@ -1220,7 +1208,7 @@ int __mem_sharing_unshare_page(struct domain *d,
* Do the accounting first. If anything fails below, we have bigger
* bigger fish to fry. First, remove the gfn from the list.
*/
- last_gfn = rmap_has_one_entry(page);
+ last_gfn = rmap_count(page) == 1;
if ( last_gfn )
{
/*
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Xen-devel] [PATCH v2] x86/mem_sharing: Fix RANDCONFIG build
2020-01-08 17:24 [Xen-devel] [PATCH v2] x86/mem_sharing: Fix RANDCONFIG build Andrew Cooper
@ 2020-01-08 17:27 ` Tamas K Lengyel
0 siblings, 0 replies; 2+ messages in thread
From: Tamas K Lengyel @ 2020-01-08 17:27 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Xen-devel
On Wed, Jan 8, 2020 at 10:24 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> Travis reports: https://travis-ci.org/andyhhp/xen/jobs/633751811
>
> mem_sharing.c:361:13: error: 'rmap_has_entries' defined but not used [-Werror=unused-function]
> static bool rmap_has_entries(const struct page_info *page)
> ^
> cc1: all warnings being treated as errors
>
> This happens in a release build (disables MEM_SHARING_AUDIT) when
> CONFIG_MEM_SHARING is enabled.
>
> Expand both trivial helpers into their single callsite.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Thanks!
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-08 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 17:24 [Xen-devel] [PATCH v2] x86/mem_sharing: Fix RANDCONFIG build Andrew Cooper
2020-01-08 17:27 ` Tamas K Lengyel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.