From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/gpio/gpio-exar.c:52 exar_offset_to_sel_addr() warn: replace divide condition 'pin / 8' with 'pin >= 8'
Date: Fri, 14 Apr 2023 22:35:21 +0800 [thread overview]
Message-ID: <202304142200.J0o1tpYn-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Qingtao Cao <qingtao.cao.au@gmail.com>
CC: Bartosz Golaszewski <brgl@bgdev.pl>
CC: Andy Shevchenko <andy.shevchenko@gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 44149752e9987a9eac5ad78e6d3a20934b5e018d
commit: 5134272f9f3f71d4e1f3aa15cb09321af49b3646 gpio: exar: access MPIO registers on cascaded chips
date: 7 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 7 months ago
config: microblaze-randconfig-m041-20230413 (https://download.01.org/0day-ci/archive/20230414/202304142200.J0o1tpYn-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202304142200.J0o1tpYn-lkp@intel.com/
smatch warnings:
drivers/gpio/gpio-exar.c:52 exar_offset_to_sel_addr() warn: replace divide condition 'pin / 8' with 'pin >= 8'
drivers/gpio/gpio-exar.c:62 exar_offset_to_lvl_addr() warn: replace divide condition 'pin / 8' with 'pin >= 8'
vim +52 drivers/gpio/gpio-exar.c
6596e59e63cd4c Sudip Mukherjee 2017-01-19 46
696868d0a79c21 Bartosz Golaszewski 2020-09-30 47 static unsigned int
696868d0a79c21 Bartosz Golaszewski 2020-09-30 48 exar_offset_to_sel_addr(struct exar_gpio_chip *exar_gpio, unsigned int offset)
696868d0a79c21 Bartosz Golaszewski 2020-09-30 49 {
5134272f9f3f71 Qingtao Cao 2022-09-02 50 unsigned int pin = exar_gpio->first_pin + (offset % 16);
5134272f9f3f71 Qingtao Cao 2022-09-02 51 unsigned int cascaded = offset / 16;
5134272f9f3f71 Qingtao Cao 2022-09-02 @52 unsigned int addr = pin / 8 ? EXAR_OFFSET_MPIOSEL_HI : EXAR_OFFSET_MPIOSEL_LO;
5134272f9f3f71 Qingtao Cao 2022-09-02 53
5134272f9f3f71 Qingtao Cao 2022-09-02 54 return addr + (cascaded ? exar_gpio->cascaded_offset : 0);
696868d0a79c21 Bartosz Golaszewski 2020-09-30 55 }
696868d0a79c21 Bartosz Golaszewski 2020-09-30 56
696868d0a79c21 Bartosz Golaszewski 2020-09-30 57 static unsigned int
696868d0a79c21 Bartosz Golaszewski 2020-09-30 58 exar_offset_to_lvl_addr(struct exar_gpio_chip *exar_gpio, unsigned int offset)
696868d0a79c21 Bartosz Golaszewski 2020-09-30 59 {
5134272f9f3f71 Qingtao Cao 2022-09-02 60 unsigned int pin = exar_gpio->first_pin + (offset % 16);
5134272f9f3f71 Qingtao Cao 2022-09-02 61 unsigned int cascaded = offset / 16;
5134272f9f3f71 Qingtao Cao 2022-09-02 @62 unsigned int addr = pin / 8 ? EXAR_OFFSET_MPIOLVL_HI : EXAR_OFFSET_MPIOLVL_LO;
5134272f9f3f71 Qingtao Cao 2022-09-02 63
5134272f9f3f71 Qingtao Cao 2022-09-02 64 return addr + (cascaded ? exar_gpio->cascaded_offset : 0);
696868d0a79c21 Bartosz Golaszewski 2020-09-30 65 }
696868d0a79c21 Bartosz Golaszewski 2020-09-30 66
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-04-14 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 14:35 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-12-18 3:33 drivers/gpio/gpio-exar.c:52 exar_offset_to_sel_addr() warn: replace divide condition 'pin / 8' with 'pin >= 8' kernel test robot
2022-12-23 10:54 ` Dan Carpenter
2022-12-24 16:19 ` Andy Shevchenko
2022-12-24 19:30 ` Dan Carpenter
2022-12-24 19:36 ` Dan Carpenter
2022-12-25 11:45 ` Andy Shevchenko
2022-12-25 11:50 ` Andy Shevchenko
2022-12-27 17:46 ` Dan Carpenter
2022-12-27 18:30 ` Andy Shevchenko
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=202304142200.J0o1tpYn-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.