Re: [DVB patch 54/54] ttusb-budget: use time_after_eq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/4/05, Johannes Stezenbach <[email protected]> wrote:
> On Sun, Sep 04, 2005 Nish Aravamudan wrote:
> > On 9/4/05, Johannes Stezenbach <[email protected]> wrote:
> > >
> > > -static int numpkt = 0, lastj, numts, numstuff, numsec, numinvalid;
> > > +static int numpkt = 0, numts, numstuff, numsec, numinvalid;
> > > +static unsigned long lastj;
> > >
> > >  static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack,
> > >                            int len)
> > > @@ -779,7 +781,7 @@ static void ttusb_iso_irq(struct urb *ur
> > >                         u8 *data;
> > >                         int len;
> > >                         numpkt++;
> > > -                       if ((jiffies - lastj) >= HZ) {
> > > +                       if (time_after_eq(jiffies, lastj + HZ)) {
> >
> > I think you actually want:
> >
> > static void ttusb_iso_irq(....)
> > {
> >      unsigned long lastj;
> >
> >      ...
> >
> >      lastj = jiffies + HZ;
> >      if (time_after_eq(jiffies, lastj)) {
> >           ...
> >
> > }
> >
> > The current code doesn't assign jiffies to lastj at any point that I see.
> 
> The code in question is used to print a one-per-second debug output,
> and lastj is assigned after every print.

Ah yes, didn't see that in the current code, sorry for that noise.
Still, lastj is local to ttusb_iso_irq(), right?

> I agree that it's ugly, though.

Fair enough :)

Thanks,
Nish
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux