aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/debugfs.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-19 20:26:30 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-07-01 22:47:23 +0200
commit0aca2369b19de3f3f1affcc5359c3d079e4e1940 (patch)
tree25b5cbe82d95a4d79c20e05dc5adbd0d59624004 /net/batman-adv/debugfs.c
parentbatman-adv: Remove space before semicolon (diff)
downloadlinux-dev-0aca2369b19de3f3f1affcc5359c3d079e4e1940.tar.xz
linux-dev-0aca2369b19de3f3f1affcc5359c3d079e4e1940.zip
batman-adv: Fix alignment after opened parentheses
Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/debugfs.c')
-rw-r--r--net/batman-adv/debugfs.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c
index e45cf0e884cc..34fbb1667bcd 100644
--- a/net/batman-adv/debugfs.c
+++ b/net/batman-adv/debugfs.c
@@ -111,6 +111,11 @@ static int batadv_log_release(struct inode *inode, struct file *file)
return 0;
}
+static int batadv_log_empty(struct batadv_debug_log *debug_log)
+{
+ return !(debug_log->log_start - debug_log->log_end);
+}
+
static ssize_t batadv_log_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
@@ -120,8 +125,7 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf,
char *char_addr;
char c;
- if ((file->f_flags & O_NONBLOCK) &&
- !(debug_log->log_end - debug_log->log_start))
+ if ((file->f_flags & O_NONBLOCK) && batadv_log_empty(debug_log))
return -EAGAIN;
if (!buf)
@@ -134,7 +138,7 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf,
return -EFAULT;
error = wait_event_interruptible(debug_log->queue_wait,
- (debug_log->log_start - debug_log->log_end));
+ (!batadv_log_empty(debug_log)));
if (error)
return error;
@@ -175,7 +179,7 @@ static unsigned int batadv_log_poll(struct file *file, poll_table *wait)
poll_wait(file, &debug_log->queue_wait, wait);
- if (debug_log->log_end - debug_log->log_start)
+ if (!batadv_log_empty(debug_log))
return POLLIN | POLLRDNORM;
return 0;
@@ -370,9 +374,9 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
for (bat_debug = batadv_mesh_debuginfos; *bat_debug; ++bat_debug) {
file = debugfs_create_file(((*bat_debug)->attr).name,
- S_IFREG | ((*bat_debug)->attr).mode,
- bat_priv->debug_dir,
- dev, &(*bat_debug)->fops);
+ S_IFREG | ((*bat_debug)->attr).mode,
+ bat_priv->debug_dir,
+ dev, &(*bat_debug)->fops);
if (!file) {
batadv_err(dev, "Can't add debugfs file: %s/%s\n",
dev->name, ((*bat_debug)->attr).name);