All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] libxl: use llabs() instead abs() for int64_t argument
Date: Wed, 3 Aug 2016 10:48:44 +0100	[thread overview]
Message-ID: <20160803094844.GA23023@citrix.com> (raw)
In-Reply-To: <0d410f5c-3026-52e6-588b-4ae32a07dbb9@suse.com>

On Wed, Aug 03, 2016 at 11:27:04AM +0200, Juergen Gross wrote:
> On 03/08/16 11:13, Wei Liu wrote:
> > On Tue, Aug 02, 2016 at 06:28:37PM +0100, Andrew Cooper wrote:
> >> On 02/08/16 18:25, Juergen Gross wrote:
> >>> Commit 57f8b13c724023c78fa15a80452d1de3e51a1418 ("libxl: memory size
> >>> in kb requires 64 bit variable") introduced a bug: abs() shouldn't
> >>> be called with an int64_t argument. llabs() is to be used here.
> >>
> >> Possibly worth identifying that this was caught by a clang build, citing:
> >>
> >> libxl.c:4198:33: error: absolute value function 'abs' given an argument
> >> of type
> >>     'int64_t' (aka 'long') but has parameter of type 'int' which may cause
> >>     truncation of value [-Werror,-Wabsolute-value]
> >>     if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)
> >>                                          ^
> > 
> > Juergen, I can fix up the commit message for you, if you don't object to
> > Andrew's suggestion.
> 
> No, I don't object.
> 

Thanks. I will make the adjustment while committing.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

      reply	other threads:[~2016-08-03  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 17:25 [PATCH] libxl: use llabs() instead abs() for int64_t argument Juergen Gross
2016-08-02 17:28 ` Andrew Cooper
2016-08-03  9:13   ` Wei Liu
2016-08-03  9:27     ` Juergen Gross
2016-08-03  9:48       ` Wei Liu [this message]

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=20160803094844.GA23023@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xen.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 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.