All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Petr Mladek <pmladek@suse.com>
Subject: Re: [printk:for-5.15-printk-index 4/5] kernel/printk/index.c:140:6: warning: no previous prototype for 'pi_create_file'
Date: Tue, 20 Jul 2021 13:02:33 +0100	[thread overview]
Message-ID: <YPa7WTw2rmYpI1uE@chrisdown.name> (raw)
In-Reply-To: <202107192303.qeABbFBe-lkp@intel.com>

kernel test robot writes:
>tree:   https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git for-5.15-printk-index
>head:   ad7d61f159db73974f1b0352f21afe04b0bbd920
>commit: 337015573718b161891a3473d25f59273f2e626b [4/5] printk: Userspace format indexing support
>config: arc-allyesconfig (attached as .config)
>compiler: arceb-elf-gcc (GCC) 10.3.0
>reproduce (this is a W=1 build):
>        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>        chmod +x ~/bin/make.cross
>        # https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/commit/?id=337015573718b161891a3473d25f59273f2e626b
>        git remote add printk https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
>        git fetch --no-tags printk for-5.15-printk-index
>        git checkout 337015573718b161891a3473d25f59273f2e626b
>        # save the attached .config to linux build tree
>        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc
>
>If you fix the issue, kindly add following tag as appropriate
>Reported-by: kernel test robot <lkp@intel.com>
>
>All warnings (new ones prefixed by >>):
>
>>> kernel/printk/index.c:140:6: warning: no previous prototype for 'pi_create_file' [-Wmissing-prototypes]
>     140 | void pi_create_file(struct module *mod)
>         |      ^~~~~~~~~~~~~~
>>> kernel/printk/index.c:146:6: warning: no previous prototype for 'pi_remove_file' [-Wmissing-prototypes]
>     146 | void pi_remove_file(struct module *mod)
>         |      ^~~~~~~~~~~~~~

Ah, I missed `static inline', which causes the compiler to think we want to 
export it even though we don't.

diff --git kernel/printk/index.c kernel/printk/index.c
index ca062f5e1779..e340e0a8b847 100644
--- kernel/printk/index.c
+++ kernel/printk/index.c
@@ -137,13 +137,13 @@ static const char *pi_get_module_name(struct module *mod)
  }
  #endif
  
-void pi_create_file(struct module *mod)
+static inline void pi_create_file(struct module *mod)
  {
  	debugfs_create_file(pi_get_module_name(mod), 0444, dfs_index,
  				       mod, &dfs_index_fops);
  }
  
-void pi_remove_file(struct module *mod)
+static inline void pi_remove_file(struct module *mod)
  {
  	debugfs_remove(debugfs_lookup(pi_get_module_name(mod), dfs_index));
  }

WARNING: multiple messages have this Message-ID (diff)
From: Chris Down <chris@chrisdown.name>
To: kbuild-all@lists.01.org
Subject: Re: [printk:for-5.15-printk-index 4/5] kernel/printk/index.c:140:6: warning: no previous prototype for 'pi_create_file'
Date: Tue, 20 Jul 2021 13:02:33 +0100	[thread overview]
Message-ID: <YPa7WTw2rmYpI1uE@chrisdown.name> (raw)
In-Reply-To: <202107192303.qeABbFBe-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]

kernel test robot writes:
>tree:   https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git for-5.15-printk-index
>head:   ad7d61f159db73974f1b0352f21afe04b0bbd920
>commit: 337015573718b161891a3473d25f59273f2e626b [4/5] printk: Userspace format indexing support
>config: arc-allyesconfig (attached as .config)
>compiler: arceb-elf-gcc (GCC) 10.3.0
>reproduce (this is a W=1 build):
>        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>        chmod +x ~/bin/make.cross
>        # https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/commit/?id=337015573718b161891a3473d25f59273f2e626b
>        git remote add printk https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
>        git fetch --no-tags printk for-5.15-printk-index
>        git checkout 337015573718b161891a3473d25f59273f2e626b
>        # save the attached .config to linux build tree
>        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc
>
>If you fix the issue, kindly add following tag as appropriate
>Reported-by: kernel test robot <lkp@intel.com>
>
>All warnings (new ones prefixed by >>):
>
>>> kernel/printk/index.c:140:6: warning: no previous prototype for 'pi_create_file' [-Wmissing-prototypes]
>     140 | void pi_create_file(struct module *mod)
>         |      ^~~~~~~~~~~~~~
>>> kernel/printk/index.c:146:6: warning: no previous prototype for 'pi_remove_file' [-Wmissing-prototypes]
>     146 | void pi_remove_file(struct module *mod)
>         |      ^~~~~~~~~~~~~~

Ah, I missed `static inline', which causes the compiler to think we want to 
export it even though we don't.

diff --git kernel/printk/index.c kernel/printk/index.c
index ca062f5e1779..e340e0a8b847 100644
--- kernel/printk/index.c
+++ kernel/printk/index.c
@@ -137,13 +137,13 @@ static const char *pi_get_module_name(struct module *mod)
  }
  #endif
  
-void pi_create_file(struct module *mod)
+static inline void pi_create_file(struct module *mod)
  {
  	debugfs_create_file(pi_get_module_name(mod), 0444, dfs_index,
  				       mod, &dfs_index_fops);
  }
  
-void pi_remove_file(struct module *mod)
+static inline void pi_remove_file(struct module *mod)
  {
  	debugfs_remove(debugfs_lookup(pi_get_module_name(mod), dfs_index));
  }

  reply	other threads:[~2021-07-20 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 15:33 [printk:for-5.15-printk-index 4/5] kernel/printk/index.c:140:6: warning: no previous prototype for 'pi_create_file' kernel test robot
2021-07-19 15:33 ` kernel test robot
2021-07-20 12:02 ` Chris Down [this message]
2021-07-20 12:02   ` Chris Down
2021-07-21  8:59   ` Petr Mladek
2021-07-21  8:59     ` Petr Mladek
2021-07-23 11:19   ` Petr Mladek
2021-07-23 11:19     ` Petr Mladek

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=YPa7WTw2rmYpI1uE@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=pmladek@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.