Hi Denis, Thank you for the patch! Yet something to improve: [auto build test ERROR on hwmon/hwmon-next] [also build test ERROR on v5.14 next-20210910] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Denis-Pauk/hwmon-nct6775-Support-access-via-Asus-WMI/20210912-190749 base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next config: arm-randconfig-s032-20210912 (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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-dirty # https://github.com/0day-ci/linux/commit/f11f2179ea7eb747b68a65ac03fce15ff4319004 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Denis-Pauk/hwmon-nct6775-Support-access-via-Asus-WMI/20210912-190749 git checkout f11f2179ea7eb747b68a65ac03fce15ff4319004 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/hwmon/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): drivers/hwmon/nct6775.c: In function 'clear_caseopen': >> drivers/hwmon/nct6775.c:3452:70: error: macro "inb" passed 2 arguments, but takes just 1 3452 | reg = sio_data->inb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr]); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | >> drivers/hwmon/nct6775.c:3452:13: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3452 | reg = sio_data->inb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr]); | ^ >> drivers/hwmon/nct6775.c:3454:70: error: macro "outb" passed 3 arguments, but takes just 2 3454 | sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:3454:17: warning: statement with no effect [-Wunused-value] 3454 | sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c:3456:70: error: macro "outb" passed 3 arguments, but takes just 2 3456 | sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:3456:17: warning: statement with no effect [-Wunused-value] 3456 | sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c: In function 'nct6775_check_fan_inputs': drivers/hwmon/nct6775.c:3572:70: error: macro "inb" passed 2 arguments, but takes just 1 3572 | data->sio_reg_enable = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3572:30: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3572 | data->sio_reg_enable = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ drivers/hwmon/nct6775.c:3576:56: error: macro "inb" passed 2 arguments, but takes just 1 3576 | int cr2c = sio_data->inb(sio_data, 0x2c); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | >> drivers/hwmon/nct6775.c:3576:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3576 | int cr2c = sio_data->inb(sio_data, 0x2c); | ^~~~~~~~ drivers/hwmon/nct6775.c:3582:57: error: macro "inb" passed 2 arguments, but takes just 1 3582 | fan4pin = !(sio_data->inb(sio_data, 0x2A) & 0x80); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | >> drivers/hwmon/nct6775.c:3582:59: error: invalid operands to binary & (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 3582 | fan4pin = !(sio_data->inb(sio_data, 0x2A) & 0x80); | ~~~~~~~~~~~~~ ^ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:3584:57: error: macro "inb" passed 2 arguments, but takes just 1 3584 | bool gpok = sio_data->inb(sio_data, 0x27) & 0x80; | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3584:59: error: invalid operands to binary & (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 3584 | bool gpok = sio_data->inb(sio_data, 0x27) & 0x80; | ~~~~~~~~~~~~~ ^ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:3601:74: error: macro "outb" passed 3 arguments, but takes just 2 3601 | data->sio_reg_enable); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:3600:49: warning: statement with no effect [-Wunused-value] 3600 | sio_data->outb(sio_data, SIO_REG_ENABLE, | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c:3609:65: error: macro "inb" passed 2 arguments, but takes just 1 3609 | fan3pin = !(sio_data->inb(sio_data, 0x24) & 0x40); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3609:67: error: invalid operands to binary & (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 3609 | fan3pin = !(sio_data->inb(sio_data, 0x24) & 0x40); | ~~~~~~~~~~~~~ ^ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:3614:63: error: macro "inb" passed 2 arguments, but takes just 1 3614 | fan4pin = sio_data->inb(sio_data, 0x1C) & 0x01; | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3614:65: error: invalid operands to binary & (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 3614 | fan4pin = sio_data->inb(sio_data, 0x1C) & 0x01; | ~~~~~~~~~~~~~ ^ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:3619:63: error: macro "inb" passed 2 arguments, but takes just 1 3619 | fan5pin = sio_data->inb(sio_data, 0x1C) & 0x02; | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3619:65: error: invalid operands to binary & (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 3619 | fan5pin = sio_data->inb(sio_data, 0x1C) & 0x02; | ~~~~~~~~~~~~~ ^ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:3624:56: error: macro "inb" passed 2 arguments, but takes just 1 3624 | int cr24 = sio_data->inb(sio_data, 0x24); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3624:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3624 | int cr24 = sio_data->inb(sio_data, 0x24); | ^~~~~~~~ drivers/hwmon/nct6775.c:3629:56: error: macro "inb" passed 2 arguments, but takes just 1 3629 | int cr1a = sio_data->inb(sio_data, 0x1a); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3629:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3629 | int cr1a = sio_data->inb(sio_data, 0x1a); | ^~~~~~~~ drivers/hwmon/nct6775.c:3630:56: error: macro "inb" passed 2 arguments, but takes just 1 3630 | int cr1b = sio_data->inb(sio_data, 0x1b); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3630:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3630 | int cr1b = sio_data->inb(sio_data, 0x1b); | ^~~~~~~~ -- | drivers/hwmon/nct6775.c:3634:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3634 | int cr2f = sio_data->inb(sio_data, 0x2f); | ^~~~~~~~ drivers/hwmon/nct6775.c:3650:56: error: macro "inb" passed 2 arguments, but takes just 1 3650 | int cr1a = sio_data->inb(sio_data, 0x1a); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3650:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3650 | int cr1a = sio_data->inb(sio_data, 0x1a); | ^~~~~~~~ drivers/hwmon/nct6775.c:3651:56: error: macro "inb" passed 2 arguments, but takes just 1 3651 | int cr1b = sio_data->inb(sio_data, 0x1b); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3651:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3651 | int cr1b = sio_data->inb(sio_data, 0x1b); | ^~~~~~~~ drivers/hwmon/nct6775.c:3652:56: error: macro "inb" passed 2 arguments, but takes just 1 3652 | int cr1c = sio_data->inb(sio_data, 0x1c); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3652:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3652 | int cr1c = sio_data->inb(sio_data, 0x1c); | ^~~~~~~~ drivers/hwmon/nct6775.c:3653:56: error: macro "inb" passed 2 arguments, but takes just 1 3653 | int cr1d = sio_data->inb(sio_data, 0x1d); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3653:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3653 | int cr1d = sio_data->inb(sio_data, 0x1d); | ^~~~~~~~ drivers/hwmon/nct6775.c:3654:56: error: macro "inb" passed 2 arguments, but takes just 1 3654 | int cr2a = sio_data->inb(sio_data, 0x2a); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3654:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3654 | int cr2a = sio_data->inb(sio_data, 0x2a); | ^~~~~~~~ drivers/hwmon/nct6775.c:3655:56: error: macro "inb" passed 2 arguments, but takes just 1 3655 | int cr2b = sio_data->inb(sio_data, 0x2b); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3655:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3655 | int cr2b = sio_data->inb(sio_data, 0x2b); | ^~~~~~~~ drivers/hwmon/nct6775.c:3656:56: error: macro "inb" passed 2 arguments, but takes just 1 3656 | int cr2d = sio_data->inb(sio_data, 0x2d); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3656:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3656 | int cr2d = sio_data->inb(sio_data, 0x2d); | ^~~~~~~~ drivers/hwmon/nct6775.c:3657:56: error: macro "inb" passed 2 arguments, but takes just 1 3657 | int cr2f = sio_data->inb(sio_data, 0x2f); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3657:28: warning: initialization of 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3657 | int cr2f = sio_data->inb(sio_data, 0x2f); | ^~~~~~~~ drivers/hwmon/nct6775.c:3665:52: error: macro "inb" passed 2 arguments, but takes just 1 3665 | cre0 = sio_data->inb(sio_data, 0xe0); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | >> drivers/hwmon/nct6775.c:3665:22: warning: assignment to 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3665 | cre0 = sio_data->inb(sio_data, 0xe0); | ^ drivers/hwmon/nct6775.c:3666:52: error: macro "inb" passed 2 arguments, but takes just 1 3666 | creb = sio_data->inb(sio_data, 0xeb); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3666:22: warning: assignment to 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3666 | creb = sio_data->inb(sio_data, 0xeb); | ^ drivers/hwmon/nct6775.c:3667:52: error: macro "inb" passed 2 arguments, but takes just 1 3667 | cred = sio_data->inb(sio_data, 0xed); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:3667:22: warning: assignment to 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 3667 | cred = sio_data->inb(sio_data, 0xed); | ^ drivers/hwmon/nct6775.c: In function 'nct6775_probe': drivers/hwmon/nct6775.c:4531:44: error: macro "inb" passed 2 arguments, but takes just 1 4531 | cr2a = sio_data->inb(sio_data, 0x2a); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4531:14: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4531 | cr2a = sio_data->inb(sio_data, 0x2a); | ^ drivers/hwmon/nct6775.c:4558:57: error: macro "inb" passed 2 arguments, but takes just 1 4558 | data->vid = sio_data->inb(sio_data, 0xe3); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4558:27: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4558 | data->vid = sio_data->inb(sio_data, 0xe3); | ^ drivers/hwmon/nct6775.c:4567:64: error: macro "inb" passed 2 arguments, but takes just 1 4567 | NCT6775_REG_CR_FAN_DEBOUNCE); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4566:21: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4566 | tmp = sio_data->inb(sio_data, | ^ drivers/hwmon/nct6775.c:4591:33: error: macro "outb" passed 3 arguments, but takes just 2 4591 | tmp); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:4590:25: warning: statement with no effect [-Wunused-value] 4590 | sio_data->outb(sio_data, NCT6775_REG_CR_FAN_DEBOUNCE, | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c: In function 'nct6791_enable_io_mapping': drivers/hwmon/nct6775.c:4642:74: error: macro "inb" passed 2 arguments, but takes just 1 4642 | val = sio_data->inb(sio_data, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4642:13: warning: assignment to 'int' from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4642 | val = sio_data->inb(sio_data, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE); | ^ drivers/hwmon/nct6775.c:4646:43: error: macro "outb" passed 3 arguments, but takes just 2 4646 | val & ~0x10); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:4645:25: warning: statement with no effect [-Wunused-value] 4645 | sio_data->outb(sio_data, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE, | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c: In function 'nct6775_resume': drivers/hwmon/nct6775.c:4680:53: error: macro "inb" passed 2 arguments, but takes just 1 4680 | reg = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4680:13: warning: assignment to 'u8' {aka 'unsigned char'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4680 | reg = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ drivers/hwmon/nct6775.c:4682:78: error: macro "outb" passed 3 arguments, but takes just 2 4682 | sio_data->outb(sio_data, SIO_REG_ENABLE, data->sio_reg_enable); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:4682:25: warning: statement with no effect [-Wunused-value] 4682 | sio_data->outb(sio_data, SIO_REG_ENABLE, data->sio_reg_enable); | ~~~~~~~~^~~~~~ drivers/hwmon/nct6775.c: In function 'nct6775_find': drivers/hwmon/nct6775.c:4759:53: error: macro "inb" passed 2 arguments, but takes just 1 4759 | val = (sio_data->inb(sio_data, SIO_REG_DEVID) << 8) | | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4759:55: error: invalid operands to binary << (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 4759 | val = (sio_data->inb(sio_data, SIO_REG_DEVID) << 8) | | ~~~~~~~~~~~~~ ^~ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:4760:58: error: macro "inb" passed 2 arguments, but takes just 1 4760 | sio_data->inb(sio_data, SIO_REG_DEVID + 1); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4810:52: error: macro "inb" passed 2 arguments, but takes just 1 4810 | val = (sio_data->inb(sio_data, SIO_REG_ADDR) << 8) | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4810:54: error: invalid operands to binary << (have 'int (*)(struct nct6775_sio_data *, int)' and 'int') 4810 | val = (sio_data->inb(sio_data, SIO_REG_ADDR) << 8) | ~~~~~~~~~~~~~ ^~ | | | int (*)(struct nct6775_sio_data *, int) drivers/hwmon/nct6775.c:4811:55: error: macro "inb" passed 2 arguments, but takes just 1 4811 | | sio_data->inb(sio_data, SIO_REG_ADDR + 1); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | drivers/hwmon/nct6775.c:4820:53: error: macro "inb" passed 2 arguments, but takes just 1 4820 | val = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:258: note: macro "inb" defined here 258 | #define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; }) | >> drivers/hwmon/nct6775.c:4820:13: warning: assignment to 'u16' {aka 'short unsigned int'} from 'int (*)(struct nct6775_sio_data *, int)' makes integer from pointer without a cast [-Wint-conversion] 4820 | val = sio_data->inb(sio_data, SIO_REG_ENABLE); | ^ drivers/hwmon/nct6775.c:4823:68: error: macro "outb" passed 3 arguments, but takes just 2 4823 | sio_data->outb(sio_data, SIO_REG_ENABLE, val | 0x01); | ^ In file included from include/linux/io.h:13, from drivers/hwmon/nct6775.c:56: arch/arm/include/asm/io.h:252: note: macro "outb" defined here 252 | #define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); }) | drivers/hwmon/nct6775.c:4823:25: warning: statement with no effect [-Wunused-value] 4823 | sio_data->outb(sio_data, SIO_REG_ENABLE, val | 0x01); | ~~~~~~~~^~~~~~ At top level: drivers/hwmon/nct6775.c:284:17: warning: 'NCT6775_REG_CR_CASEOPEN_CLR' defined but not used [-Wunused-const-variable=] 284 | static const u8 NCT6775_REG_CR_CASEOPEN_CLR[] = { 0xe6, 0xee }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/inb +3452 drivers/hwmon/nct6775.c 3423 3424 static ssize_t 3425 clear_caseopen(struct device *dev, struct device_attribute *attr, 3426 const char *buf, size_t count) 3427 { 3428 struct nct6775_data *data = dev_get_drvdata(dev); 3429 struct nct6775_sio_data *sio_data = dev_get_platdata(dev); 3430 int nr = to_sensor_dev_attr(attr)->index - INTRUSION_ALARM_BASE; 3431 unsigned long val; 3432 u8 reg; 3433 int ret; 3434 3435 if (kstrtoul(buf, 10, &val) || val != 0) 3436 return -EINVAL; 3437 3438 mutex_lock(&data->update_lock); 3439 3440 /* 3441 * Use CR registers to clear caseopen status. 3442 * The CR registers are the same for all chips, and not all chips 3443 * support clearing the caseopen status through "regular" registers. 3444 */ 3445 ret = sio_data->enter(sio_data); 3446 if (ret) { 3447 count = ret; 3448 goto error; 3449 } 3450 3451 sio_data->select(sio_data, NCT6775_LD_ACPI); > 3452 reg = sio_data->inb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr]); 3453 reg |= NCT6775_CR_CASEOPEN_CLR_MASK[nr]; > 3454 sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); 3455 reg &= ~NCT6775_CR_CASEOPEN_CLR_MASK[nr]; 3456 sio_data->outb(sio_data, NCT6775_REG_CR_CASEOPEN_CLR[nr], reg); 3457 sio_data->exit(sio_data); 3458 3459 data->valid = false; /* Force cache refresh */ 3460 error: 3461 mutex_unlock(&data->update_lock); 3462 return count; 3463 } 3464 3465 static SENSOR_DEVICE_ATTR(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm, 3466 clear_caseopen, INTRUSION_ALARM_BASE); 3467 static SENSOR_DEVICE_ATTR(intrusion1_alarm, S_IWUSR | S_IRUGO, show_alarm, 3468 clear_caseopen, INTRUSION_ALARM_BASE + 1); 3469 static SENSOR_DEVICE_ATTR(intrusion0_beep, S_IWUSR | S_IRUGO, show_beep, 3470 store_beep, INTRUSION_ALARM_BASE); 3471 static SENSOR_DEVICE_ATTR(intrusion1_beep, S_IWUSR | S_IRUGO, show_beep, 3472 store_beep, INTRUSION_ALARM_BASE + 1); 3473 static SENSOR_DEVICE_ATTR(beep_enable, S_IWUSR | S_IRUGO, show_beep, 3474 store_beep, BEEP_ENABLE_BASE); 3475 3476 static umode_t nct6775_other_is_visible(struct kobject *kobj, 3477 struct attribute *attr, int index) 3478 { 3479 struct device *dev = kobj_to_dev(kobj); 3480 struct nct6775_data *data = dev_get_drvdata(dev); 3481 3482 if (index == 0 && !data->have_vid) 3483 return 0; 3484 3485 if (index == 1 || index == 2) { 3486 if (data->ALARM_BITS[INTRUSION_ALARM_BASE + index - 1] < 0) 3487 return 0; 3488 } 3489 3490 if (index == 3 || index == 4) { 3491 if (data->BEEP_BITS[INTRUSION_ALARM_BASE + index - 3] < 0) 3492 return 0; 3493 } 3494 3495 return attr->mode; 3496 } 3497 3498 /* 3499 * nct6775_other_is_visible uses the index into the following array 3500 * to determine if attributes should be created or not. 3501 * Any change in order or content must be matched. 3502 */ 3503 static struct attribute *nct6775_attributes_other[] = { 3504 &dev_attr_cpu0_vid.attr, /* 0 */ 3505 &sensor_dev_attr_intrusion0_alarm.dev_attr.attr, /* 1 */ 3506 &sensor_dev_attr_intrusion1_alarm.dev_attr.attr, /* 2 */ 3507 &sensor_dev_attr_intrusion0_beep.dev_attr.attr, /* 3 */ 3508 &sensor_dev_attr_intrusion1_beep.dev_attr.attr, /* 4 */ 3509 &sensor_dev_attr_beep_enable.dev_attr.attr, /* 5 */ 3510 3511 NULL 3512 }; 3513 3514 static const struct attribute_group nct6775_group_other = { 3515 .attrs = nct6775_attributes_other, 3516 .is_visible = nct6775_other_is_visible, 3517 }; 3518 3519 static inline void nct6775_init_device(struct nct6775_data *data) 3520 { 3521 int i; 3522 u8 tmp, diode; 3523 3524 /* Start monitoring if needed */ 3525 if (data->REG_CONFIG) { 3526 tmp = data->read_value(data, data->REG_CONFIG); 3527 if (!(tmp & 0x01)) 3528 data->write_value(data, data->REG_CONFIG, tmp | 0x01); 3529 } 3530 3531 /* Enable temperature sensors if needed */ 3532 for (i = 0; i < NUM_TEMP; i++) { 3533 if (!(data->have_temp & BIT(i))) 3534 continue; 3535 if (!data->reg_temp_config[i]) 3536 continue; 3537 tmp = data->read_value(data, data->reg_temp_config[i]); 3538 if (tmp & 0x01) 3539 data->write_value(data, data->reg_temp_config[i], 3540 tmp & 0xfe); 3541 } 3542 3543 /* Enable VBAT monitoring if needed */ 3544 tmp = data->read_value(data, data->REG_VBAT); 3545 if (!(tmp & 0x01)) 3546 data->write_value(data, data->REG_VBAT, tmp | 0x01); 3547 3548 diode = data->read_value(data, data->REG_DIODE); 3549 3550 for (i = 0; i < data->temp_fixed_num; i++) { 3551 if (!(data->have_temp_fixed & BIT(i))) 3552 continue; 3553 if ((tmp & (data->DIODE_MASK << i))) /* diode */ 3554 data->temp_type[i] 3555 = 3 - ((diode >> i) & data->DIODE_MASK); 3556 else /* thermistor */ 3557 data->temp_type[i] = 4; 3558 } 3559 } 3560 3561 static void 3562 nct6775_check_fan_inputs(struct nct6775_data *data, 3563 struct nct6775_sio_data *sio_data) 3564 { 3565 bool fan3pin = false, fan4pin = false, fan4min = false; 3566 bool fan5pin = false, fan6pin = false, fan7pin = false; 3567 bool pwm3pin = false, pwm4pin = false, pwm5pin = false; 3568 bool pwm6pin = false, pwm7pin = false; 3569 3570 /* Store SIO_REG_ENABLE for use during resume */ 3571 sio_data->select(sio_data, NCT6775_LD_HWM); 3572 data->sio_reg_enable = sio_data->inb(sio_data, SIO_REG_ENABLE); 3573 3574 /* fan4 and fan5 share some pins with the GPIO and serial flash */ 3575 if (data->kind == nct6775) { > 3576 int cr2c = sio_data->inb(sio_data, 0x2c); 3577 3578 fan3pin = cr2c & BIT(6); 3579 pwm3pin = cr2c & BIT(7); 3580 3581 /* On NCT6775, fan4 shares pins with the fdc interface */ > 3582 fan4pin = !(sio_data->inb(sio_data, 0x2A) & 0x80); 3583 } else if (data->kind == nct6776) { 3584 bool gpok = sio_data->inb(sio_data, 0x27) & 0x80; 3585 const char *board_vendor, *board_name; 3586 3587 board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); 3588 board_name = dmi_get_system_info(DMI_BOARD_NAME); 3589 3590 if (board_name && board_vendor && 3591 !strcmp(board_vendor, "ASRock")) { 3592 /* 3593 * Auxiliary fan monitoring is not enabled on ASRock 3594 * Z77 Pro4-M if booted in UEFI Ultra-FastBoot mode. 3595 * Observed with BIOS version 2.00. 3596 */ 3597 if (!strcmp(board_name, "Z77 Pro4-M")) { 3598 if ((data->sio_reg_enable & 0xe0) != 0xe0) { 3599 data->sio_reg_enable |= 0xe0; 3600 sio_data->outb(sio_data, SIO_REG_ENABLE, 3601 data->sio_reg_enable); 3602 } 3603 } 3604 } 3605 3606 if (data->sio_reg_enable & 0x80) 3607 fan3pin = gpok; 3608 else 3609 fan3pin = !(sio_data->inb(sio_data, 0x24) & 0x40); 3610 3611 if (data->sio_reg_enable & 0x40) 3612 fan4pin = gpok; 3613 else 3614 fan4pin = sio_data->inb(sio_data, 0x1C) & 0x01; 3615 3616 if (data->sio_reg_enable & 0x20) 3617 fan5pin = gpok; 3618 else 3619 fan5pin = sio_data->inb(sio_data, 0x1C) & 0x02; 3620 3621 fan4min = fan4pin; 3622 pwm3pin = fan3pin; 3623 } else if (data->kind == nct6106) { 3624 int cr24 = sio_data->inb(sio_data, 0x24); 3625 3626 fan3pin = !(cr24 & 0x80); 3627 pwm3pin = cr24 & 0x08; 3628 } else if (data->kind == nct6116) { 3629 int cr1a = sio_data->inb(sio_data, 0x1a); 3630 int cr1b = sio_data->inb(sio_data, 0x1b); 3631 int cr24 = sio_data->inb(sio_data, 0x24); 3632 int cr2a = sio_data->inb(sio_data, 0x2a); 3633 int cr2b = sio_data->inb(sio_data, 0x2b); 3634 int cr2f = sio_data->inb(sio_data, 0x2f); 3635 3636 fan3pin = !(cr2b & 0x10); 3637 fan4pin = (cr2b & 0x80) || // pin 1(2) 3638 (!(cr2f & 0x10) && (cr1a & 0x04)); // pin 65(66) 3639 fan5pin = (cr2b & 0x80) || // pin 126(127) 3640 (!(cr1b & 0x03) && (cr2a & 0x02)); // pin 94(96) 3641 3642 pwm3pin = fan3pin && (cr24 & 0x08); 3643 pwm4pin = fan4pin; 3644 pwm5pin = fan5pin; 3645 } else { 3646 /* 3647 * NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D, NCT6796D, 3648 * NCT6797D, NCT6798D 3649 */ 3650 int cr1a = sio_data->inb(sio_data, 0x1a); 3651 int cr1b = sio_data->inb(sio_data, 0x1b); 3652 int cr1c = sio_data->inb(sio_data, 0x1c); 3653 int cr1d = sio_data->inb(sio_data, 0x1d); 3654 int cr2a = sio_data->inb(sio_data, 0x2a); 3655 int cr2b = sio_data->inb(sio_data, 0x2b); 3656 int cr2d = sio_data->inb(sio_data, 0x2d); 3657 int cr2f = sio_data->inb(sio_data, 0x2f); 3658 bool dsw_en = cr2f & BIT(3); 3659 bool ddr4_en = cr2f & BIT(4); 3660 int cre0; 3661 int creb; 3662 int cred; 3663 3664 sio_data->select(sio_data, NCT6775_LD_12); 3665 cre0 = sio_data->inb(sio_data, 0xe0); 3666 creb = sio_data->inb(sio_data, 0xeb); 3667 cred = sio_data->inb(sio_data, 0xed); 3668 3669 fan3pin = !(cr1c & BIT(5)); 3670 fan4pin = !(cr1c & BIT(6)); 3671 fan5pin = !(cr1c & BIT(7)); 3672 3673 pwm3pin = !(cr1c & BIT(0)); 3674 pwm4pin = !(cr1c & BIT(1)); 3675 pwm5pin = !(cr1c & BIT(2)); 3676 3677 switch (data->kind) { 3678 case nct6791: 3679 fan6pin = cr2d & BIT(1); 3680 pwm6pin = cr2d & BIT(0); 3681 break; 3682 case nct6792: 3683 fan6pin = !dsw_en && (cr2d & BIT(1)); 3684 pwm6pin = !dsw_en && (cr2d & BIT(0)); 3685 break; 3686 case nct6793: 3687 fan5pin |= cr1b & BIT(5); 3688 fan5pin |= creb & BIT(5); 3689 3690 fan6pin = !dsw_en && (cr2d & BIT(1)); 3691 fan6pin |= creb & BIT(3); 3692 3693 pwm5pin |= cr2d & BIT(7); 3694 pwm5pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); 3695 3696 pwm6pin = !dsw_en && (cr2d & BIT(0)); 3697 pwm6pin |= creb & BIT(2); 3698 break; 3699 case nct6795: 3700 fan5pin |= cr1b & BIT(5); 3701 fan5pin |= creb & BIT(5); 3702 3703 fan6pin = (cr2a & BIT(4)) && 3704 (!dsw_en || (cred & BIT(4))); 3705 fan6pin |= creb & BIT(3); 3706 3707 pwm5pin |= cr2d & BIT(7); 3708 pwm5pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); 3709 3710 pwm6pin = (cr2a & BIT(3)) && (cred & BIT(2)); 3711 pwm6pin |= creb & BIT(2); 3712 break; 3713 case nct6796: 3714 fan5pin |= cr1b & BIT(5); 3715 fan5pin |= (cre0 & BIT(3)) && !(cr1b & BIT(0)); 3716 fan5pin |= creb & BIT(5); 3717 3718 fan6pin = (cr2a & BIT(4)) && 3719 (!dsw_en || (cred & BIT(4))); 3720 fan6pin |= creb & BIT(3); 3721 3722 fan7pin = !(cr2b & BIT(2)); 3723 3724 pwm5pin |= cr2d & BIT(7); 3725 pwm5pin |= (cre0 & BIT(4)) && !(cr1b & BIT(0)); 3726 pwm5pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); 3727 3728 pwm6pin = (cr2a & BIT(3)) && (cred & BIT(2)); 3729 pwm6pin |= creb & BIT(2); 3730 3731 pwm7pin = !(cr1d & (BIT(2) | BIT(3))); 3732 break; 3733 case nct6797: 3734 fan5pin |= !ddr4_en && (cr1b & BIT(5)); 3735 fan5pin |= creb & BIT(5); 3736 3737 fan6pin = cr2a & BIT(4); 3738 fan6pin |= creb & BIT(3); 3739 3740 fan7pin = cr1a & BIT(1); 3741 3742 pwm5pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); 3743 pwm5pin |= !ddr4_en && (cr2d & BIT(7)); 3744 3745 pwm6pin = creb & BIT(2); 3746 pwm6pin |= cred & BIT(2); 3747 3748 pwm7pin = cr1d & BIT(4); 3749 break; 3750 case nct6798: 3751 fan6pin = !(cr1b & BIT(0)) && (cre0 & BIT(3)); 3752 fan6pin |= cr2a & BIT(4); 3753 fan6pin |= creb & BIT(5); 3754 3755 fan7pin = cr1b & BIT(5); 3756 fan7pin |= !(cr2b & BIT(2)); 3757 fan7pin |= creb & BIT(3); 3758 3759 pwm6pin = !(cr1b & BIT(0)) && (cre0 & BIT(4)); 3760 pwm6pin |= !(cred & BIT(2)) && (cr2a & BIT(3)); 3761 pwm6pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); 3762 3763 pwm7pin = !(cr1d & (BIT(2) | BIT(3))); 3764 pwm7pin |= cr2d & BIT(7); 3765 pwm7pin |= creb & BIT(2); 3766 break; 3767 default: /* NCT6779D */ 3768 break; 3769 } 3770 3771 fan4min = fan4pin; 3772 } 3773 3774 /* fan 1 and 2 (0x03) are always present */ 3775 data->has_fan = 0x03 | (fan3pin << 2) | (fan4pin << 3) | 3776 (fan5pin << 4) | (fan6pin << 5) | (fan7pin << 6); 3777 data->has_fan_min = 0x03 | (fan3pin << 2) | (fan4min << 3) | 3778 (fan5pin << 4) | (fan6pin << 5) | (fan7pin << 6); 3779 data->has_pwm = 0x03 | (pwm3pin << 2) | (pwm4pin << 3) | 3780 (pwm5pin << 4) | (pwm6pin << 5) | (pwm7pin << 6); 3781 } 3782 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org