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, Julia Lawall <julia.lawall@inria.fr>
Subject: [chrome-os:chromeos-6.6 265/293] drivers/hid/i2c-hid/i2c-hid-core.c:178:12-13: WARNING opportunity for min()
Date: Fri, 10 May 2024 04:22:23 +0800	[thread overview]
Message-ID: <202405100458.FZ6dPcHT-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com
TO: Guenter Roeck <groeck@google.com>

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-6.6
head:   5d220f942b4447d636ce50c7378fafdc4f3c135c
commit: c09dd0deb97a324865ea2d7123bb294ddf0c9021 [265/293] FROMGIT: HID: i2c-hid: Retry address probe after delay
:::::: branch date: 15 hours ago
:::::: commit date: 34 hours ago
config: x86_64-randconfig-102-20240510 (https://download.01.org/0day-ci/archive/20240510/202405100458.FZ6dPcHT-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)

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: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202405100458.FZ6dPcHT-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/hid/i2c-hid/i2c-hid-core.c:178:12-13: WARNING opportunity for min()

vim +178 drivers/hid/i2c-hid/i2c-hid-core.c

71af01a8c85ad8 drivers/hid/i2c-hid/i2c-hid.c      HungNien Chen  2016-11-10  162  
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  163  static int i2c_hid_probe_address(struct i2c_hid *ihid)
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  164  {
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  165  	int ret;
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  166  
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  167  	/*
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  168  	 * Some STM-based devices need 400µs after a rising clock edge to wake
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  169  	 * from deep sleep, in which case the first read will fail. Try after a
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  170  	 * short sleep to see if the device came alive on the bus. Certain
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  171  	 * Weida Tech devices also need this.
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  172  	 */
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  173  	ret = i2c_smbus_read_byte(ihid->client);
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  174  	if (ret < 0) {
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  175  		usleep_range(400, 500);
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  176  		ret = i2c_smbus_read_byte(ihid->client);
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  177  	}
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30 @178  	return ret < 0 ? ret : 0;
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  179  }
c09dd0deb97a32 drivers/hid/i2c-hid/i2c-hid-core.c Kenny Levinsen 2024-04-30  180  

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

                 reply	other threads:[~2024-05-09 20:23 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=202405100458.FZ6dPcHT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --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.