Hi Luc, I love your patch! Perhaps something to improve: [auto build test WARNING on hnaz-linux-mm/master] [also build test WARNING on next-20200806] [cannot apply to linux/master linus/master v5.8] [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/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200807-034410 base: https://github.com/hnaz/linux-mm master config: x86_64-randconfig-s021-20200805 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-117-g8c7aee71-dirty # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got char const * @@ >> drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse: expected void const volatile [noderef] __user *ptr drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse: got char const * drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct watchdog_info * @@ drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse: expected void [noderef] __user *to drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse: got struct watchdog_info * >> drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int * @@ drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse: expected void const volatile [noderef] __user *ptr drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse: got int * drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int * @@ drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse: expected void const volatile [noderef] __user *ptr drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse: got int * drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int * @@ drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse: expected void const volatile [noderef] __user *ptr drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse: got int * drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int * @@ drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse: expected void const volatile [noderef] __user *ptr drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse: got int * drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected long ( *write )( ... ) @@ got long ( * )( ... ) @@ drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse: expected long ( *write )( ... ) drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse: got long ( * )( ... ) vim +99 drivers/watchdog/sbc_fitpc2_wdt.c 3a5f90002e9d08 Denis Turischev 2009-07-21 80 3a5f90002e9d08 Denis Turischev 2009-07-21 81 static ssize_t fitpc2_wdt_write(struct file *file, const char *data, 3a5f90002e9d08 Denis Turischev 2009-07-21 82 size_t len, loff_t *ppos) 3a5f90002e9d08 Denis Turischev 2009-07-21 83 { 3a5f90002e9d08 Denis Turischev 2009-07-21 84 size_t i; 3a5f90002e9d08 Denis Turischev 2009-07-21 85 3a5f90002e9d08 Denis Turischev 2009-07-21 86 if (!len) 3a5f90002e9d08 Denis Turischev 2009-07-21 87 return 0; 3a5f90002e9d08 Denis Turischev 2009-07-21 88 3a5f90002e9d08 Denis Turischev 2009-07-21 89 if (nowayout) { 3a5f90002e9d08 Denis Turischev 2009-07-21 90 len = 0; 3a5f90002e9d08 Denis Turischev 2009-07-21 91 goto out; 3a5f90002e9d08 Denis Turischev 2009-07-21 92 } 3a5f90002e9d08 Denis Turischev 2009-07-21 93 3a5f90002e9d08 Denis Turischev 2009-07-21 94 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 3a5f90002e9d08 Denis Turischev 2009-07-21 95 3a5f90002e9d08 Denis Turischev 2009-07-21 96 for (i = 0; i != len; i++) { 3a5f90002e9d08 Denis Turischev 2009-07-21 97 char c; 3a5f90002e9d08 Denis Turischev 2009-07-21 98 3a5f90002e9d08 Denis Turischev 2009-07-21 @99 if (get_user(c, data + i)) 3a5f90002e9d08 Denis Turischev 2009-07-21 100 return -EFAULT; 3a5f90002e9d08 Denis Turischev 2009-07-21 101 3a5f90002e9d08 Denis Turischev 2009-07-21 102 if (c == 'V') 3a5f90002e9d08 Denis Turischev 2009-07-21 103 set_bit(WDT_OK_TO_CLOSE, &wdt_status); 3a5f90002e9d08 Denis Turischev 2009-07-21 104 } 3a5f90002e9d08 Denis Turischev 2009-07-21 105 3a5f90002e9d08 Denis Turischev 2009-07-21 106 out: 3a5f90002e9d08 Denis Turischev 2009-07-21 107 wdt_enable(); 3a5f90002e9d08 Denis Turischev 2009-07-21 108 3a5f90002e9d08 Denis Turischev 2009-07-21 109 return len; 3a5f90002e9d08 Denis Turischev 2009-07-21 110 } 3a5f90002e9d08 Denis Turischev 2009-07-21 111 3a5f90002e9d08 Denis Turischev 2009-07-21 112 42747d712de56c Wim Van Sebroeck 2009-12-26 113 static const struct watchdog_info ident = { 3a5f90002e9d08 Denis Turischev 2009-07-21 114 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 3a5f90002e9d08 Denis Turischev 2009-07-21 115 WDIOF_KEEPALIVEPING, 3a5f90002e9d08 Denis Turischev 2009-07-21 116 .identity = WATCHDOG_NAME, 3a5f90002e9d08 Denis Turischev 2009-07-21 117 }; 3a5f90002e9d08 Denis Turischev 2009-07-21 118 3a5f90002e9d08 Denis Turischev 2009-07-21 119 3a5f90002e9d08 Denis Turischev 2009-07-21 120 static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd, 3a5f90002e9d08 Denis Turischev 2009-07-21 121 unsigned long arg) 3a5f90002e9d08 Denis Turischev 2009-07-21 122 { 3a5f90002e9d08 Denis Turischev 2009-07-21 123 int ret = -ENOTTY; 3a5f90002e9d08 Denis Turischev 2009-07-21 124 int time; 3a5f90002e9d08 Denis Turischev 2009-07-21 125 3a5f90002e9d08 Denis Turischev 2009-07-21 126 switch (cmd) { 3a5f90002e9d08 Denis Turischev 2009-07-21 127 case WDIOC_GETSUPPORT: 3a5f90002e9d08 Denis Turischev 2009-07-21 128 ret = copy_to_user((struct watchdog_info *)arg, &ident, 3a5f90002e9d08 Denis Turischev 2009-07-21 129 sizeof(ident)) ? -EFAULT : 0; 3a5f90002e9d08 Denis Turischev 2009-07-21 130 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 131 3a5f90002e9d08 Denis Turischev 2009-07-21 132 case WDIOC_GETSTATUS: 3a5f90002e9d08 Denis Turischev 2009-07-21 @133 ret = put_user(0, (int *)arg); 3a5f90002e9d08 Denis Turischev 2009-07-21 134 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 135 3a5f90002e9d08 Denis Turischev 2009-07-21 136 case WDIOC_GETBOOTSTATUS: 3a5f90002e9d08 Denis Turischev 2009-07-21 137 ret = put_user(0, (int *)arg); 3a5f90002e9d08 Denis Turischev 2009-07-21 138 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 139 3a5f90002e9d08 Denis Turischev 2009-07-21 140 case WDIOC_KEEPALIVE: 3a5f90002e9d08 Denis Turischev 2009-07-21 141 wdt_enable(); 3a5f90002e9d08 Denis Turischev 2009-07-21 142 ret = 0; 3a5f90002e9d08 Denis Turischev 2009-07-21 143 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 144 3a5f90002e9d08 Denis Turischev 2009-07-21 145 case WDIOC_SETTIMEOUT: 3a5f90002e9d08 Denis Turischev 2009-07-21 146 ret = get_user(time, (int *)arg); 3a5f90002e9d08 Denis Turischev 2009-07-21 147 if (ret) 3a5f90002e9d08 Denis Turischev 2009-07-21 148 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 149 3a5f90002e9d08 Denis Turischev 2009-07-21 150 if (time < 31 || time > 255) { 3a5f90002e9d08 Denis Turischev 2009-07-21 151 ret = -EINVAL; 3a5f90002e9d08 Denis Turischev 2009-07-21 152 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 153 } 3a5f90002e9d08 Denis Turischev 2009-07-21 154 3a5f90002e9d08 Denis Turischev 2009-07-21 155 margin = time; 3a5f90002e9d08 Denis Turischev 2009-07-21 156 wdt_enable(); 3a5f90002e9d08 Denis Turischev 2009-07-21 157 /* Fall through */ 3a5f90002e9d08 Denis Turischev 2009-07-21 158 3a5f90002e9d08 Denis Turischev 2009-07-21 159 case WDIOC_GETTIMEOUT: 3a5f90002e9d08 Denis Turischev 2009-07-21 160 ret = put_user(margin, (int *)arg); 3a5f90002e9d08 Denis Turischev 2009-07-21 161 break; 3a5f90002e9d08 Denis Turischev 2009-07-21 162 } 3a5f90002e9d08 Denis Turischev 2009-07-21 163 3a5f90002e9d08 Denis Turischev 2009-07-21 164 return ret; 3a5f90002e9d08 Denis Turischev 2009-07-21 165 } 3a5f90002e9d08 Denis Turischev 2009-07-21 166 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org