xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/libs: guest: Fix Arm build after 8fc4916daf2a
@ 2021-05-18 17:03 Julien Grall
  2021-05-18 17:05 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2021-05-18 17:03 UTC (permalink / raw)
  To: xen-devel; +Cc: julien, Julien Grall, Ian Jackson, Wei Liu

From: Julien Grall <jgrall@amazon.com>

Gitlab CI spotted an issue when building the tools Arm:

xg_dom_arm.c: In function 'meminit':
xg_dom_arm.c:401:50: error: passing argument 3 of 'set_mode' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  401 |     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
      |                                               ~~~^~~~~~~~~~~~

This is because the const was not propagated in the Arm code. Fix it
by constifying the 3rd parameter of set_mode().

Fixes: 8fc4916daf2a ("tools/libs: guest: Use const whenever we point to literal strings")
Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 tools/libs/guest/xg_dom_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index b4c24f15fb27..01e85e0ea9c7 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -195,7 +195,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
 
 /* ------------------------------------------------------------------------ */
 
-static int set_mode(xc_interface *xch, uint32_t domid, char *guest_type)
+static int set_mode(xc_interface *xch, uint32_t domid, const char *guest_type)
 {
     static const struct {
         char           *guest;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/libs: guest: Fix Arm build after 8fc4916daf2a
  2021-05-18 17:03 [PATCH] tools/libs: guest: Fix Arm build after 8fc4916daf2a Julien Grall
@ 2021-05-18 17:05 ` Andrew Cooper
  2021-05-19 12:36   ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2021-05-18 17:05 UTC (permalink / raw)
  To: Julien Grall, xen-devel; +Cc: Julien Grall, Ian Jackson, Wei Liu

On 18/05/2021 18:03, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
>
> Gitlab CI spotted an issue when building the tools Arm:
>
> xg_dom_arm.c: In function 'meminit':
> xg_dom_arm.c:401:50: error: passing argument 3 of 'set_mode' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>   401 |     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
>       |                                               ~~~^~~~~~~~~~~~
>
> This is because the const was not propagated in the Arm code. Fix it
> by constifying the 3rd parameter of set_mode().
>
> Fixes: 8fc4916daf2a ("tools/libs: guest: Use const whenever we point to literal strings")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/libs: guest: Fix Arm build after 8fc4916daf2a
  2021-05-18 17:05 ` Andrew Cooper
@ 2021-05-19 12:36   ` Julien Grall
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Grall @ 2021-05-19 12:36 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Julien Grall, Ian Jackson, Wei Liu

Hi,

On 18/05/2021 18:05, Andrew Cooper wrote:
> On 18/05/2021 18:03, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> Gitlab CI spotted an issue when building the tools Arm:
>>
>> xg_dom_arm.c: In function 'meminit':
>> xg_dom_arm.c:401:50: error: passing argument 3 of 'set_mode' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>>    401 |     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
>>        |                                               ~~~^~~~~~~~~~~~
>>
>> This is because the const was not propagated in the Arm code. Fix it
>> by constifying the 3rd parameter of set_mode().
>>
>> Fixes: 8fc4916daf2a ("tools/libs: guest: Use const whenever we point to literal strings")
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks! I have committed with just your ack to unblock the build.

CHeers,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-19 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 17:03 [PATCH] tools/libs: guest: Fix Arm build after 8fc4916daf2a Julien Grall
2021-05-18 17:05 ` Andrew Cooper
2021-05-19 12:36   ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).