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] [day] [month] [year] [list]
Message-ID: <CAGhQ9VxTUSdctawaXFdaRCKq_+q2H8mhPTwwMka0nLpS7TAY9A@mail.gmail.com>
Date:	Tue, 23 Oct 2012 19:20:26 +0200
From:	Joachim Eastwood <manabian@...il.com>
To:	Lothar Waßmann <LW@...o-electronics.de>
Cc:	David Miller <davem@...emloft.net>, David.Laight@...lab.com,
	bgat@...lgatliff.com, netdev@...r.kernel.org,
	nicolas.ferre@...el.com, hskinnemoen@...il.com,
	plagnioj@...osoft.com, linux-arm-kernel@...ts.infradead.org,
	egtvedt@...fundet.no
Subject: Re: [PATCH v3 1/4] net/macb: fix truncate warnings

On Tue, Oct 23, 2012 at 2:00 PM, Lothar Waßmann <LW@...o-electronics.de> wrote:
> Hi,
>
> David Miller writes:
>> From: "David Laight" <David.Laight@...LAB.COM>
>> Date: Tue, 23 Oct 2012 09:21:11 +0100
>>
>> >> When building macb on x86_64 the following warnings show up:
>> >>   drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
>> >>   drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>> > ...
>> >> -                  macb_writel(bp, IDR, ~0UL);
>> >> +                  macb_writel(bp, IDR, -1);
>> >
>> > Seems wrong to fix an error with an unsigned value
>> > by using -1.
>>
>> -1 is equally an unsigned value of all 1's and completely legitimate.
>> The correction being made here is one of size not signedness.
>>
> You could use '~0' (without the 'UL').

The reason for choosing '-1', as noted in patch description, is that
it already appears in a couple of other places in the driver. So I
though it would nice to be consistent.

regards
Joachim Eastwood
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ