From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] swapping01: fix parameter truncation in abs
Date: Wed, 20 Jan 2021 12:11:27 +0100 [thread overview]
Message-ID: <YAgP38nzhxIe3mQ0@pevik> (raw)
In-Reply-To: <20210115122543.288948-1-egorenar@linux.ibm.com>
Hi Alexander,
> Parameters passed to abs(int) are of type long. Use labs(long) instead
> to avoid value truncation.
> Fixes the following warning:
> swapping01.c: In function ?check_swapping?:
> swapping01.c:133:7: warning: absolute value function ?abs? given an argument of type ?long int? but has parameter of type ?int? which may cause truncation of value [-Wabsolute-value]
> 133 | if (abs(swap_free_now - SAFE_READ_MEMINFO("SwapFree:")) < 512)
> | ^~~
Merged this obvious fix. Thanks!
Kind regards,
Petr
prev parent reply other threads:[~2021-01-20 11:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 12:25 [LTP] [PATCH 1/1] swapping01: fix parameter truncation in abs Alexander Egorenkov
2021-01-20 11:11 ` Petr Vorel [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=YAgP38nzhxIe3mQ0@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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