[git commit] hdparm: placate "warning: taking the absolute value of unsigned type"

Denys Vlasenko vda.linux at googlemail.com
Fri Oct 25 15:47:22 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=122a8cbd4a3053e32bb76e6aa081deb890b10b11
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/hdparm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index b453efba9..beabb1ad5 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -996,7 +996,7 @@ static void identify(uint16_t *val)
 					/* check Endian of capacity bytes */
 					nn = val[LCYLS_CUR] * val[LHEADS_CUR] * val[LSECTS_CUR];
 					oo = (uint32_t)val[CAPACITY_LSB] << 16 | val[CAPACITY_MSB];
-					if (abs(mm - nn) > abs(oo - nn))
+					if (abs((int)(mm - nn)) > abs((int)(oo - nn)))
 						mm = oo;
 				}
 				printf("\tCHS current addressable sectors:%11u\n", mm);


More information about the busybox-cvs mailing list