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]
Message-ID: <4E441F17.7090504@panasas.com>
Date:	Thu, 11 Aug 2011 11:27:35 -0700
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Chris Metcalf <cmetcalf@...era.com>
CC:	Trond Myklebust <Trond.Myklebust@...app.com>,
	<linux-nfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Dean Hildebrand <dhildebz@...ch.edu>
Subject: Re: [PATCH] nfs: fix a couple of minor portability issues

On 08/11/2011 06:26 AM, Chris Metcalf wrote:
> 
> You can't use a cast with do_div() or you get errors about non-lvalues.
> 
> And the context here is that we want the remainder, not the divided result,
> so we'd need a temporary variable anyway if we were going to use a routine
> from math64.h, presumably div_u64_rem().  But that's just an inline wrapper
> around do_div() anyway, so it's no more efficient, and not obviously any
> less "cluttered" in the source code here.  The original code author (who
> I'm adding belatedly to this email) may have a stronger opinion.
> 
> I'm not the author or maintainer of this code, I just want it to compile
> without warning on 32-bit architectures :-)
> 

Still, if you fix it do it properly by using, as you said, div_u64_rem().
It's what needs to be used with u64 types.

Thanks
Boaz
--
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