From: Chih-Min Chao <cmchao@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, kraxel@redhat.com,
Chih-Min Chao <cmchao@gmail.com>
Subject: [Qemu-devel] [PATCH 1/5] bitops : fix coding style
Date: Thu, 9 Apr 2015 02:04:10 +0800 [thread overview]
Message-ID: <1428516254-23054-2-git-send-email-cmchao@gmail.com> (raw)
In-Reply-To: <1428516254-23054-1-git-send-email-cmchao@gmail.com>
don't mix tab and space. The rule is 4 spaces
Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
---
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
--
1.9.1
next prev parent reply other threads:[~2015-04-08 18:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 18:04 [Qemu-devel] [PATCH 0/5] fix coding style and use of typedef type Chih-Min Chao
2015-04-08 18:04 ` Chih-Min Chao [this message]
2015-04-08 18:04 ` [Qemu-devel] [PATCH 2/5] ui/vnc : fix coding style Chih-Min Chao
2015-04-08 18:04 ` [Qemu-devel] [PATCH 3/5] ui/vnc : remove 'struct' of 'typedef struct' Chih-Min Chao
2015-04-08 18:04 ` [Qemu-devel] [PATCH 4/5] ui/console : remove 'struct' from 'typedef struct' type Chih-Min Chao
2015-04-08 18:04 ` [Qemu-devel] [PATCH 5/5] hw/display : remove 'struct' from 'typedef QXL struct' Chih-Min Chao
2015-04-09 7:03 ` [Qemu-devel] [PATCH 0/5] fix coding style and use of typedef type Gerd Hoffmann
2015-04-25 6:23 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428516254-23054-2-git-send-email-cmchao@gmail.com \
--to=cmchao@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).