lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [RFC 30/32] /dev/port: don't compile file operations without CONFIG_DEVPORT
    On Wed, Dec 29, 2021 at 5:38 AM Greg Kroah-Hartman
    <gregkh@linuxfoundation.org> wrote:
    > > > > -static const struct file_operations __maybe_unused port_fops = {
    > > > > +#ifdef CONFIG_DEVPORT
    > > > > +static const struct file_operations port_fops = {
    > > > > .llseek = memory_lseek,
    > > > > .read = read_port,
    > > > > .write = write_port,
    > > > > .open = open_port,
    > > > > };
    > > > > +#endif
    > > >
    > > > Why is this #ifdef needed if it is already __maybe_unused?
    > >
    > > Because read_port() calls inb() and write_port() calls outb() they
    > > wouldn't compile once these are no longer defined. Then however the
    > > read_port/write_port symbols in the struct initialization above
    > > couldn't be resolved.
    > >
    > > >
    > > > In looking closer, this change could be taken now as the use of this
    > > > variable already is behind this same #ifdef statement, right?
    > >
    > > Yes
    >
    > Great, feel free to send this individually, not as a RFC patch, and I
    > will be glad to queue it up.

    I think this patch should contain the 'depends on HAS_IOPORT' that
    is currently added in a different patch (char: impi, tpm: depend on
    HAS_IOPORT).

    However, we can't merge that version until HAS_IOPORT is actually
    added to the kernel.

    Arnd

    \
     
     \ /
      Last update: 2021-12-30 17:20    [W:4.284 / U:0.216 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site