From 60aa49243d09afc873f082567d2e3c16634ced84 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sun, 1 Feb 2009 14:52:56 -0700 Subject: Rationalize fasync return values Most fasync implementations do something like: return fasync_helper(...); But fasync_helper() will return a positive value at times - a feature used in at least one place. Thus, a number of other drivers do: err = fasync_helper(...); if (err < 0) return err; return 0; In the interests of consistency and more concise code, it makes sense to map positive return values onto zero where ->fasync() is called. Cc: Al Viro Signed-off-by: Jonathan Corbet --- drivers/net/wan/cosa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/wan/cosa.c') diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index d80b72e..ce753e9 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -993,8 +993,8 @@ static struct fasync_struct *fasync[256] = { NULL, }; static int cosa_fasync(struct inode *inode, struct file *file, int on) { int port = iminor(inode); - int rv = fasync_helper(inode, file, on, &fasync[port]); - return rv < 0 ? rv : 0; + + return fasync_helper(inode, file, on, &fasync[port]); } #endif -- cgit v1.1