From: kernel test robot <lkp@intel.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type
Date: Fri, 12 Jun 2020 22:10:53 +0800 [thread overview]
Message-ID: <202006122245.7N5aecOy%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5741 bytes --]
Hi Krzysztof,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b791d1bdf9212d944d749a5c7ff6febdba241771
commit: 88eaaecc44461f9fb147bf7ee6ccc6d4e9fc23e0 usb: host: Enable compile testing for some of drivers
date: 6 months ago
config: h8300-randconfig-r024-20200612 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 88eaaecc44461f9fb147bf7ee6ccc6d4e9fc23e0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/h8300/include/generated/asm/current.h:1,
from include/linux/mutex.h:14,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from drivers/usb/host/ohci-at91.c:16:
include/linux/dma-mapping.h: In function 'dma_map_resource':
include/asm-generic/page.h:91:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
91 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/usb/host/ohci-at91.c: In function 'ohci_at91_hub_control':
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
>> drivers/usb/host/ohci-at91.c:347:8: note: in expansion of macro 'valid_port'
347 | if (valid_port(wIndex)) {
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:356:8: note: in expansion of macro 'valid_port'
356 | if (valid_port(wIndex) && ohci_at91->sfr_regmap) {
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:371:8: note: in expansion of macro 'valid_port'
371 | if (valid_port(wIndex)) {
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:382:8: note: in expansion of macro 'valid_port'
382 | if (valid_port(wIndex))
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:391:8: note: in expansion of macro 'valid_port'
391 | if (valid_port(wIndex)) {
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:399:8: note: in expansion of macro 'valid_port'
399 | if (valid_port(wIndex) && ohci_at91->sfr_regmap) {
| ^~~~~~~~~~
>> drivers/usb/host/ohci-at91.c:33:36: warning: comparison is always true due to limited range of data type [-Wtype-limits]
33 | #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
| ^~
drivers/usb/host/ohci-at91.c:447:7: note: in expansion of macro 'valid_port'
447 | if (valid_port(wIndex)) {
| ^~~~~~~~~~
In file included from drivers/usb/host/ohci-at91.c:31:
At top level:
drivers/usb/host/ohci.h:165:18: warning: 'cc_to_error' defined but not used [-Wunused-const-variable=]
165 | static const int cc_to_error [16] = {
| ^~~~~~~~~~~
vim +33 drivers/usb/host/ohci-at91.c
39a269c09f854d Andrew Victor 2006-01-22 32
0ee6d1eeef7bf4 Nicolas Ferre 2012-03-21 @33 #define valid_port(index) ((index) >= 0 && (index) < AT91_MAX_USBH_PORTS)
0ee6d1eeef7bf4 Nicolas Ferre 2012-03-21 34 #define at91_for_each_port(index) \
0ee6d1eeef7bf4 Nicolas Ferre 2012-03-21 35 for ((index) = 0; (index) < AT91_MAX_USBH_PORTS; (index)++)
0ee6d1eeef7bf4 Nicolas Ferre 2012-03-21 36
:::::: The code at line 33 was first introduced by commit
:::::: 0ee6d1eeef7bf4e08aba37bf1da377b25e8d853a USB: ohci-at91: change maximum number of ports
:::::: TO: Nicolas Ferre <nicolas.ferre@atmel.com>
:::::: CC: Nicolas Ferre <nicolas.ferre@atmel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28245 bytes --]
reply other threads:[~2020-06-12 14:30 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=202006122245.7N5aecOy%lkp@intel.com \
--to=lkp@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox