summaryrefslogtreecommitdiff
path: root/ethtool-bitops.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-11-01 16:48:31 +0000
committerBen Hutchings <bhutchings@solarflare.com>2011-11-01 16:49:23 +0000
commit5ba70c0086c0d474c7cd1a4afcd131d42b941176 (patch)
tree3feddeb1092822c9ae00c2d7981f9cfd966fdb63 /ethtool-bitops.h
parentbf4ec1bf149bffd5425b9ef353d2f79c99bdcdf3 (diff)
downloadethtool-5ba70c0086c0d474c7cd1a4afcd131d42b941176.tar.gz
Combine ethtool-{bitops,util}.h into internal.h
ethtool-util.h contains all kinds of declarations, not just utility functions or macros. ethtool-bitops.h contains just a few extra definitions, and its only user also includes ethtool-util.h. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'ethtool-bitops.h')
-rw-r--r--ethtool-bitops.h25
1 files changed, 0 insertions, 25 deletions
diff --git a/ethtool-bitops.h b/ethtool-bitops.h
deleted file mode 100644
index b1eb426..0000000
--- a/ethtool-bitops.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef ETHTOOL_BITOPS_H__
-#define ETHTOOL_BITOPS_H__
-
-#define BITS_PER_BYTE 8
-#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long))
-#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
-#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG)
-
-static inline void set_bit(int nr, unsigned long *addr)
-{
- addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);
-}
-
-static inline void clear_bit(int nr, unsigned long *addr)
-{
- addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG));
-}
-
-static inline int test_bit(unsigned int nr, const unsigned long *addr)
-{
- return !!((1UL << (nr % BITS_PER_LONG)) &
- (((unsigned long *)addr)[nr / BITS_PER_LONG]));
-}
-
-#endif