Re: [PATCH] arcnet and 64bit arithmetic

From: Martin Mares (mj@suse.cz)
Date: Tue Jul 11 2000 - 09:49:09 EST


Hello!

> Thanks, but I subsequently submitted a patch very much like
> yours, except that it only changed the second of the two lines that
> you changed (in exactly the same way). There is no need to change
> the part that does not do the long division, and my approach would have
> the advantage that if the count were to exceed 2**32 cycles, at least
> the total number of cycles would be correctly printed. However, come
> to think of it, the format string then needs to changed. So,
> here is a corrected patch. I have rebuilt the arcnet drivers with
> this patch and verified that they build and there are no undefined
> symbols in the kernel modules.

Here is yet another patch -- it not only fixes the problem, but it
also compiles out some debugging code by default. I've already sent
it to Linus today in the morning.

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"You can't do that in horizontal mode!"

--- include/linux/arcdevice.h.mj Tue Jul 11 13:47:06 2000 +++ include/linux/arcdevice.h Tue Jul 11 13:52:35 2000 @@ -76,7 +76,7 @@ #define D_TIMING 4096 /* show time needed to copy buffers to card */ #ifndef ARCNET_DEBUG_MAX -#define ARCNET_DEBUG_MAX (~0) /* enable ALL debug messages */ +#define ARCNET_DEBUG_MAX (127) /* change to ~0 if you want detailed debugging */ #endif #ifndef ARCNET_DEBUG @@ -96,14 +96,16 @@ /* see how long a function call takes to run, expressed in CPU cycles */ #define TIME(name, bytes, call) BUGLVL(D_TIMING) { \ cycles_t _x, _y; \ + unsigned long delta; \ _x = get_cycles(); \ call; \ _y = get_cycles(); \ + delta = _y - _x; \ BUGMSG(D_TIMING, \ "%s: %d bytes in %lu cycles == " \ "%lu Kbytes/100Mcycle\n",\ - name, bytes, _y - _x, \ - 100000000 / 1024 * bytes / (_y - _x + 1));\ + name, bytes, delta, \ + 100000000 / 1024 * bytes / (delta + 1));\ } \ else { \ call;\

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:12 EST