diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-11-01 16:48:31 +0000 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-11-01 16:49:23 +0000 |
commit | 5ba70c0086c0d474c7cd1a4afcd131d42b941176 (patch) | |
tree | 3feddeb1092822c9ae00c2d7981f9cfd966fdb63 /ethtool-bitops.h | |
parent | bf4ec1bf149bffd5425b9ef353d2f79c99bdcdf3 (diff) | |
download | ethtool-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.h | 25 |
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 |