lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 9 Sep 2012 16:57:34 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pekka Enberg <penberg@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Jean Delvare <khali@...ux-fr.org>, lm-sensors@...sensors.org
Subject: Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support
 negative dividends

On Fri, Aug 31, 2012 at 5:02 PM, Guenter Roeck <linux@...ck-us.net> wrote:
> DIV_ROUND_CLOSEST returns a bad result for negative dividends:
>         DIV_ROUND_CLOSEST(-2, 2) = 0
>
> Most of the time this does not matter. However, in the hardware monitoring
> subsystem, DIV_ROUND_CLOSEST is sometimes used on integers which can be
> negative (such as temperatures).

This seems to cause 3 new warnings in my m68k builds of v3.6-rc5:

drivers/hwmon/mcp3021.c:76: warning: comparison is always true due to
limited range of data type
drivers/ide/ide-cd.c:1158: warning: comparison is always true due to
limited range of data type
drivers/ide/ide-cd.c:1159: warning: comparison is always true due to
limited range of data type

$ m68k-linux-gnu-gcc -v
Using built-in specs.
Target: m68k-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/m68k-linux-gnu/include/c++/4.1.2
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --disable-libssp --disable-werror
--enable-checking=release --program-prefix=m68k-linux-gnu-
--includedir=/usr/m68k-linux-gnu/include --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=m68k-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Ubuntu 4.1.1-21)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ