Hi, I love your patch! Perhaps something to improve: [auto build test WARNING on input/next] [also build test WARNING on linus/master v5.6-rc3 next-20200226] [cannot apply to sparc-next/master] [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/ycho1399-gmail-com/Input-misc-add-support-for-Advantech-software-defined-button/20200227-112039 base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next config: i386-allyesconfig (attached as .config) compiler: gcc-7 (Debian 7.5.0-5) 7.5.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:15:0, from drivers/input/misc/adv_swbutton.c:22: drivers/input/misc/adv_swbutton.c: In function 'acpi_button_notify': include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:137:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ >> drivers/input/misc/adv_swbutton.c:281:5: note: in expansion of macro 'pr_debug' pr_debug(PREFIX "pressed_interval: %lu ms\n", ^~~~~~~~ drivers/input/misc/adv_swbutton.c:281:42: note: format string is defined here pr_debug(PREFIX "pressed_interval: %lu ms\n", ~~^ %u vim +/pr_debug +281 drivers/input/misc/adv_swbutton.c 213 214 /*------------------------------------------------------------------------- 215 * Driver Interface 216 *-------------------------------------------------------------------------- 217 */ 218 static void acpi_button_notify(struct acpi_device *device, u32 event) 219 { 220 struct acpi_button *button = acpi_driver_data(device); 221 struct input_dev *input; 222 223 int i, keycode, BTN_KEYCODE, lkey_number = swbtn_cfg.lkey_number; 224 ktime_t calltime, delta, lasttime, l_time; 225 unsigned long long duration; 226 227 pr_debug(PREFIX "%s, event:0x%x\n", __func__, event); 228 229 switch (event) { 230 case ACPI_BUTTON_NOTIFY_SWBTN_RELEASE: 231 del_timer(&button->swbtn_trigger_timer); 232 233 if (button->last_state != KEY_DOWN) 234 return; 235 236 input = button->input; 237 238 calltime = ktime_get(); 239 lasttime = button->last_time; 240 button->last_time = calltime; 241 242 if (ktime_to_ns(lasttime) == 0) 243 lasttime = calltime; 244 245 delta = ktime_sub(calltime, lasttime); //ns 246 duration = (unsigned long long) 247 (ktime_to_ns(delta) >> 10) >> 10; //ms 248 pr_debug(PREFIX "duration time %llu ms\n", duration); 249 250 BTN_KEYCODE = BTN_TRIGGER_HAPPY; 251 if (button->doubleclick && duration < SWBTN_TRIGGER_DELAY) { 252 pr_debug(PREFIX "double click %llu s\n", 253 duration >> 10); 254 255 BTN_KEYCODE = BTN_TRIGGER_HAPPY2; 256 } else if (duration >= 0 && duration < SWBTN_TRIGGER_DELAY) { 257 pr_debug(PREFIX "click %llu s\n", duration >> 10); 258 259 button->last_state = BTN_TRIGGER_HAPPY; 260 swbtn_init_timer(button); 261 } else { 262 for (i = 0; i < lkey_number; i++) { 263 unsigned int p_intval = 264 swbtn_cfg.pressed_interval[i]; 265 unsigned int diff = swbtn_cfg.tolerance; 266 int j = i + 1; 267 268 if (p_intval < diff || 269 p_intval < SWBTN_TRIGGER_DELAY) 270 break; 271 if ((j) < lkey_number) { 272 unsigned int n_intval = 273 swbtn_cfg.pressed_interval[j]; 274 275 if ((p_intval + diff) > 276 (n_intval - diff)) 277 diff = (n_intval 278 - p_intval) / 2; 279 } 280 > 281 pr_debug(PREFIX "pressed_interval: %lu ms\n", 282 p_intval); 283 284 if ((swbtn_cfg.open_interval && 285 j == lkey_number && 286 duration > (p_intval - diff)) || 287 (duration > (p_intval - diff) && 288 duration < (p_intval + diff))) { 289 pr_debug(PREFIX "long pressed %llu s\n", 290 duration >> 10); 291 292 BTN_KEYCODE = swbtn_keycodes[i + 2]; 293 break; 294 } 295 } 296 } 297 298 if (!button->doubleclick && 299 (duration >= 0 && 300 duration < SWBTN_TRIGGER_DELAY)) 301 return; 302 303 keycode = test_bit(BTN_KEYCODE, input->keybit) ? 304 BTN_KEYCODE : KEY_UNKNOWN; 305 pr_debug(PREFIX "released keycode: 0x%x", keycode); 306 307 button->last_state = keycode; 308 button->doubleclick = false; 309 310 input_report_key(input, keycode, 1); 311 input_sync(input); 312 313 input_report_key(input, keycode, 0); 314 input_sync(input); 315 316 break; 317 case ACPI_BUTTON_NOTIFY_SWBTN_PRESSED: 318 l_time = ktime_to_ns(button->last_time); 319 320 input = button->input; 321 322 calltime = ktime_get(); 323 lasttime = l_time == 0 ? calltime : button->last_time; 324 325 delta = ktime_sub(calltime, lasttime); //ns 326 duration = (unsigned long long) 327 (ktime_to_ns(delta) >> 10) >> 10; //ms 328 329 button->doubleclick = (button->last_state == 330 BTN_TRIGGER_HAPPY && 331 duration > 0 && 332 duration < SWBTN_DOUBLE_TRIGGER_DELAY); 333 334 button->last_time = calltime; 335 button->last_state = KEY_DOWN; 336 337 pr_debug(PREFIX "pressed software button, duration %llu ms", 338 duration); 339 pr_debug(PREFIX " is double click: %s\n", 340 (button->doubleclick) ? "true" : "false"); 341 342 break; 343 default: 344 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 345 "Unsupported event [0x%x]\n", event)); 346 break; 347 } 348 } 349 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org