public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chris Down <chris@chrisdown.name>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Petr Mladek <pmladek@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	kernel-team@fb.com
Subject: Re: [PATCH v3 2/2] printk: console: Support console-specific loglevels
Date: Fri, 22 Jul 2022 00:16:08 +0800	[thread overview]
Message-ID: <202207220029.VYxE2uAL-lkp@intel.com> (raw)
In-Reply-To: <b9fa85cfed3a97ab4292daca51476e4e23da2f9a.1658339046.git.chris@chrisdown.name>

Hi Chris,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 9d882352bac8f2ff3753d691e2dc65fcaf738729]

url:    https://github.com/intel-lab-lkp/linux/commits/Chris-Down/printk-console-Per-console-loglevels/20220721-015315
base:   9d882352bac8f2ff3753d691e2dc65fcaf738729
config: riscv-randconfig-s053-20220718 (https://download.01.org/0day-ci/archive/20220722/202207220029.VYxE2uAL-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/fac1dc8424bd6e1ae37f6e180f96ed7e4f44e2fc
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Chris-Down/printk-console-Per-console-loglevels/20220721-015315
        git checkout fac1dc8424bd6e1ae37f6e180f96ed7e4f44e2fc
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash kernel/printk/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
>> kernel/printk/sysctl.c:31:47: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void * @@     got void [noderef] __user *buffer @@
   kernel/printk/sysctl.c:31:47: sparse:     expected void *
   kernel/printk/sysctl.c:31:47: sparse:     got void [noderef] __user *buffer
   kernel/printk/sysctl.c:50:52: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void * @@     got void [noderef] __user *buffer @@
   kernel/printk/sysctl.c:50:52: sparse:     expected void *
   kernel/printk/sysctl.c:50:52: sparse:     got void [noderef] __user *buffer
   kernel/printk/sysctl.c:54:45: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void * @@     got void [noderef] __user *buffer @@
   kernel/printk/sysctl.c:54:45: sparse:     expected void *
   kernel/printk/sysctl.c:54:45: sparse:     got void [noderef] __user *buffer
>> kernel/printk/sysctl.c:75:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@     expected int ( [usertype] *proc_handler )( ... ) @@     got int ( * )( ... ) @@
   kernel/printk/sysctl.c:75:35: sparse:     expected int ( [usertype] *proc_handler )( ... )
   kernel/printk/sysctl.c:75:35: sparse:     got int ( * )( ... )
   kernel/printk/sysctl.c:130:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@     expected int ( [usertype] *proc_handler )( ... ) @@     got int ( * )( ... ) @@
   kernel/printk/sysctl.c:130:35: sparse:     expected int ( [usertype] *proc_handler )( ... )
   kernel/printk/sysctl.c:130:35: sparse:     got int ( * )( ... )

vim +31 kernel/printk/sysctl.c

    26	
    27	static int printk_sysctl_deprecated(struct ctl_table *table, int write,
    28					    void __user *buffer, size_t *lenp,
    29					    loff_t *ppos)
    30	{
  > 31		int res = proc_dointvec(table, write, buffer, lenp, ppos);
    32	
    33		if (write)
    34			pr_warn_once(
    35				"printk: The kernel.printk sysctl is deprecated. Consider using kernel.console_loglevel or kernel.default_message_loglevel instead.\n"
    36			);
    37	
    38		return res;
    39	}
    40	
    41	static int printk_console_loglevel(struct ctl_table *table, int write,
    42					   void __user *buffer, size_t *lenp,
    43					   loff_t *ppos)
    44	{
    45	
    46		struct ctl_table ltable = *table;
    47		int ret, value;
    48	
    49		if (!write)
    50			return proc_dointvec(table, write, buffer, lenp, ppos);
    51	
    52		ltable.data = &value;
    53	
    54		ret = proc_dointvec(&ltable, write, buffer, lenp, ppos);
    55		if (ret)
    56			return ret;
    57	
    58		if (value < min_loglevel || value > max_loglevel)
    59			return -ERANGE;
    60	
    61		if (value < minimum_console_loglevel)
    62			return -EINVAL;
    63	
    64		console_loglevel = value;
    65	
    66		return 0;
    67	}
    68	
    69	static struct ctl_table printk_sysctls[] = {
    70		{
    71			.procname	= "printk",
    72			.data		= &console_loglevel,
    73			.maxlen		= 4*sizeof(int),
    74			.mode		= 0644,
  > 75			.proc_handler	= printk_sysctl_deprecated,
    76		},
    77		{
    78			.procname	= "printk_ratelimit",
    79			.data		= &printk_ratelimit_state.interval,
    80			.maxlen		= sizeof(int),
    81			.mode		= 0644,
    82			.proc_handler	= proc_dointvec_jiffies,
    83		},
    84		{
    85			.procname	= "printk_ratelimit_burst",
    86			.data		= &printk_ratelimit_state.burst,
    87			.maxlen		= sizeof(int),
    88			.mode		= 0644,
    89			.proc_handler	= proc_dointvec,
    90		},
    91		{
    92			.procname	= "printk_delay",
    93			.data		= &printk_delay_msec,
    94			.maxlen		= sizeof(int),
    95			.mode		= 0644,
    96			.proc_handler	= proc_dointvec_minmax,
    97			.extra1		= SYSCTL_ZERO,
    98			.extra2		= (void *)&ten_thousand,
    99		},
   100		{
   101			.procname	= "printk_devkmsg",
   102			.data		= devkmsg_log_str,
   103			.maxlen		= DEVKMSG_STR_MAX_SIZE,
   104			.mode		= 0644,
   105			.proc_handler	= devkmsg_sysctl_set_loglvl,
   106		},
   107		{
   108			.procname	= "dmesg_restrict",
   109			.data		= &dmesg_restrict,
   110			.maxlen		= sizeof(int),
   111			.mode		= 0644,
   112			.proc_handler	= proc_dointvec_minmax_sysadmin,
   113			.extra1		= SYSCTL_ZERO,
   114			.extra2		= SYSCTL_ONE,
   115		},
   116		{
   117			.procname	= "kptr_restrict",
   118			.data		= &kptr_restrict,
   119			.maxlen		= sizeof(int),
   120			.mode		= 0644,
   121			.proc_handler	= proc_dointvec_minmax_sysadmin,
   122			.extra1		= SYSCTL_ZERO,
   123			.extra2		= SYSCTL_TWO,
   124		},
   125		{
   126			.procname	= "console_loglevel",
   127			.data		= &console_loglevel,
   128			.maxlen		= sizeof(int),
   129			.mode		= 0644,
   130			.proc_handler	= printk_console_loglevel,
   131		},
   132		{
   133			.procname	= "default_message_loglevel",
   134			.data		= &default_message_loglevel,
   135			.maxlen		= sizeof(int),
   136			.mode		= 0644,
   137			.proc_handler	= proc_dointvec_minmax,
   138			.extra1		= &min_loglevel,
   139			.extra2		= &max_loglevel,
   140		},
   141		{}
   142	};
   143	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  parent reply	other threads:[~2022-07-21 16:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 17:48 [PATCH v3 0/2] printk: console: Per-console loglevels Chris Down
2022-07-20 17:48 ` [PATCH v3 1/2] printk: console: Create console= parser that supports named options Chris Down
2022-08-31 10:13   ` Petr Mladek
2022-09-05 14:43     ` Chris Down
2022-09-05 14:45       ` Chris Down
2022-09-22 15:17       ` Petr Mladek
2023-04-17 15:04     ` Chris Down
2023-04-17 15:08       ` Chris Down
2023-04-18 13:43         ` Petr Mladek
2023-04-18 13:41       ` Petr Mladek
2023-04-19  0:31         ` Chris Down
2022-07-20 17:48 ` [PATCH v3 2/2] printk: console: Support console-specific loglevels Chris Down
2022-07-21  9:50   ` kernel test robot
2022-07-21 16:20     ` Chris Down
2022-07-21 16:16   ` kernel test robot [this message]
2022-07-21 16:29     ` Chris Down
2022-09-01  9:35   ` Petr Mladek
2022-09-05 14:07     ` Chris Down
2022-09-05 15:12       ` Petr Mladek
2022-07-20 18:22 ` [PATCH v3 0/2] printk: console: Per-console loglevels John Ogness
2022-07-20 18:29   ` Chris Down

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=202207220029.VYxE2uAL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chris@chrisdown.name \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.ogness@linutronix.de \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox