lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 11:50:03 +0800
From:   kernel test robot <lkp@...el.com>
To:     chensong <chensong_2000@....cn>, greg@...ah.com,
        linux-kernel@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, abbotti@....co.uk,
        hsweeten@...ionengravers.com, chensong@...kylinos.cn,
        chensong <chensong_2000@....cn>
Subject: Re: [PATCH] staging: comedi: remove warnings of comedi_lrange

Hi chensong,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/chensong/staging-comedi-remove-warnings-of-comedi_lrange/20201223-104542
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 5e60366d56c630e32befce7ef05c569e04391ca3
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.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://github.com/0day-ci/linux/commit/fec78f1f56c0e63e9240b5b30c3b98d29ecc9a49
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review chensong/staging-comedi-remove-warnings-of-comedi_lrange/20201223-104542
        git checkout fec78f1f56c0e63e9240b5b30c3b98d29ecc9a49
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/staging/comedi/drivers/das16.c: In function 'das16_ai_range':
   drivers/staging/comedi/drivers/das16.c:971:18: error: assignment of member 'length' in read-only object
     971 |   lrange->length = 1;
         |                  ^
>> drivers/staging/comedi/drivers/das16.c:972:10: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     972 |   krange = lrange->range;
         |          ^
   drivers/staging/comedi/drivers/das16.c: In function 'das16_ao_range':
   drivers/staging/comedi/drivers/das16.c:1005:18: error: assignment of member 'length' in read-only object
    1005 |   lrange->length = 1;
         |                  ^
   drivers/staging/comedi/drivers/das16.c:1006:10: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1006 |   krange = lrange->range;
         |          ^


vim +/const +972 drivers/staging/comedi/drivers/das16.c

742c4a095973f69 H Hartley Sweeten 2015-01-12  949  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  950  static const struct comedi_lrange *das16_ai_range(struct comedi_device *dev,
0ce8280e2876091 H Hartley Sweeten 2015-01-26  951  						  struct comedi_subdevice *s,
0ce8280e2876091 H Hartley Sweeten 2015-01-26  952  						  struct comedi_devconfig *it,
0ce8280e2876091 H Hartley Sweeten 2015-01-26  953  						  unsigned int pg_type,
0ce8280e2876091 H Hartley Sweeten 2015-01-26  954  						  unsigned int status)
0ce8280e2876091 H Hartley Sweeten 2015-01-26  955  {
0ce8280e2876091 H Hartley Sweeten 2015-01-26  956  	unsigned int min = it->options[4];
0ce8280e2876091 H Hartley Sweeten 2015-01-26  957  	unsigned int max = it->options[5];
0ce8280e2876091 H Hartley Sweeten 2015-01-26  958  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  959  	/* get any user-defined input range */
0ce8280e2876091 H Hartley Sweeten 2015-01-26  960  	if (pg_type == das16_pg_none && (min || max)) {
fec78f1f56c0e63 chensong          2020-12-23  961  		const struct comedi_lrange *lrange;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  962  		struct comedi_krange *krange;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  963  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  964  		/* allocate single-range range table */
0ce8280e2876091 H Hartley Sweeten 2015-01-26  965  		lrange = comedi_alloc_spriv(s,
0ce8280e2876091 H Hartley Sweeten 2015-01-26  966  					    sizeof(*lrange) + sizeof(*krange));
0ce8280e2876091 H Hartley Sweeten 2015-01-26  967  		if (!lrange)
0ce8280e2876091 H Hartley Sweeten 2015-01-26  968  			return &range_unknown;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  969  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  970  		/* initialize ai range */
0ce8280e2876091 H Hartley Sweeten 2015-01-26 @971  		lrange->length = 1;
0ce8280e2876091 H Hartley Sweeten 2015-01-26 @972  		krange = lrange->range;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  973  		krange->min = min;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  974  		krange->max = max;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  975  		krange->flags = UNIT_volt;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  976  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  977  		return lrange;
0ce8280e2876091 H Hartley Sweeten 2015-01-26  978  	}
0ce8280e2876091 H Hartley Sweeten 2015-01-26  979  
0ce8280e2876091 H Hartley Sweeten 2015-01-26  980  	/* use software programmable range */
0ce8280e2876091 H Hartley Sweeten 2015-01-26  981  	if (status & DAS16_STATUS_UNIPOLAR)
0ce8280e2876091 H Hartley Sweeten 2015-01-26  982  		return das16_ai_uni_lranges[pg_type];
0ce8280e2876091 H Hartley Sweeten 2015-01-26  983  	return das16_ai_bip_lranges[pg_type];
0ce8280e2876091 H Hartley Sweeten 2015-01-26  984  }
0ce8280e2876091 H Hartley Sweeten 2015-01-26  985  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (58458 bytes)

Powered by blists - more mailing lists