All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [boqun:irqflags 11/20] drivers/input/joystick/analog.c:192 analog_cooked_read() warn: mixing irqsave and irq
Date: Mon, 31 Aug 2026 20:16:51 +0800	[thread overview]
Message-ID: <202608312037.GqxvSjEL-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Thomas Gleixner <tglx@kernel.org>
CC: Boqun Feng <boqun@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git irqflags
head:   d5c6783a39c9f3ae4513eb61038d5306e4ba5f5b
commit: fb509c0abd8483ea55b22d00a0e0f4b3d0a91ecb [11/20] irqflags: Cleanup wrappers
:::::: branch date: 21 hours ago
:::::: commit date: 22 hours ago
config: i386-randconfig-141-20260831 (https://download.01.org/0day-ci/archive/20260831/202608312037.GqxvSjEL-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
smatch: v0.5.0-9187-g5189e3fb

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202608312037.GqxvSjEL-lkp@intel.com/

New smatch warnings:
drivers/input/joystick/analog.c:192 analog_cooked_read() warn: mixing irqsave and irq
drivers/usb/early/xhci-dbc.c:875 xdbc_bulk_write() warn: inconsistent returns 'flags'.

Old smatch warnings:
drivers/usb/early/xhci-dbc.c:979 xdbc_init() warn: missing error code 'ret'

vim +192 drivers/input/joystick/analog.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  162  
^1da177e4c3f41 Linus Torvalds 2005-04-16  163  /*
^1da177e4c3f41 Linus Torvalds 2005-04-16  164   * analog_cooked_read() reads analog joystick data.
^1da177e4c3f41 Linus Torvalds 2005-04-16  165   */
^1da177e4c3f41 Linus Torvalds 2005-04-16  166  
^1da177e4c3f41 Linus Torvalds 2005-04-16  167  static int analog_cooked_read(struct analog_port *port)
^1da177e4c3f41 Linus Torvalds 2005-04-16  168  {
^1da177e4c3f41 Linus Torvalds 2005-04-16  169  	struct gameport *gameport = port->gameport;
0c5483a5778fa9 Guenter Roeck  2021-09-07  170  	ktime_t time[4], start, loop, now;
76460a7becadbd Takashi Iwai   2014-09-11  171  	unsigned int loopout, timeout;
^1da177e4c3f41 Linus Torvalds 2005-04-16  172  	unsigned char data[4], this, last;
^1da177e4c3f41 Linus Torvalds 2005-04-16  173  	unsigned long flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16  174  	int i, j;
^1da177e4c3f41 Linus Torvalds 2005-04-16  175  
^1da177e4c3f41 Linus Torvalds 2005-04-16  176  	loopout = (ANALOG_LOOP_TIME * port->loop) / 1000;
0c5483a5778fa9 Guenter Roeck  2021-09-07  177  	timeout = ANALOG_MAX_TIME * NSEC_PER_MSEC;
^1da177e4c3f41 Linus Torvalds 2005-04-16  178  
^1da177e4c3f41 Linus Torvalds 2005-04-16  179  	local_irq_save(flags);
^1da177e4c3f41 Linus Torvalds 2005-04-16  180  	gameport_trigger(gameport);
0c5483a5778fa9 Guenter Roeck  2021-09-07  181  	now = ktime_get();
^1da177e4c3f41 Linus Torvalds 2005-04-16  182  	local_irq_restore(flags);
^1da177e4c3f41 Linus Torvalds 2005-04-16  183  
^1da177e4c3f41 Linus Torvalds 2005-04-16  184  	start = now;
^1da177e4c3f41 Linus Torvalds 2005-04-16  185  	this = port->mask;
^1da177e4c3f41 Linus Torvalds 2005-04-16  186  	i = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  187  
^1da177e4c3f41 Linus Torvalds 2005-04-16  188  	do {
^1da177e4c3f41 Linus Torvalds 2005-04-16  189  		loop = now;
^1da177e4c3f41 Linus Torvalds 2005-04-16  190  		last = this;
^1da177e4c3f41 Linus Torvalds 2005-04-16  191  
^1da177e4c3f41 Linus Torvalds 2005-04-16 @192  		local_irq_disable();
^1da177e4c3f41 Linus Torvalds 2005-04-16  193  		this = gameport_read(gameport) & port->mask;
0c5483a5778fa9 Guenter Roeck  2021-09-07  194  		now = ktime_get();
^1da177e4c3f41 Linus Torvalds 2005-04-16  195  		local_irq_restore(flags);
^1da177e4c3f41 Linus Torvalds 2005-04-16  196  
0c5483a5778fa9 Guenter Roeck  2021-09-07  197  		if ((last ^ this) && (ktime_sub(now, loop) < loopout)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  198  			data[i] = last ^ this;
^1da177e4c3f41 Linus Torvalds 2005-04-16  199  			time[i] = now;
^1da177e4c3f41 Linus Torvalds 2005-04-16  200  			i++;
^1da177e4c3f41 Linus Torvalds 2005-04-16  201  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  202  
0c5483a5778fa9 Guenter Roeck  2021-09-07  203  	} while (this && (i < 4) && (ktime_sub(now, start) < timeout));
^1da177e4c3f41 Linus Torvalds 2005-04-16  204  
^1da177e4c3f41 Linus Torvalds 2005-04-16  205  	this <<= 4;
^1da177e4c3f41 Linus Torvalds 2005-04-16  206  
^1da177e4c3f41 Linus Torvalds 2005-04-16  207  	for (--i; i >= 0; i--) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  208  		this |= data[i];
^1da177e4c3f41 Linus Torvalds 2005-04-16  209  		for (j = 0; j < 4; j++)
^1da177e4c3f41 Linus Torvalds 2005-04-16  210  			if (data[i] & (1 << j))
0c5483a5778fa9 Guenter Roeck  2021-09-07  211  				port->axes[j] = ((u32)ktime_sub(time[i], start) << ANALOG_FUZZ_BITS) / port->loop;
^1da177e4c3f41 Linus Torvalds 2005-04-16  212  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  213  
^1da177e4c3f41 Linus Torvalds 2005-04-16  214  	return -(this != port->mask);
^1da177e4c3f41 Linus Torvalds 2005-04-16  215  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  216  

:::::: The code at line 192 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-08-31 12:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202608312037.GqxvSjEL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.