Re: [PATCH] Staging: comedi: drivers: jr3_pci: fixed two warnings

From: kbuild test robot
Date: Sun Apr 12 2020 - 13:25:23 EST


Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v5.6 next-20200412]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/carlosteniswarrior-gmail-com/Staging-comedi-drivers-jr3_pci-fixed-two-warnings/20200412-234205
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git f4f7714f055fa662cf2f27dd0809a8781538e780
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=alpha

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

>> drivers/staging/comedi/drivers/jr3_pci.c:94:8: error: unknown type name 'comedi_lrange'
94 | const comedi_lrange l;
| ^~~~~~~~~~~~~
In file included from <command-line>:
drivers/staging/comedi/drivers/jr3_pci.c:95:32: error: unknown type name 'comedi_lrange'
95 | char _reserved[offsetof(const comedi_lrange, range[1])];
| ^~~~~~~~~~~~~
include/linux/compiler_types.h:129:54: note: in definition of macro '__compiler_offsetof'
129 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
| ^
>> drivers/staging/comedi/drivers/jr3_pci.c:95:17: note: in expansion of macro 'offsetof'
95 | char _reserved[offsetof(const comedi_lrange, range[1])];
| ^~~~~~~~
drivers/staging/comedi/drivers/jr3_pci.c: In function 'jr3_pci_poll_subdevice':
>> drivers/staging/comedi/drivers/jr3_pci.c:527:10: error: request for member 'range' in something not a structure or union
527 | r[0].l.range[0].min = -get_s16(&fs->fx) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:528:10: error: request for member 'range' in something not a structure or union
528 | r[0].l.range[0].max = get_s16(&fs->fx) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:529:10: error: request for member 'range' in something not a structure or union
529 | r[1].l.range[0].min = -get_s16(&fs->fy) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:530:10: error: request for member 'range' in something not a structure or union
530 | r[1].l.range[0].max = get_s16(&fs->fy) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:531:10: error: request for member 'range' in something not a structure or union
531 | r[2].l.range[0].min = -get_s16(&fs->fz) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:532:10: error: request for member 'range' in something not a structure or union
532 | r[2].l.range[0].max = get_s16(&fs->fz) * 1000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:533:10: error: request for member 'range' in something not a structure or union
533 | r[3].l.range[0].min = -get_s16(&fs->mx) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:534:10: error: request for member 'range' in something not a structure or union
534 | r[3].l.range[0].max = get_s16(&fs->mx) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:535:10: error: request for member 'range' in something not a structure or union
535 | r[4].l.range[0].min = -get_s16(&fs->my) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:536:10: error: request for member 'range' in something not a structure or union
536 | r[4].l.range[0].max = get_s16(&fs->my) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:537:10: error: request for member 'range' in something not a structure or union
537 | r[5].l.range[0].min = -get_s16(&fs->mz) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:539:10: error: request for member 'range' in something not a structure or union
539 | r[5].l.range[0].max = get_s16(&fs->mz) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:540:10: error: request for member 'range' in something not a structure or union
540 | r[6].l.range[0].min = -get_s16(&fs->v1) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:541:10: error: request for member 'range' in something not a structure or union
541 | r[6].l.range[0].max = get_s16(&fs->v1) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:542:10: error: request for member 'range' in something not a structure or union
542 | r[7].l.range[0].min = -get_s16(&fs->v2) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:543:10: error: request for member 'range' in something not a structure or union
543 | r[7].l.range[0].max = get_s16(&fs->v2) * 100;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:544:10: error: request for member 'range' in something not a structure or union
544 | r[8].l.range[0].min = 0;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:545:10: error: request for member 'range' in something not a structure or union
545 | r[8].l.range[0].max = 65535;
| ^
drivers/staging/comedi/drivers/jr3_pci.c: In function 'jr3_pci_alloc_spriv':
>> drivers/staging/comedi/drivers/jr3_pci.c:636:20: error: request for member 'length' in something not a structure or union
636 | spriv->range[j].l.length = 1;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:637:20: error: request for member 'range' in something not a structure or union
637 | spriv->range[j].l.range[0].min = -1000000;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:638:20: error: request for member 'range' in something not a structure or union
638 | spriv->range[j].l.range[0].max = 1000000;
| ^
>> drivers/staging/comedi/drivers/jr3_pci.c:641:39: error: assignment to 'const struct comedi_lrange *' from incompatible pointer type 'const int *' [-Werror=incompatible-pointer-types]
641 | spriv->range_table_list[j + k * 8] = &spriv->range[j].l;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:645:19: error: request for member 'length' in something not a structure or union
645 | spriv->range[8].l.length = 1;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:646:19: error: request for member 'range' in something not a structure or union
646 | spriv->range[8].l.range[0].min = 0;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:647:19: error: request for member 'range' in something not a structure or union
647 | spriv->range[8].l.range[0].max = 65535;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:649:30: error: assignment to 'const struct comedi_lrange *' from incompatible pointer type 'const int *' [-Werror=incompatible-pointer-types]
649 | spriv->range_table_list[56] = &spriv->range[8].l;
| ^
drivers/staging/comedi/drivers/jr3_pci.c:650:30: error: assignment to 'const struct comedi_lrange *' from incompatible pointer type 'const int *' [-Werror=incompatible-pointer-types]
650 | spriv->range_table_list[57] = &spriv->range[8].l;
| ^
cc1: some warnings being treated as errors

vim +/comedi_lrange +94 drivers/staging/comedi/drivers/jr3_pci.c

92
93 union jr3_pci_single_range {
> 94 const comedi_lrange l;
> 95 char _reserved[offsetof(const comedi_lrange, range[1])];
96 };
97

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

Attachment: .config.gz
Description: application/gzip