linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: chensong <chensong_2000@189.cn>,
	greg@kroah.com, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	abbotti@mev.co.uk, hsweeten@visionengravers.com,
	chensong@tj.kylinos.cn, chensong <chensong_2000@189.cn>
Subject: Re: [PATCH] staging: comedi: remove warnings of comedi_lrange
Date: Tue, 29 Dec 2020 12:00:47 +0800	[thread overview]
Message-ID: <202012291137.QKhNid2b-lkp@intel.com> (raw)
In-Reply-To: <1608690263-29411-1-git-send-email-chensong_2000@189.cn>

[-- Attachment #1: Type: text/plain, Size: 13754 bytes --]

Hi chensong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR 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: x86_64-randconfig-r012-20201223 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # 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=clang make.cross ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> drivers/staging/comedi/drivers/das16.c:971:18: error: cannot assign to variable 'lrange' with const-qualified type 'const struct comedi_lrange *'
                   lrange->length = 1;
                   ~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/das16.c:961:31: note: variable 'lrange' declared const here
                   const struct comedi_lrange *lrange;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
>> drivers/staging/comedi/drivers/das16.c:972:10: error: assigning to 'struct comedi_krange *' from 'struct comedi_krange const[]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                   krange = lrange->range;
                          ^ ~~~~~~~~~~~~~
   drivers/staging/comedi/drivers/das16.c:1005:18: error: cannot assign to variable 'lrange' with const-qualified type 'const struct comedi_lrange *'
                   lrange->length = 1;
                   ~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/das16.c:995:31: note: variable 'lrange' declared const here
                   const struct comedi_lrange *lrange;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
   drivers/staging/comedi/drivers/das16.c:1006:10: error: assigning to 'struct comedi_krange *' from 'struct comedi_krange const[]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                   krange = lrange->range;
                          ^ ~~~~~~~~~~~~~
   4 errors generated.
--
>> drivers/staging/comedi/drivers/jr3_pci.c:527:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[0].l.range[0].min = -get_s16(&fs->fx) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:528:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[0].l.range[0].max = get_s16(&fs->fx) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:529:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[1].l.range[0].min = -get_s16(&fs->fy) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:530:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[1].l.range[0].max = get_s16(&fs->fy) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:531:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[2].l.range[0].min = -get_s16(&fs->fz) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:532:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[2].l.range[0].max = get_s16(&fs->fz) * 1000;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:533:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[3].l.range[0].min = -get_s16(&fs->mx) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:534:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[3].l.range[0].max = get_s16(&fs->mx) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:535:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[4].l.range[0].min = -get_s16(&fs->my) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:536:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[4].l.range[0].max = get_s16(&fs->my) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:537:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[5].l.range[0].min = -get_s16(&fs->mz) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:539:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[5].l.range[0].max = get_s16(&fs->mz) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:540:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[6].l.range[0].min = -get_s16(&fs->v1) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:541:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[6].l.range[0].max = get_s16(&fs->v1) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:542:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[7].l.range[0].min = -get_s16(&fs->v2) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:543:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[7].l.range[0].max = get_s16(&fs->v2) * 100;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/staging/comedi/drivers/jr3_pci.c:544:24: error: cannot assign to non-static data member 'l' with const-qualified type 'const struct comedi_lrange'
                           r[8].l.range[0].min = 0;
                           ~~~~~~~~~~~~~~~~~~~ ^
   drivers/staging/comedi/drivers/jr3_pci.c:94:29: note: non-static data member 'l' declared const here
           const struct comedi_lrange l;


vim +971 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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35139 bytes --]

  parent reply	other threads:[~2020-12-29  4:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  2:24 [PATCH] staging: comedi: remove warnings of comedi_lrange chensong
2020-12-23  8:06 ` Greg KH
2020-12-29  3:50 ` kernel test robot
2020-12-29  3:56 ` kernel test robot
2020-12-29  4:00 ` kernel test robot [this message]
2020-12-24  0:58 Song Chen
2020-12-28 14:04 ` Greg KH

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=202012291137.QKhNid2b-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=abbotti@mev.co.uk \
    --cc=chensong@tj.kylinos.cn \
    --cc=chensong_2000@189.cn \
    --cc=clang-built-linux@googlegroups.com \
    --cc=greg@kroah.com \
    --cc=hsweeten@visionengravers.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).