[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] tools: convert bitfields to unsigned type



On 03.05.23 17:01, Olaf Hering wrote:
clang complains about the signed type:

implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 
to -1 [-Wsingle-bit-bitfield-constant-conversion]

The potential ABI change in libxenvchan is covered by the Xen version based 
SONAME.

The xenalyze change follows the existing pattern in that file.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
  tools/include/libxenvchan.h | 6 +++---
  tools/xentrace/xenalyze.c   | 2 +-
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/include/libxenvchan.h b/tools/include/libxenvchan.h
index 30cc73cf97..3d3b8aa8dd 100644
--- a/tools/include/libxenvchan.h
+++ b/tools/include/libxenvchan.h
@@ -79,11 +79,11 @@ struct libxenvchan {
        xenevtchn_handle *event;
        uint32_t event_port;
        /* informative flags: are we acting as server? */
-       int is_server:1;
+       unsigned int is_server:1;
        /* true if server remains active when client closes (allows 
reconnection) */
-       int server_persist:1;
+       unsigned int server_persist:1;
        /* true if operations should block instead of returning 0 */
-       int blocking:1;
+       unsigned int blocking:1;
        /* communication rings */
        struct libxenvchan_ring read, write;
        /**
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 12dcca9646..1b4a188aaa 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -1377,7 +1377,7 @@ struct hvm_data {
      tsc_t exit_tsc, arc_cycles, entry_tsc;
      unsigned long long rip;
      unsigned exit_reason, event_handler;
-    int short_summary_done:1, prealloc_unpin:1, wrmap_bf:1;
+    unsigned short_summary_done:1, prealloc_unpin:1, wrmap_bf:1;

Please use "unsigned int" instead of a pure "unsigned".

With that you can add my:

Reviewed-by: Juergen Gross <jgross@xxxxxxxx>


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.