xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/xenstored: Correct the prototype of domain_max_chk()
@ 2023-06-12 10:13 Julien Grall
  2023-06-12 10:30 ` Juergen Gross
  2023-06-12 15:08 ` Jason Andryuk
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Grall @ 2023-06-12 10:13 UTC (permalink / raw)
  To: xen-devel; +Cc: julien, Julien Grall, Wei Liu, Juergen Gross, Anthony PERARD

From: Julien Grall <jgrall@amazon.com>

Some version of GCC will complain because the prototype and the
declaration of domain_max_chk() don't match:

xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem,  unsigned int)' [-Werror=enum-int-mismatch]
 1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,
      |      ^~~~~~~~~~~~~~
In file included from xenstored_domain.c:31:
xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
  146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
      |      ^~~~~~~~~~~~~~

Update the prototype to match the declaration.

This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.

Fixes: 685048441e1c ("tools/xenstore: switch quota management to be table based")
Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_domain.h b/tools/xenstore/xenstored_domain.h
index bf63f3fcc667..4950b00aee54 100644
--- a/tools/xenstore/xenstored_domain.h
+++ b/tools/xenstore/xenstored_domain.h
@@ -143,7 +143,7 @@ void acc_drop(struct connection *conn);
 void acc_commit(struct connection *conn);
 int domain_max_global_acc(const void *ctx, struct connection *conn);
 void domain_reset_global_acc(void);
-bool domain_max_chk(const struct connection *conn, unsigned int what,
+bool domain_max_chk(const struct connection *conn, enum accitem what,
 		    unsigned int val);
 
 extern long wrl_ntransactions;
-- 
2.40.1



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

* Re: [PATCH] tools/xenstored: Correct the prototype of domain_max_chk()
  2023-06-12 10:13 [PATCH] tools/xenstored: Correct the prototype of domain_max_chk() Julien Grall
@ 2023-06-12 10:30 ` Juergen Gross
  2023-06-12 15:08 ` Jason Andryuk
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2023-06-12 10:30 UTC (permalink / raw)
  To: Julien Grall, xen-devel; +Cc: Julien Grall, Wei Liu, Anthony PERARD


[-- Attachment #1.1.1: Type: text/plain, Size: 1164 bytes --]

On 12.06.23 12:13, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Some version of GCC will complain because the prototype and the
> declaration of domain_max_chk() don't match:
> 
> xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem,  unsigned int)' [-Werror=enum-int-mismatch]
>   1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,
>        |      ^~~~~~~~~~~~~~
> In file included from xenstored_domain.c:31:
> xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
>    146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
>        |      ^~~~~~~~~~~~~~
> 
> Update the prototype to match the declaration.
> 
> This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.
> 
> Fixes: 685048441e1c ("tools/xenstore: switch quota management to be table based")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH] tools/xenstored: Correct the prototype of domain_max_chk()
  2023-06-12 10:13 [PATCH] tools/xenstored: Correct the prototype of domain_max_chk() Julien Grall
  2023-06-12 10:30 ` Juergen Gross
@ 2023-06-12 15:08 ` Jason Andryuk
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Andryuk @ 2023-06-12 15:08 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Julien Grall, Wei Liu, Juergen Gross, Anthony PERARD

On Mon, Jun 12, 2023 at 6:13 AM Julien Grall <julien@xen.org> wrote:
>
> From: Julien Grall <jgrall@amazon.com>
>
> Some version of GCC will complain because the prototype and the
> declaration of domain_max_chk() don't match:
>
> xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem,  unsigned int)' [-Werror=enum-int-mismatch]
>  1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,
>       |      ^~~~~~~~~~~~~~
> In file included from xenstored_domain.c:31:
> xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
>   146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
>       |      ^~~~~~~~~~~~~~
>
> Update the prototype to match the declaration.
>
> This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.
>
> Fixes: 685048441e1c ("tools/xenstore: switch quota management to be table based")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Tested-by: Jason Andryuk <jandryuk@gmail.com>

This fixes the issue on Fedora 38, too.

Thanks,
Jason


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

end of thread, other threads:[~2023-06-12 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 10:13 [PATCH] tools/xenstored: Correct the prototype of domain_max_chk() Julien Grall
2023-06-12 10:30 ` Juergen Gross
2023-06-12 15:08 ` Jason Andryuk

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).