diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-04-19 20:16:05 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-07-29 18:35:39 +0200 |
commit | 2cd005cac6d586b8ca324814a9c58ed0c08ffe40 (patch) | |
tree | 6c5fb6c321598dff913ab0e948bab809859c9756 /tools/power/cpupower/utils/helpers/bitmask.c | |
parent | b510b54127a4d4112a9a3f200339719bcb463c15 (diff) |
cpupowerutils: helpers - ConfigStyle bugfixes
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power/cpupower/utils/helpers/bitmask.c')
-rw-r--r-- | tools/power/cpupower/utils/helpers/bitmask.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/power/cpupower/utils/helpers/bitmask.c b/tools/power/cpupower/utils/helpers/bitmask.c index 60f4d69bb20d..5c074c60f904 100644 --- a/tools/power/cpupower/utils/helpers/bitmask.c +++ b/tools/power/cpupower/utils/helpers/bitmask.c @@ -8,12 +8,12 @@ #define bitsperlong (8 * sizeof(unsigned long)) /* howmany(a,b) : how many elements of size b needed to hold all of a */ -#define howmany(x,y) (((x)+((y)-1))/(y)) +#define howmany(x, y) (((x)+((y)-1))/(y)) /* How many longs in mask of n bits */ #define longsperbits(n) howmany(n, bitsperlong) -#define max(a,b) ((a) > (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) /* * Allocate and free `struct bitmask *` @@ -73,7 +73,8 @@ static void _setbit(struct bitmask *bmp, unsigned int n, unsigned int v) if (v) bmp->maskp[n/bitsperlong] |= 1UL << (n % bitsperlong); else - bmp->maskp[n/bitsperlong] &= ~(1UL << (n % bitsperlong)); + bmp->maskp[n/bitsperlong] &= + ~(1UL << (n % bitsperlong)); } } @@ -185,7 +186,7 @@ unsigned int bitmask_next(const struct bitmask *bmp, unsigned int i) * 0-3 0,1,2,3 * 0-7:2 0,2,4,6 * 1,3,5-7 1,3,5,6,7 - * 0-3:2,8-15:4 0,2,8,12 + * 0-3:2,8-15:4 0,2,8,12 */ int bitmask_parselist(const char *buf, struct bitmask *bmp) { @@ -251,7 +252,8 @@ static inline int emit(char *buf, int buflen, int rbot, int rtop, int len) if (rbot == rtop) len += snprintf(buf + len, max(buflen - len, 0), "%d", rbot); else - len += snprintf(buf + len, max(buflen - len, 0), "%d-%d", rbot, rtop); + len += snprintf(buf + len, max(buflen - len, 0), "%d-%d", + rbot, rtop); return len; } |