aboutsummaryrefslogtreecommitdiffstats
path: root/src/capabilities.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@alnilam.(none)>2010-02-01 22:03:33 +0100
committerHenrik Rydberg <rydberg@alnilam.(none)>2010-02-01 22:03:33 +0100
commitf0b1dbdc00bda57c62199cbdc44acbadbb1121b0 (patch)
tree5234055bf794c28662b139c22e153f7a720a37bc /src/capabilities.c
parent30869603dc5d36ad2d82cff82900c7e05a4b35c1 (diff)
downloadxorg-input-kobomultitouch-f0b1dbdc00bda57c62199cbdc44acbadbb1121b0.tar.gz
xorg-input-kobomultitouch-f0b1dbdc00bda57c62199cbdc44acbadbb1121b0.tar.bz2
xorg-input-kobomultitouch-f0b1dbdc00bda57c62199cbdc44acbadbb1121b0.zip
janitor: stick to kernel-style formatting
With this commit, the whole code base complies with the kernel format style, and patches can be checked against the kernel-provided ./scripts/checkpatch.pl
Diffstat (limited to 'src/capabilities.c')
-rw-r--r--src/capabilities.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/capabilities.c b/src/capabilities.c
index 201c127..cdd05c5 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -21,15 +21,11 @@
#include "capabilities.h"
-////////////////////////////////////////////////////////
-
#define SETABS(c, x, map, key, fd) \
- c->has_##x = getbit(map, key) && getabs(&c->abs_##x, key, fd)
+ (c->has_##x = getbit(map, key) && getabs(&c->abs_##x, key, fd))
#define ADDCAP(s, c, x) strcat(s, c->has_##x ? " " #x : "")
-////////////////////////////////////////////////////////
-
static const int bits_per_long = 8 * sizeof(long);
static inline int nlongs(int nbit)
@@ -37,20 +33,18 @@ static inline int nlongs(int nbit)
return (nbit + bits_per_long - 1) / bits_per_long;
}
-static inline bool getbit(const unsigned long* map, int key)
+static inline int getbit(const unsigned long *map, int key)
{
return (map[key / bits_per_long] >> (key % bits_per_long)) & 0x01;
}
-static bool getabs(struct input_absinfo *abs, int key, int fd)
+static int getabs(struct input_absinfo *abs, int key, int fd)
{
int rc;
SYSCALL(rc = ioctl(fd, EVIOCGABS(key), abs));
return rc >= 0;
}
-////////////////////////////////////////////////////////
-
int read_capabilities(struct Capabilities *cap, int fd)
{
unsigned long evbits[nlongs(EV_MAX)];
@@ -87,8 +81,6 @@ int read_capabilities(struct Capabilities *cap, int fd)
return 0;
}
-////////////////////////////////////////////////////////
-
void output_capabilities(const struct Capabilities *cap)
{
char line[1024];
@@ -126,5 +118,3 @@ void output_capabilities(const struct Capabilities *cap)
cap->abs_position_y.minimum,
cap->abs_position_y.maximum);
}
-
-////////////////////////////////////////////////////////