oe-kbuild.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* kernel/sysctl.c:317:52: warning: Parameter 'ppos' can be declared as pointer to const [constParameter]
@ 2022-11-09 18:13 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-11-09 18:13 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: kernel/sysctl.c:317:52: warning: Parameter 'ppos' can be declared as pointer to const [constParameter]"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Xiaoming Ni <nixiaoming@huawei.com>
CC: Luis Chamberlain <mcgrof@kernel.org>
CC: Jan Kara <jack@suse.cz>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f141df371335645ce29a87d9683a3f79fba7fd67
commit: 86b12b6c5d6b46e64bf2e8080528781032e4bd90 aio: move aio sysctl to aio.c
date:   10 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 10 months ago
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 86b12b6c5d6b46e64bf2e8080528781032e4bd90
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> kernel/sysctl.c:317:52: warning: Parameter 'ppos' can be declared as pointer to const [constParameter]
   static bool proc_first_pos_non_zero_ignore(loff_t *ppos,
                                                      ^
>> kernel/sysctl.c:664:19: warning: Parameter 'lenp' can be declared as pointer to const [constParameter]
             size_t *lenp, loff_t *ppos,
                     ^
>> kernel/sysctl.c:880:41: warning: Parameter 'table' can be declared as pointer to const [constParameter]
   static int proc_taint(struct ctl_table *table, int write,
                                           ^
>> kernel/sysctl.c:954:20: warning: Uninitialized variable: &tmp [uninitvar]
    int *ip = write ? &tmp : valp;
                      ^
   kernel/sysctl.c:1019:29: warning: Uninitialized variable: &tmp [uninitvar]
    unsigned int *up = write ? &tmp : valp;
                               ^

vim +/ppos +317 kernel/sysctl.c

f461d2dcd511c0 Christoph Hellwig 2020-04-24  307  
f461d2dcd511c0 Christoph Hellwig 2020-04-24  308  /**
f461d2dcd511c0 Christoph Hellwig 2020-04-24  309   * proc_first_pos_non_zero_ignore - check if first position is allowed
f461d2dcd511c0 Christoph Hellwig 2020-04-24  310   * @ppos: file position
f461d2dcd511c0 Christoph Hellwig 2020-04-24  311   * @table: the sysctl table
f461d2dcd511c0 Christoph Hellwig 2020-04-24  312   *
f461d2dcd511c0 Christoph Hellwig 2020-04-24  313   * Returns true if the first position is non-zero and the sysctl_writes_strict
f461d2dcd511c0 Christoph Hellwig 2020-04-24  314   * mode indicates this is not allowed for numeric input types. String proc
f461d2dcd511c0 Christoph Hellwig 2020-04-24  315   * handlers can ignore the return value.
f461d2dcd511c0 Christoph Hellwig 2020-04-24  316   */
f461d2dcd511c0 Christoph Hellwig 2020-04-24 @317  static bool proc_first_pos_non_zero_ignore(loff_t *ppos,
f461d2dcd511c0 Christoph Hellwig 2020-04-24  318  					   struct ctl_table *table)
^1da177e4c3f41 Linus Torvalds    2005-04-16  319  {
f461d2dcd511c0 Christoph Hellwig 2020-04-24  320  	if (!*ppos)
f461d2dcd511c0 Christoph Hellwig 2020-04-24  321  		return false;
f461d2dcd511c0 Christoph Hellwig 2020-04-24  322  
f461d2dcd511c0 Christoph Hellwig 2020-04-24  323  	switch (sysctl_writes_strict) {
f461d2dcd511c0 Christoph Hellwig 2020-04-24  324  	case SYSCTL_WRITES_STRICT:
f461d2dcd511c0 Christoph Hellwig 2020-04-24  325  		return true;
f461d2dcd511c0 Christoph Hellwig 2020-04-24  326  	case SYSCTL_WRITES_WARN:
f461d2dcd511c0 Christoph Hellwig 2020-04-24  327  		warn_sysctl_write(table);
f461d2dcd511c0 Christoph Hellwig 2020-04-24  328  		return false;
f461d2dcd511c0 Christoph Hellwig 2020-04-24  329  	default:
f461d2dcd511c0 Christoph Hellwig 2020-04-24  330  		return false;
f461d2dcd511c0 Christoph Hellwig 2020-04-24  331  	}
f461d2dcd511c0 Christoph Hellwig 2020-04-24  332  }
f461d2dcd511c0 Christoph Hellwig 2020-04-24  333  

:::::: The code at line 317 was first introduced by commit
:::::: f461d2dcd511c020a26d4d791fae595c65ed09b6 sysctl: avoid forward declarations

:::::: TO: Christoph Hellwig <hch@lst.de>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-09 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 18:13 kernel/sysctl.c:317:52: warning: Parameter 'ppos' can be declared as pointer to const [constParameter] kernel test robot

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).