From aeeadf919a8bb6cb3e1dfa9fdc8eb1c08494aee4 Mon Sep 17 00:00:00 2001 From: Rob Radez Date: Thu, 7 Aug 2003 20:26:27 -0700 Subject: [PATCH] [PATCH] remove unnecessary stubs from watchdog drivers This removes some function stubs from 6 watchdog drivers. The VFS already returns -EINVAL in cases where fop->read == NULL, so there's no need to duplicate the code 6 times. This patch removes the stubs and is compile tested. --- drivers/char/watchdog/acquirewdt.c | 8 -------- drivers/char/watchdog/alim7101_wdt.c | 7 ------- drivers/char/watchdog/ib700wdt.c | 7 ------- drivers/char/watchdog/machzwd.c | 9 --------- drivers/char/watchdog/sbc60xxwdt.c | 7 ------- drivers/char/watchdog/w83877f_wdt.c | 7 ------- 6 files changed, 45 deletions(-) diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c index 687bdf6449112..2e6e98ac932dc 100644 --- a/drivers/char/watchdog/acquirewdt.c +++ b/drivers/char/watchdog/acquirewdt.c @@ -96,13 +96,6 @@ static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_ return 0; } -static ssize_t acq_read(struct file *file, char *buf, size_t count, loff_t *ppos) -{ - return -EINVAL; -} - - - static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -193,7 +186,6 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code, static struct file_operations acq_fops = { .owner = THIS_MODULE, - .read = acq_read, .write = acq_write, .ioctl = acq_ioctl, .open = acq_open, diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c index b467eee3e8682..e98826092f8c4 100644 --- a/drivers/char/watchdog/alim7101_wdt.c +++ b/drivers/char/watchdog/alim7101_wdt.c @@ -183,12 +183,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof return 0; } -static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos) -{ - /* No can do */ - return -EINVAL; -} - static int fop_open(struct inode * inode, struct file * file) { /* Just in case we're already talking to someone... */ @@ -234,7 +228,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u static struct file_operations wdt_fops = { .owner= THIS_MODULE, .llseek= no_llseek, - .read= fop_read, .write= fop_write, .open= fop_open, .release= fop_close, diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c index 45c1d50118b96..3cb496f8efb34 100644 --- a/drivers/char/watchdog/ib700wdt.c +++ b/drivers/char/watchdog/ib700wdt.c @@ -166,12 +166,6 @@ ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) return 0; } -static ssize_t -ibwdt_read(struct file *file, char *buf, size_t count, loff_t *ppos) -{ - return -EINVAL; -} - static int ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) @@ -280,7 +274,6 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code, static struct file_operations ibwdt_fops = { .owner = THIS_MODULE, - .read = ibwdt_read, .write = ibwdt_write, .ioctl = ibwdt_ioctl, .open = ibwdt_open, diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 197806e1f2b87..87bfb0edb03a8 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c @@ -349,14 +349,6 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count, return 0; } -static ssize_t zf_read(struct file *file, char *buf, size_t count, - loff_t *ppos) -{ - return -EINVAL; -} - - - static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -448,7 +440,6 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code, static struct file_operations zf_fops = { .owner = THIS_MODULE, - .read = zf_read, .write = zf_write, .ioctl = zf_ioctl, .open = zf_open, diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c index 7230b8ce32524..ace423c678451 100644 --- a/drivers/char/watchdog/sbc60xxwdt.c +++ b/drivers/char/watchdog/sbc60xxwdt.c @@ -194,12 +194,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof return 0; } -static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos) -{ - /* No can do */ - return -EINVAL; -} - static int fop_open(struct inode * inode, struct file * file) { switch(minor(inode->i_rdev)) @@ -260,7 +254,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, - .read = fop_read, .write = fop_write, .open = fop_open, .release = fop_close, diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c index 893382f5aa58d..ca81fb8c3271b 100644 --- a/drivers/char/watchdog/w83877f_wdt.c +++ b/drivers/char/watchdog/w83877f_wdt.c @@ -202,12 +202,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof return 0; } -static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos) -{ - /* No can do */ - return -EINVAL; -} - static int fop_open(struct inode * inode, struct file * file) { switch(minor(inode->i_rdev)) @@ -268,7 +262,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, - .read = fop_read, .write = fop_write, .open = fop_open, .release = fop_close, -- 2.53.0