From 60aa49243d09afc873f082567d2e3c16634ced84 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sun, 1 Feb 2009 14:52:56 -0700 Subject: [PATCH] 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 [[ only ieee1394 part included here ]] --- drivers/char/sonypi.c | 7 +------ drivers/gpu/drm/drm_fops.c | 6 +----- drivers/hid/usbhid/hiddev.c | 5 +---- drivers/ieee1394/dv1394.c | 6 +----- drivers/input/evdev.c | 5 +---- drivers/input/joydev.c | 5 +---- drivers/input/mousedev.c | 5 +---- drivers/input/serio/serio_raw.c | 4 +--- drivers/net/wan/cosa.c | 4 ++-- drivers/platform/x86/sony-laptop.c | 7 +------ drivers/scsi/sg.c | 4 +--- fs/fcntl.c | 2 ++ fs/ioctl.c | 2 +- fs/pipe.c | 16 +++------------- sound/core/control.c | 7 ++----- sound/core/pcm_native.c | 4 +--- sound/core/timer.c | 6 +----- 17 files changed, 22 insertions(+), 73 deletions(-) [...] diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 3838bc4..cb15bfa 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c @@ -1325,11 +1325,7 @@ static int dv1394_fasync(int fd, struct file *file, int on) struct video_card *video = file_to_video_card(file); - int retval = fasync_helper(fd, file, on, &video->fasync); - - if (retval < 0) - return retval; - return 0; + return fasync_helper(fd, file, on, &video->fasync); } static ssize_t dv1394_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) [...]