[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/42] bitops : fix coding style
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 03/42] bitops : fix coding style |
Date: |
Thu, 30 Apr 2015 08:08:16 +0300 |
From: Chih-Min Chao <address@hidden>
don't mix tab and space. The rule is 4 spaces
Signed-off-by: Chih-Min Chao <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
include/qemu/bitops.h | 61 ++++++++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 30 deletions(-)
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 90ca8df..8abdcf9 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -20,10 +20,10 @@
#define BITS_PER_BYTE CHAR_BIT
#define BITS_PER_LONG (sizeof (unsigned long) * BITS_PER_BYTE)
-#define BIT(nr) (1UL << (nr))
-#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
-#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
-#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
+#define BIT(nr) (1UL << (nr))
+#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
+#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
+#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
/**
* set_bit - Set a bit in memory
@@ -32,10 +32,10 @@
*/
static inline void set_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
- *p |= mask;
+ *p |= mask;
}
/**
@@ -45,10 +45,10 @@ static inline void set_bit(long nr, unsigned long *addr)
*/
static inline void clear_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
- *p &= ~mask;
+ *p &= ~mask;
}
/**
@@ -58,10 +58,10 @@ static inline void clear_bit(long nr, unsigned long *addr)
*/
static inline void change_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
- *p ^= mask;
+ *p ^= mask;
}
/**
@@ -71,12 +71,12 @@ static inline void change_bit(long nr, unsigned long *addr)
*/
static inline int test_and_set_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
- unsigned long old = *p;
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long old = *p;
- *p = old | mask;
- return (old & mask) != 0;
+ *p = old | mask;
+ return (old & mask) != 0;
}
/**
@@ -86,12 +86,12 @@ static inline int test_and_set_bit(long nr, unsigned long
*addr)
*/
static inline int test_and_clear_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
- unsigned long old = *p;
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long old = *p;
- *p = old & ~mask;
- return (old & mask) != 0;
+ *p = old & ~mask;
+ return (old & mask) != 0;
}
/**
@@ -101,12 +101,12 @@ static inline int test_and_clear_bit(long nr, unsigned
long *addr)
*/
static inline int test_and_change_bit(long nr, unsigned long *addr)
{
- unsigned long mask = BIT_MASK(nr);
- unsigned long *p = addr + BIT_WORD(nr);
- unsigned long old = *p;
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
+ unsigned long old = *p;
- *p = old ^ mask;
- return (old & mask) != 0;
+ *p = old ^ mask;
+ return (old & mask) != 0;
}
/**
@@ -116,7 +116,7 @@ static inline int test_and_change_bit(long nr, unsigned
long *addr)
*/
static inline int test_bit(long nr, const unsigned long *addr)
{
- return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
+ return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
}
/**
@@ -136,7 +136,8 @@ unsigned long find_last_bit(const unsigned long *addr,
* @size: The bitmap size in bits
*/
unsigned long find_next_bit(const unsigned long *addr,
- unsigned long size, unsigned long offset);
+ unsigned long size,
+ unsigned long offset);
/**
* find_next_zero_bit - find the next cleared bit in a memory region
--
2.1.4
- [Qemu-devel] [PULL 00/42] Trivial patches for 2015-04-30, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 10/42] qemu-config: remove stray inclusions of hw/ files, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 12/42] hostmem: Fix mem-path property name in error report, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 02/42] tpm: Modify DPRINTF to enable -Wformat checking, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 05/42] ui/vnc : remove 'struct' of 'typedef struct', Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 03/42] bitops : fix coding style,
Michael Tokarev <=
- [Qemu-devel] [PULL 27/42] microblaze: cpu: Remove unused CC_OP enum, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 20/42] configure: alphabetize tricore in target list, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 14/42] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags(), Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 30/42] microblaze: cpu: delete unused cpu_interrupts_enabled, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 07/42] hw/display : remove 'struct' from 'typedef QXL struct', Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 18/42] util: Remove unused functions, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 38/42] target-mips: fix memory leak, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 13/42] qemu-options: trivial spelling fix (messsage), Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 19/42] arm: cpu.h: Remove unused typdefs, Michael Tokarev, 2015/04/30
- [Qemu-devel] [PULL 40/42] kvm: Silence warning from valgrind, Michael Tokarev, 2015/04/30