diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-01-12 06:23:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:51 -0500 |
commit | 56e252c7484c3ebc058f3c22d4a75386b079c49c (patch) | |
tree | e69ca95952743d38deb4da85593566843cce9ec3 | |
parent | 3f25252675770e08d97bc112e52208e8c70ce0e5 (diff) |
[PKTGEN]: Kill dead static inlines
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/pktgen.c | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index ede1feacddf9..ebfb1268ac3c 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -397,62 +397,6 @@ struct pktgen_thread { | |||
397 | #define REMOVE 1 | 397 | #define REMOVE 1 |
398 | #define FIND 0 | 398 | #define FIND 0 |
399 | 399 | ||
400 | /* This code works around the fact that do_div cannot handle two 64-bit | ||
401 | numbers, and regular 64-bit division doesn't work on x86 kernels. | ||
402 | --Ben | ||
403 | */ | ||
404 | |||
405 | #define PG_DIV 0 | ||
406 | |||
407 | /* This was emailed to LMKL by: Chris Caputo <ccaputo@alt.net> | ||
408 | * Function copied/adapted/optimized from: | ||
409 | * | ||
410 | * nemesis.sourceforge.net/browse/lib/static/intmath/ix86/intmath.c.html | ||
411 | * | ||
412 | * Copyright 1994, University of Cambridge Computer Laboratory | ||
413 | * All Rights Reserved. | ||
414 | * | ||
415 | */ | ||
416 | static inline s64 divremdi3(s64 x, s64 y, int type) | ||
417 | { | ||
418 | u64 a = (x < 0) ? -x : x; | ||
419 | u64 b = (y < 0) ? -y : y; | ||
420 | u64 res = 0, d = 1; | ||
421 | |||
422 | if (b > 0) { | ||
423 | while (b < a) { | ||
424 | b <<= 1; | ||
425 | d <<= 1; | ||
426 | } | ||
427 | } | ||
428 | |||
429 | do { | ||
430 | if (a >= b) { | ||
431 | a -= b; | ||
432 | res += d; | ||
433 | } | ||
434 | b >>= 1; | ||
435 | d >>= 1; | ||
436 | } | ||
437 | while (d); | ||
438 | |||
439 | if (PG_DIV == type) { | ||
440 | return (((x ^ y) & (1ll << 63)) == 0) ? res : -(s64) res; | ||
441 | } else { | ||
442 | return ((x & (1ll << 63)) == 0) ? a : -(s64) a; | ||
443 | } | ||
444 | } | ||
445 | |||
446 | /* End of hacks to deal with 64-bit math on x86 */ | ||
447 | |||
448 | /** Convert to milliseconds */ | ||
449 | static inline __u64 tv_to_ms(const struct timeval *tv) | ||
450 | { | ||
451 | __u64 ms = tv->tv_usec / 1000; | ||
452 | ms += (__u64) tv->tv_sec * (__u64) 1000; | ||
453 | return ms; | ||
454 | } | ||
455 | |||
456 | /** Convert to micro-seconds */ | 400 | /** Convert to micro-seconds */ |
457 | static inline __u64 tv_to_us(const struct timeval *tv) | 401 | static inline __u64 tv_to_us(const struct timeval *tv) |
458 | { | 402 | { |
@@ -461,39 +405,6 @@ static inline __u64 tv_to_us(const struct timeval *tv) | |||
461 | return us; | 405 | return us; |
462 | } | 406 | } |
463 | 407 | ||
464 | static inline __u64 pg_div(__u64 n, __u32 base) | ||
465 | { | ||
466 | __u64 tmp = n; | ||
467 | do_div(tmp, base); | ||
468 | /* printk("pktgen: pg_div, n: %llu base: %d rv: %llu\n", | ||
469 | n, base, tmp); */ | ||
470 | return tmp; | ||
471 | } | ||
472 | |||
473 | static inline __u64 pg_div64(__u64 n, __u64 base) | ||
474 | { | ||
475 | __u64 tmp = n; | ||
476 | /* | ||
477 | * How do we know if the architecture we are running on | ||
478 | * supports division with 64 bit base? | ||
479 | * | ||
480 | */ | ||
481 | #if defined(__sparc_v9__) || defined(__powerpc64__) || defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) | ||
482 | |||
483 | do_div(tmp, base); | ||
484 | #else | ||
485 | tmp = divremdi3(n, base, PG_DIV); | ||
486 | #endif | ||
487 | return tmp; | ||
488 | } | ||
489 | |||
490 | static inline __u64 getCurMs(void) | ||
491 | { | ||
492 | struct timeval tv; | ||
493 | do_gettimeofday(&tv); | ||
494 | return tv_to_ms(&tv); | ||
495 | } | ||
496 | |||
497 | static inline __u64 getCurUs(void) | 408 | static inline __u64 getCurUs(void) |
498 | { | 409 | { |
499 | struct timeval tv; | 410 | struct timeval tv; |
@@ -501,11 +412,6 @@ static inline __u64 getCurUs(void) | |||
501 | return tv_to_us(&tv); | 412 | return tv_to_us(&tv); |
502 | } | 413 | } |
503 | 414 | ||
504 | static inline __u64 tv_diff(const struct timeval *a, const struct timeval *b) | ||
505 | { | ||
506 | return tv_to_us(a) - tv_to_us(b); | ||
507 | } | ||
508 | |||
509 | /* old include end */ | 415 | /* old include end */ |
510 | 416 | ||
511 | static char version[] __initdata = VERSION; | 417 | static char version[] __initdata = VERSION; |