Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261440AbTI3MmC (ORCPT ); Tue, 30 Sep 2003 08:42:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261447AbTI3MmC (ORCPT ); Tue, 30 Sep 2003 08:42:02 -0400 Received: from petasus.isw.intel.com ([192.55.37.196]:59639 "EHLO petasus.isw.intel.com") by vger.kernel.org with ESMTP id S261440AbTI3Mlp (ORCPT ); Tue, 30 Sep 2003 08:41:45 -0400 Date: Tue, 30 Sep 2003 14:41:33 +0200 (CEST) From: Artur Klauser To: Andreas Schwab cc: Matti Aarnio , Rogier Wolff , linux-kernel@vger.kernel.org Subject: Re: div64.h:do_div() bug In-Reply-To: Message-ID: References: <20030930095229.GA32421@bitwizard.nl> <20030930101438.GJ1058@mea-ext.zmailer.org> <20030930112830.GK1058@mea-ext.zmailer.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Sep 2003, Andreas Schwab wrote: > Matti Aarnio writes: > > On Tue, Sep 30, 2003 at 01:14:38PM +0300, Matti Aarnio wrote: > >> On Tue, Sep 30, 2003 at 11:52:29AM +0200, Rogier Wolff wrote: > >> > On Mon, Sep 29, 2003 at 03:25:19PM +0200, Artur Klauser wrote: > >> > > I've found that a bug in asm-arm/div64.h:do_div() is preventing correct > >> > > conversion of timestamps in smbfs (and probably ntfs as well) from NT to > >> > > >> > Nope. > >> > >> Nope yourself. > >> > >> > > if (in.n64 != out.n64) { > >> > > printf("FAILURE: asm/div64.h:do_div() is broken for 64-bit dividends\n"); > >> > > >> > do_div should be/is documented as not doing 64 bit dividents. It does > >> > 64/32 -> 32 divides, IIRC... > >> > >> 64/32 -> 64,32 > >> > >> The REMAINDER is 32 bit value. > > > > Non-native english speaker makes the mistake.. MODULUS is 32 bits as is > > DIVISOR, REMAINDER is 64 bit, as is DIVIDEND. > > > > That is: > > DIVIDEND / DIVISOR -> REMAINDER , MODULUS > ^^^^^^^^^^^^^^^^^^^ > ??? > QUOTIENT, REMAINDER Actually, I have to agree with Andreas here - and with Matti's 1st naming attempt :) But whatever the naming is, the operation AFAICT should be, and is implemented that way in other asm-/div64.h:do_div() macros: do_div(u64, u32) u64 / u32 -> u64 (modifies 1st argument) u64 % u32 -> u32 (return value) -r2r- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/