public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolai Stange <nicstange@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugfs: fix debugfs_real_fops() build error
Date: Tue, 14 Nov 2017 12:50:59 +0100	[thread overview]
Message-ID: <20171114115059.GB26814@kroah.com> (raw)
In-Reply-To: <20171114114109.257057-1-arnd@arndb.de>

On Tue, Nov 14, 2017 at 12:40:31PM +0100, Arnd Bergmann wrote:
> Some drivers use debugfs_real_fops() even when CONFIG_DEBUG_FS is disabled,
> which now leads to a build error:
> 
> In file included from include/linux/list.h:9:0,
>                  from include/linux/wait.h:7,
>                  from include/linux/wait_bit.h:8,
>                  from include/linux/fs.h:6,
>                  from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26:
> drivers/net/wireless/broadcom/b43legacy/debugfs.c: In function 'b43legacy_debugfs_read':
> drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:23: error: implicit declaration of function 'debugfs_real_fops'; did you mean 'debugfs_create_bool'? [-Werror=implicit-function-declaration]
> 
> My first impulse was to add another 'static inline' dummy function
> returning NULL for it, which would work fine. However, most callers
> feed the pointer into container_of(), so it seems a little dangerous
> here. Since all the callers are inside of a read/write file operation
> that gets eliminated in this configuration, so having an 'extern'
> declaration seems better here. If it ever gets used in a dangerous
> way, that will now result in a link error.

Ok, but does your patch really "fix" anything?  The linker should now
complain, not the compiler, for these types of configurations?

thanks,

greg k-h

  reply	other threads:[~2017-11-14 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 11:40 [PATCH] debugfs: fix debugfs_real_fops() build error Arnd Bergmann
2017-11-14 11:50 ` Greg Kroah-Hartman [this message]
2017-11-14 12:37   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171114115059.GB26814@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicstange@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox