oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug'
@ 2023-03-11  5:01 kernel test robot
  2023-03-13  4:17 ` [PATCH] dyndbg: ensure exported functions have a prototype Jason Baron
  2023-03-13  4:21 ` [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' Jason Baron
  0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2023-03-11  5:01 UTC (permalink / raw)
  To: Jason Baron; +Cc: oe-kbuild-all, Luis Chamberlain

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next
head:   40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d
commit: 40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d [9/9] dyndbg: cleanup dynamic usage in ib_srp.c
config: parisc-randconfig-r011-20230310 (https://download.01.org/0day-ci/archive/20230311/202303111333.Rqs7rhRE-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.1.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/mcgrof/linux.git/commit/?id=40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d
        git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
        git fetch --no-tags mcgrof modules-next
        git checkout 40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303111333.Rqs7rhRE-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' [-Wmissing-prototypes]
     857 | void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
         |      ^~~~~~~~~~~~~~~~~~
>> lib/dynamic_debug.c:877:6: warning: no previous prototype for '__dynamic_dev_dbg' [-Wmissing-prototypes]
     877 | void __dynamic_dev_dbg(struct _ddebug *descriptor,
         |      ^~~~~~~~~~~~~~~~~
>> lib/dynamic_debug.c:908:6: warning: no previous prototype for '__dynamic_netdev_dbg' [-Wmissing-prototypes]
     908 | void __dynamic_netdev_dbg(struct _ddebug *descriptor,
         |      ^~~~~~~~~~~~~~~~~~~~


vim +/__dynamic_pr_debug +857 lib/dynamic_debug.c

640d1eaff2c09e Jim Cromie       2021-05-04  856  
906d201530f2c5 Joe Perches      2014-09-24 @857  void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
8ba6ebf583f12d Bart Van Assche  2011-01-23  858  {
8ba6ebf583f12d Bart Van Assche  2011-01-23  859  	va_list args;
431625dac14de7 Jason Baron      2011-10-04  860  	struct va_format vaf;
640d1eaff2c09e Jim Cromie       2021-05-04  861  	char buf[PREFIX_SIZE] = "";
8ba6ebf583f12d Bart Van Assche  2011-01-23  862  
8ba6ebf583f12d Bart Van Assche  2011-01-23  863  	BUG_ON(!descriptor);
8ba6ebf583f12d Bart Van Assche  2011-01-23  864  	BUG_ON(!fmt);
8ba6ebf583f12d Bart Van Assche  2011-01-23  865  
8ba6ebf583f12d Bart Van Assche  2011-01-23  866  	va_start(args, fmt);
798efc60e42768 Joe Perches      2012-09-12  867  
431625dac14de7 Jason Baron      2011-10-04  868  	vaf.fmt = fmt;
431625dac14de7 Jason Baron      2011-10-04  869  	vaf.va = &args;
798efc60e42768 Joe Perches      2012-09-12  870  
906d201530f2c5 Joe Perches      2014-09-24  871  	printk(KERN_DEBUG "%s%pV", dynamic_emit_prefix(descriptor, buf), &vaf);
798efc60e42768 Joe Perches      2012-09-12  872  
8ba6ebf583f12d Bart Van Assche  2011-01-23  873  	va_end(args);
8ba6ebf583f12d Bart Van Assche  2011-01-23  874  }
8ba6ebf583f12d Bart Van Assche  2011-01-23  875  EXPORT_SYMBOL(__dynamic_pr_debug);
8ba6ebf583f12d Bart Van Assche  2011-01-23  876  
906d201530f2c5 Joe Perches      2014-09-24 @877  void __dynamic_dev_dbg(struct _ddebug *descriptor,
cbc4663552ee47 Joe Perches      2011-08-11  878  		      const struct device *dev, const char *fmt, ...)
cbc4663552ee47 Joe Perches      2011-08-11  879  {
cbc4663552ee47 Joe Perches      2011-08-11  880  	struct va_format vaf;
cbc4663552ee47 Joe Perches      2011-08-11  881  	va_list args;
cbc4663552ee47 Joe Perches      2011-08-11  882  
cbc4663552ee47 Joe Perches      2011-08-11  883  	BUG_ON(!descriptor);
cbc4663552ee47 Joe Perches      2011-08-11  884  	BUG_ON(!fmt);
cbc4663552ee47 Joe Perches      2011-08-11  885  
cbc4663552ee47 Joe Perches      2011-08-11  886  	va_start(args, fmt);
798efc60e42768 Joe Perches      2012-09-12  887  
cbc4663552ee47 Joe Perches      2011-08-11  888  	vaf.fmt = fmt;
cbc4663552ee47 Joe Perches      2011-08-11  889  	vaf.va = &args;
798efc60e42768 Joe Perches      2012-09-12  890  
798efc60e42768 Joe Perches      2012-09-12  891  	if (!dev) {
906d201530f2c5 Joe Perches      2014-09-24  892  		printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
798efc60e42768 Joe Perches      2012-09-12  893  	} else {
640d1eaff2c09e Jim Cromie       2021-05-04  894  		char buf[PREFIX_SIZE] = "";
798efc60e42768 Joe Perches      2012-09-12  895  
a39d4a857d4bb0 Joe Perches      2014-12-10  896  		dev_printk_emit(LOGLEVEL_DEBUG, dev, "%s%s %s: %pV",
798efc60e42768 Joe Perches      2012-09-12  897  				dynamic_emit_prefix(descriptor, buf),
666f355f3805d6 Joe Perches      2012-09-12  898  				dev_driver_string(dev), dev_name(dev),
666f355f3805d6 Joe Perches      2012-09-12  899  				&vaf);
798efc60e42768 Joe Perches      2012-09-12  900  	}
798efc60e42768 Joe Perches      2012-09-12  901  
cbc4663552ee47 Joe Perches      2011-08-11  902  	va_end(args);
cbc4663552ee47 Joe Perches      2011-08-11  903  }
cbc4663552ee47 Joe Perches      2011-08-11  904  EXPORT_SYMBOL(__dynamic_dev_dbg);
cbc4663552ee47 Joe Perches      2011-08-11  905  
0feefd97861f9b Jason Baron      2011-10-04  906  #ifdef CONFIG_NET
0feefd97861f9b Jason Baron      2011-10-04  907  
906d201530f2c5 Joe Perches      2014-09-24 @908  void __dynamic_netdev_dbg(struct _ddebug *descriptor,
ffa10cb47a94c9 Jason Baron      2011-08-11  909  			  const struct net_device *dev, const char *fmt, ...)
ffa10cb47a94c9 Jason Baron      2011-08-11  910  {
ffa10cb47a94c9 Jason Baron      2011-08-11  911  	struct va_format vaf;
ffa10cb47a94c9 Jason Baron      2011-08-11  912  	va_list args;
ffa10cb47a94c9 Jason Baron      2011-08-11  913  
ffa10cb47a94c9 Jason Baron      2011-08-11  914  	BUG_ON(!descriptor);
ffa10cb47a94c9 Jason Baron      2011-08-11  915  	BUG_ON(!fmt);
ffa10cb47a94c9 Jason Baron      2011-08-11  916  
ffa10cb47a94c9 Jason Baron      2011-08-11  917  	va_start(args, fmt);
b004ff4972e2a4 Joe Perches      2012-09-12  918  
ffa10cb47a94c9 Jason Baron      2011-08-11  919  	vaf.fmt = fmt;
ffa10cb47a94c9 Jason Baron      2011-08-11  920  	vaf.va = &args;
b004ff4972e2a4 Joe Perches      2012-09-12  921  
b004ff4972e2a4 Joe Perches      2012-09-12  922  	if (dev && dev->dev.parent) {
640d1eaff2c09e Jim Cromie       2021-05-04  923  		char buf[PREFIX_SIZE] = "";
b004ff4972e2a4 Joe Perches      2012-09-12  924  
a39d4a857d4bb0 Joe Perches      2014-12-10  925  		dev_printk_emit(LOGLEVEL_DEBUG, dev->dev.parent,
ccc7f4968a18b9 Veaceslav Falico 2014-07-17  926  				"%s%s %s %s%s: %pV",
b004ff4972e2a4 Joe Perches      2012-09-12  927  				dynamic_emit_prefix(descriptor, buf),
b004ff4972e2a4 Joe Perches      2012-09-12  928  				dev_driver_string(dev->dev.parent),
b004ff4972e2a4 Joe Perches      2012-09-12  929  				dev_name(dev->dev.parent),
ccc7f4968a18b9 Veaceslav Falico 2014-07-17  930  				netdev_name(dev), netdev_reg_state(dev),
ccc7f4968a18b9 Veaceslav Falico 2014-07-17  931  				&vaf);
b004ff4972e2a4 Joe Perches      2012-09-12  932  	} else if (dev) {
906d201530f2c5 Joe Perches      2014-09-24  933  		printk(KERN_DEBUG "%s%s: %pV", netdev_name(dev),
ccc7f4968a18b9 Veaceslav Falico 2014-07-17  934  		       netdev_reg_state(dev), &vaf);
b004ff4972e2a4 Joe Perches      2012-09-12  935  	} else {
906d201530f2c5 Joe Perches      2014-09-24  936  		printk(KERN_DEBUG "(NULL net_device): %pV", &vaf);
b004ff4972e2a4 Joe Perches      2012-09-12  937  	}
b004ff4972e2a4 Joe Perches      2012-09-12  938  
ffa10cb47a94c9 Jason Baron      2011-08-11  939  	va_end(args);
ffa10cb47a94c9 Jason Baron      2011-08-11  940  }
ffa10cb47a94c9 Jason Baron      2011-08-11  941  EXPORT_SYMBOL(__dynamic_netdev_dbg);
ffa10cb47a94c9 Jason Baron      2011-08-11  942  

:::::: The code at line 857 was first introduced by commit
:::::: 906d201530f2c52aeb4eee31895c71cdccf1e9a0 dynamic_debug: change __dynamic_<foo>_dbg return types to void

:::::: TO: Joe Perches <joe@perches.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] dyndbg: ensure exported functions have a prototype
  2023-03-11  5:01 [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' kernel test robot
@ 2023-03-13  4:17 ` Jason Baron
  2023-03-13  4:21 ` [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' Jason Baron
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Baron @ 2023-03-13  4:17 UTC (permalink / raw)
  To: mcgrof; +Cc: oe-kbuild-all, Jim Cromie

After commit 3b5dda5ee141("dyndbg: cleanup dynamic usage in
ib_srp.c"), the exported functions in lib/dynamic_debug.c itself may
not have a prototype if CONFIG_DYNAMIC_DEBUG=n and
CONFIG_DYNAMIC_CORE=y. This can tigger the -Wmissing-prototypes
warning.

The exported functions are behind (include/linux/dynamic_debug.h):

if defined(CONFIG_DYNAMIC_DEBUG) || \
 (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))

Thus, by adding -DDYNAMIC_CONFIG_MODULE to the lib/Makefile we
can ensure that the exported functions have a prototype in all cases,
since lib/dynamic_debug.c is built whenever
CONFIG_DYNAMIC_DEBUG_CORE=y.

CC: Jim Cromie <jim.cromie@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-all/202303111333.Rqs7rhRE-lkp@intel.com/__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_Hv-uYrPWM$ 
Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 lib/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/Makefile b/lib/Makefile
index baf2821f7a00..7afcd85f78f6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -231,6 +231,9 @@ lib-$(CONFIG_GENERIC_BUG) += bug.o
 obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
 
 obj-$(CONFIG_DYNAMIC_DEBUG_CORE) += dynamic_debug.o
+#ensure exported functions have prototypes
+CFLAGS_dynamic_debug.o := -DDYNAMIC_DEBUG_MODULE
+
 obj-$(CONFIG_SYMBOLIC_ERRNAME) += errname.o
 
 obj-$(CONFIG_NLATTR) += nlattr.o
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug'
  2023-03-11  5:01 [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' kernel test robot
  2023-03-13  4:17 ` [PATCH] dyndbg: ensure exported functions have a prototype Jason Baron
@ 2023-03-13  4:21 ` Jason Baron
  2023-03-19 20:28   ` Luis Chamberlain
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Baron @ 2023-03-13  4:21 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, Luis Chamberlain

On 3/11/23 12:01 AM, kernel test robot wrote:
> tree:   https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_HvdaXu2a4$  modules-next
> head:   40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d
> commit: 40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d [9/9] dyndbg: cleanup dynamic usage in ib_srp.c
> config: parisc-randconfig-r011-20230310 (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20230311/202303111333.Rqs7rhRE-lkp@intel.com/config__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_Hv3X0Zx8I$ )
> compiler: hppa-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
>          wget https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_HvxXRA7As$  -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?id=40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_Hv3nGWtus$
>          git remote add mcgrof https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_HvdaXu2a4$
>          git fetch --no-tags mcgrof modules-next
>          git checkout 40cf65c2c7dfb5bd2e553e80c20f4693430b6d4d
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc olddefconfig
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-all/202303111333.Rqs7rhRE-lkp@intel.com/__;!!GjvTz_vk!UY-kgys0XdPUeY6rTX_-r8Bq3Jxd2BsmLVXx_TjSIX5be32flJLNsGMrdGCIZ_Hv-uYrPWM$
> 
> All warnings (new ones prefixed by >>):
> 
>>> lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' [-Wmissing-prototypes]
>       857 | void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
>           |      ^~~~~~~~~~~~~~~~~~
>>> lib/dynamic_debug.c:877:6: warning: no previous prototype for '__dynamic_dev_dbg' [-Wmissing-prototypes]
>       877 | void __dynamic_dev_dbg(struct _ddebug *descriptor,
>           |      ^~~~~~~~~~~~~~~~~
>>> lib/dynamic_debug.c:908:6: warning: no previous prototype for '__dynamic_netdev_dbg' [-Wmissing-prototypes]
>       908 | void __dynamic_netdev_dbg(struct _ddebug *descriptor,
>           |      ^~~~~~~~~~~~~~~~~~~~
> 

Hi Luis,

More Whack-A-Mole here. I cross-compiled to reproduce this error and 
seems like lots of functions in other files hit this warning. However, 
it's newly introduced with the latest patch added to modules-next, and 
thus I've sent a patch in reply to the thread to address it. Perhaps, it 
can be folded into the previous patch if it makes sense?

Thanks,

-Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug'
  2023-03-13  4:21 ` [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' Jason Baron
@ 2023-03-19 20:28   ` Luis Chamberlain
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2023-03-19 20:28 UTC (permalink / raw)
  To: Jason Baron; +Cc: kernel test robot, oe-kbuild-all

On Mon, Mar 13, 2023 at 12:21:10AM -0400, Jason Baron wrote:
> More Whack-A-Mole here. I cross-compiled to reproduce this error and seems
> like lots of functions in other files hit this warning. However, it's newly
> introduced with the latest patch added to modules-next, and thus I've sent a
> patch in reply to the thread to address it. Perhaps, it can be folded into
> the previous patch if it makes sense?

Sure I squashed it into the original patch and replaced the urldefense.com long
eye sore URLs with proper small ones.

Push to modules-next.

Thanks!

  Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-19 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11  5:01 [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' kernel test robot
2023-03-13  4:17 ` [PATCH] dyndbg: ensure exported functions have a prototype Jason Baron
2023-03-13  4:21 ` [mcgrof:modules-next 9/9] lib/dynamic_debug.c:857:6: warning: no previous prototype for '__dynamic_pr_debug' Jason Baron
2023-03-19 20:28   ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).