All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben@splentec.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, axboe@suse.de
Subject: Re: [PATCH]: jiffies wrap in ll_rw_blk.c
Date: Wed, 20 Nov 2002 16:15:33 -0500	[thread overview]
Message-ID: <3DDBFB75.6A3221A8@splentec.com> (raw)
In-Reply-To: 1037827888.3267.84.camel@irongate.swansea.linux.org.uk

Alan Cox wrote:
> 
> On Wed, 2002-11-20 at 21:00, Luben Tuikov wrote:sk) {
> > > > -               unsigned long duration = jiffies - req->start_time;
> > > > +               unsigned long duration = (signed) jiffies - (signed) req->start_time;
> > > >                 switch (rq_data_dir(req)) {
> > >
> > > It was right before. Your patch breaks it. Think about it in unsigned
> > > maths
> > >
> > >               0x00000002 - 0xFFFFFFFF = 0x00000003
> >
> > 0x2 - (-0x1) = 0x2 + 0x1 = 0x3
> >
> > Right! I thought (signed) does the job. I actually tried
> > it both ways and works all right. I guess either way works fine.
> 
> (signed long) maybe - but not signed - long is 64bit on Alpha, (signed)
> is 32

Aaaah, I see where you're coming from.

I basically tried to stay away from knowing _what_ actual
type it is and just to make it signed and do the arithmetic,
but didn't know the specific for the Alpha.

Shouldn't this be (symbolically:) (signed (typeof(jiffes)) jiffies -
(signed (typeof(start)) start -- you know what I mean.

But yes both ways should work:
a, b are both unsigned, then a-b = a+(-b) and there's just no
other way to compute the result.

Anyway, doesn't matter,
-- 
Luben

  reply	other threads:[~2002-11-20 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 20:44 [PATCH]: jiffies wrap in ll_rw_blk.c Luben Tuikov
2002-11-20 21:06 ` Benjamin LaHaise
2002-11-20 21:18   ` Luben Tuikov
2002-11-20 21:19 ` Alan Cox
2002-11-20 21:00   ` Luben Tuikov
2002-11-20 21:31     ` Alan Cox
2002-11-20 21:15       ` Luben Tuikov [this message]
2002-11-20 22:20   ` Olivier Galibert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DDBFB75.6A3221A8@splentec.com \
    --to=luben@splentec.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.