xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Cieslak <saper@saper.info>
To: xen-devel@lists.xenproject.org
Cc: Marcin Cieslak <saper@saper.info>
Subject: [PATCH 3/4] libxl: shutdown_reason cannot be unsigned
Date: Sat, 13 Sep 2014 21:10:24 +0000	[thread overview]
Message-ID: <1410642625-45876-3-git-send-email-saper@saper.info> (raw)
In-Reply-To: <1410642625-45876-1-git-send-email-saper@saper.info>

Shutdown reason may be negative, so don't
cast it onto (unsigned int).

Clang complains:

xl_cmdimpl.c:3313:34: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
                (shutdown_reason >= 0 &&
                 ~~~~~~~~~~~~~~~ ^  ~
---
 tools/libxl/xl_cmdimpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 86daf8e..f9ca22a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3297,7 +3297,7 @@ static void list_domains(int verbose, int context, int claim, int numa,
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
         char *domname;
-        unsigned shutdown_reason;
+        int shutdown_reason;
         domname = libxl_domid_to_name(ctx, info[i].domid);
         shutdown_reason = info[i].shutdown ? info[i].shutdown_reason : 0;
         printf("%-40s %5d %5lu %5d     %c%c%c%c%c%c  %8.1f",
-- 
2.0.2

  parent reply	other threads:[~2014-09-13 21:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-13 21:10 [PATCH 1/4] Use proper header guard for <ufs/ufs.h> Marcin Cieslak
2014-09-13 21:10 ` [PATCH 2/4] libxl_get_scheduler() cannot return ERROR_FAIL Marcin Cieslak
2014-09-16 16:27   ` Ian Campbell
2014-09-13 21:10 ` Marcin Cieslak [this message]
2014-09-16 18:43   ` [PATCH 3/4] libxl: shutdown_reason cannot be unsigned Julien Grall
2014-09-13 21:10 ` [PATCH 4/4] libxl: Use yajl_gen_status_ok where appropriate Marcin Cieslak
2014-09-16 16:29   ` Ian Campbell
2014-09-16 16:23 ` [PATCH 1/4] Use proper header guard for <ufs/ufs.h> Ian Campbell
2014-09-16 16:28   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410642625-45876-3-git-send-email-saper@saper.info \
    --to=saper@saper.info \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).