Skip to content

Commit 3a4bc2f

Browse files
rob-wardgregkh
authored andcommitted
drivers: char: mem: Simplify DEVPORT configuration
Simplify the use of CONFIG_DEVPORT by making the port_fops so that it includes __maybe_unused. This enabled the multiple #ifdef's used for this structure to be removed and brings it in line with the use of CONFIG_DEVMEM This change should introduce no functional changes. Signed-off-by: Rob Ward <robert.ward114@googlemail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a8c9125 commit 3a4bc2f

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎drivers/char/mem.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
542542
return virtr + wrote ? : err;
543543
}
544544

545-
#ifdef CONFIG_DEVPORT
546545
static ssize_t read_port(struct file *file, char __user *buf,
547546
size_t count, loff_t *ppos)
548547
{
@@ -583,7 +582,6 @@ static ssize_t write_port(struct file *file, const char __user *buf,
583582
*ppos = i;
584583
return tmp-buf;
585584
}
586-
#endif
587585

588586
static ssize_t read_null(struct file *file, char __user *buf,
589587
size_t count, loff_t *ppos)
@@ -738,14 +736,12 @@ static const struct file_operations null_fops = {
738736
.splice_write = splice_write_null,
739737
};
740738

741-
#ifdef CONFIG_DEVPORT
742-
static const struct file_operations port_fops = {
739+
static const struct file_operations __maybe_unused port_fops = {
743740
.llseek = memory_lseek,
744741
.read = read_port,
745742
.write = write_port,
746743
.open = open_port,
747744
};
748-
#endif
749745

750746
static const struct file_operations zero_fops = {
751747
.llseek = zero_lseek,

0 commit comments

Comments
 (0)