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.

/dev/port: don't compile file operations without CONFIG_DEVPORT

In the future inb() and friends will not be available when compiling
with CONFIG_HAS_IOPORT=n so we must only try to access them here if
CONFIG_DEVPORT is set which depends on HAS_IOPORT.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20240404114917.3627747-2-schnelle@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Niklas Schnelle and committed by
Greg Kroah-Hartman
f0a816fb 1d6b84d2

+5 -1
+5 -1
drivers/char/mem.c
··· 383 383 return 0; 384 384 } 385 385 386 + #ifdef CONFIG_DEVPORT 386 387 static ssize_t read_port(struct file *file, char __user *buf, 387 388 size_t count, loff_t *ppos) 388 389 { ··· 425 424 *ppos = i; 426 425 return tmp-buf; 427 426 } 427 + #endif 428 428 429 429 static ssize_t read_null(struct file *file, char __user *buf, 430 430 size_t count, loff_t *ppos) ··· 655 653 .uring_cmd = uring_cmd_null, 656 654 }; 657 655 658 - static const struct file_operations __maybe_unused port_fops = { 656 + #ifdef CONFIG_DEVPORT 657 + static const struct file_operations port_fops = { 659 658 .llseek = memory_lseek, 660 659 .read = read_port, 661 660 .write = write_port, 662 661 .open = open_port, 663 662 }; 663 + #endif 664 664 665 665 static const struct file_operations zero_fops = { 666 666 .llseek = zero_lseek,