All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [rostedt-trace:pmem-on-reserve-mem-fail 9/10] kernel/trace/trace.c:6057:22: warning: variable 'size' set but not used
Date: Wed, 12 Feb 2025 10:25:23 +0800	[thread overview]
Message-ID: <202502121018.b3B9Co7p-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git pmem-on-reserve-mem-fail
head:   d877ee1b587be39c141df16a6f92efb0e90b30fd
commit: 521bc0e5286c93eb4be981d22a6c05043a78b555 [9/10] tracing: Update modules to persistent instances when removed
config: i386-buildonly-randconfig-002-20250212 (https://download.01.org/0day-ci/archive/20250212/202502121018.b3B9Co7p-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250212/202502121018.b3B9Co7p-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502121018.b3B9Co7p-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/trace.c: In function 'save_mod':
   kernel/trace/trace.c:6034:45: error: invalid use of undefined type 'struct module'
    6034 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                             ^~
   kernel/trace/trace.c:6034:51: error: 'MOD_TEXT' undeclared (first use in this function)
    6034 |         entry->mod_addr = (unsigned long)mod->mem[MOD_TEXT].base;
         |                                                   ^~~~~~~~
   kernel/trace/trace.c:6034:51: note: each undeclared identifier is reported only once for each function it appears in
   In file included from arch/x86/include/asm/page_32.h:18,
                    from arch/x86/include/asm/page.h:14,
                    from arch/x86/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:60,
                    from include/linux/spinlock.h:60,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:7,
                    from include/linux/ring_buffer.h:5,
                    from kernel/trace/trace.c:15:
   kernel/trace/trace.c:6035:37: error: invalid use of undefined type 'struct module'
    6035 |         strscpy(entry->mod_name, mod->name);
         |                                     ^~
   include/linux/string.h:80:28: note: in definition of macro '__strscpy0'
      80 |         sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) +    \
         |                            ^~~
   kernel/trace/trace.c:6035:9: note: in expansion of macro 'strscpy'
    6035 |         strscpy(entry->mod_name, mod->name);
         |         ^~~~~~~
   In file included from include/asm-generic/bug.h:5,
                    from arch/x86/include/asm/bug.h:99,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:6:
   kernel/trace/trace.c:6035:37: error: invalid use of undefined type 'struct module'
    6035 |         strscpy(entry->mod_name, mod->name);
         |                                     ^~
   include/linux/compiler.h:237:79: note: in definition of macro '__BUILD_BUG_ON_ZERO_MSG'
     237 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                               ^
   include/linux/compiler.h:245:33: note: in expansion of macro '__annotated'
     245 |         __BUILD_BUG_ON_ZERO_MSG(__annotated(p, nonstring), "must be cstr (NUL-terminated)")
         |                                 ^~~~~~~~~~~
   include/linux/string.h:81:55: note: in expansion of macro '__must_be_cstr'
      81 |                                 __must_be_cstr(dst) + __must_be_cstr(src))
         |                                                       ^~~~~~~~~~~~~~
   include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   kernel/trace/trace.c:6035:9: note: in expansion of macro 'strscpy'
    6035 |         strscpy(entry->mod_name, mod->name);
         |         ^~~~~~~
   kernel/trace/trace.c: In function 'remove_mod':
   kernel/trace/trace.c:6068:58: error: invalid use of undefined type 'struct module'
    6068 |                 if (entry->mod_addr == (unsigned long)mod->mem[MOD_TEXT].base)
         |                                                          ^~
   kernel/trace/trace.c:6068:64: error: 'MOD_TEXT' undeclared (first use in this function)
    6068 |                 if (entry->mod_addr == (unsigned long)mod->mem[MOD_TEXT].base)
         |                                                                ^~~~~~~~
>> kernel/trace/trace.c:6057:22: warning: variable 'size' set but not used [-Wunused-but-set-variable]
    6057 |         unsigned int size;
         |                      ^~~~
   kernel/trace/trace.c: At top level:
>> kernel/trace/trace.c:6051:12: warning: 'remove_mod' defined but not used [-Wunused-function]
    6051 | static int remove_mod(struct module *mod, void *data)
         |            ^~~~~~~~~~


vim +/size +6057 kernel/trace/trace.c

  6050	
> 6051	static int remove_mod(struct module *mod, void *data)
  6052	{
  6053		struct trace_array *tr = data;
  6054		struct trace_scratch *tscratch;
  6055		struct trace_mod_entry *entry;
  6056		unsigned int idx;
> 6057		unsigned int size;
  6058	
  6059		guard(mutex)(&scratch_mutex);
  6060	
  6061		tscratch = tr->scratch;
  6062		if (!tscratch)
  6063			return -1;
  6064		size = tr->scratch_size;
  6065	
  6066		for (idx = 0; idx < tscratch->nr_entries; idx++) {
  6067			entry = &tscratch->entries[idx];
> 6068			if (entry->mod_addr == (unsigned long)mod->mem[MOD_TEXT].base)
  6069				break;
  6070		}
  6071		if (idx == tscratch->nr_entries)
  6072			return -1;
  6073	
  6074		if (idx < tscratch->first_free_slot)
  6075			tscratch->first_free_slot = idx;
  6076	
  6077		entry->mod_addr = 0;
  6078		entry->mod_name[0] = '\0';
  6079	
  6080		return 0;
  6081	}
  6082	

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

                 reply	other threads:[~2025-02-12  2:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202502121018.b3B9Co7p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    /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.