Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

char/mwave: remove unneeded fops

file_operations::{read/write/open/release} need not be defined. The core
code return proper values already (the same as the being removed ones).
So there is no need to preserve these just for tracing via printk.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251119091949.825958-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
3b4df232 48e77862

-62
-62
drivers/char/mwave/mwavedd.c
··· 86 86 module_param_hw(mwave_uart_irq, int, irq, 0); 87 87 module_param_hw(mwave_uart_io, int, ioport, 0); 88 88 89 - static int mwave_open(struct inode *inode, struct file *file); 90 - static int mwave_close(struct inode *inode, struct file *file); 91 - static long mwave_ioctl(struct file *filp, unsigned int iocmd, 92 - unsigned long ioarg); 93 - 94 89 MWAVE_DEVICE_DATA mwave_s_mdd; 95 - 96 - static int mwave_open(struct inode *inode, struct file *file) 97 - { 98 - unsigned int retval = 0; 99 - 100 - PRINTK_3(TRACE_MWAVE, 101 - "mwavedd::mwave_open, entry inode %p file %p\n", 102 - inode, file); 103 - PRINTK_2(TRACE_MWAVE, 104 - "mwavedd::mwave_open, exit return retval %x\n", retval); 105 - 106 - return retval; 107 - } 108 - 109 - static int mwave_close(struct inode *inode, struct file *file) 110 - { 111 - unsigned int retval = 0; 112 - 113 - PRINTK_3(TRACE_MWAVE, 114 - "mwavedd::mwave_close, entry inode %p file %p\n", 115 - inode, file); 116 - 117 - PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n", 118 - retval); 119 - 120 - return retval; 121 - } 122 90 123 91 static long mwave_ioctl(struct file *file, unsigned int iocmd, 124 92 unsigned long ioarg) ··· 378 410 return retval; 379 411 } 380 412 381 - 382 - static ssize_t mwave_read(struct file *file, char __user *buf, size_t count, 383 - loff_t * ppos) 384 - { 385 - PRINTK_5(TRACE_MWAVE, 386 - "mwavedd::mwave_read entry file %p, buf %p, count %zx ppos %p\n", 387 - file, buf, count, ppos); 388 - 389 - return -EINVAL; 390 - } 391 - 392 - 393 - static ssize_t mwave_write(struct file *file, const char __user *buf, 394 - size_t count, loff_t * ppos) 395 - { 396 - PRINTK_5(TRACE_MWAVE, 397 - "mwavedd::mwave_write entry file %p, buf %p," 398 - " count %zx ppos %p\n", 399 - file, buf, count, ppos); 400 - 401 - return -EINVAL; 402 - } 403 - 404 - 405 413 static int register_serial_portandirq(unsigned int port, int irq) 406 414 { 407 415 struct uart_8250_port uart; ··· 422 478 return serial8250_register_8250_port(&uart); 423 479 } 424 480 425 - 426 481 static const struct file_operations mwave_fops = { 427 482 .owner = THIS_MODULE, 428 - .read = mwave_read, 429 - .write = mwave_write, 430 483 .unlocked_ioctl = mwave_ioctl, 431 - .open = mwave_open, 432 - .release = mwave_close, 433 484 .llseek = default_llseek, 434 485 }; 435 - 436 486 437 487 static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops }; 438 488