xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xen.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com
Subject: Re: [PATCH] libxl: use llabs() instead abs() for int64_t argument
Date: Tue, 2 Aug 2016 18:28:37 +0100	[thread overview]
Message-ID: <9c60cfd2-7527-bc25-7a0c-83b5f7e5a082@citrix.com> (raw)
In-Reply-To: <1470158742-27324-1-git-send-email-jgross@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 667 bytes --]

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)
                                         ^
Otherwise, LGTM.

~Andrew

[-- Attachment #1.2: Type: text/html, Size: 1685 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

  reply	other threads:[~2016-08-02 17:28 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 [this message]
2016-08-03  9:13   ` Wei Liu
2016-08-03  9:27     ` Juergen Gross
2016-08-03  9:48       ` Wei Liu

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=9c60cfd2-7527-bc25-7a0c-83b5f7e5a082@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.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 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).