From: kernel test robot <lkp@intel.com>
To: Nava kishore Manne <nava.manne@xilinx.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Moritz Fischer <mdf@kernel.org>
Subject: [linux-next:master 4831/7265] drivers/fpga/zynq-fpga.c:246:14: warning: result of comparison of constant 170 with expression of type 'const char' is always false
Date: Wed, 27 Apr 2022 20:28:34 +0800 [thread overview]
Message-ID: <202204272019.5oBcDYmF-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: f02ac5c95dfd45d2f50ecc68d79177de326c668c
commit: ada14a023a641107da1ada546e1d345ca3dc78a5 [4831/7265] fpga: zynq: Fix incorrect variable type
config: mips-randconfig-r011-20220427 (https://download.01.org/0day-ci/archive/20220427/202204272019.5oBcDYmF-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1cddcfdc3c683b393df1a5c9063252eb60e52818)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ada14a023a641107da1ada546e1d345ca3dc78a5
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout ada14a023a641107da1ada546e1d345ca3dc78a5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/fpga/
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 >>):
>> drivers/fpga/zynq-fpga.c:246:14: warning: result of comparison of constant 170 with expression of type 'const char' is always false [-Wtautological-constant-out-of-range-compare]
buf[3] == 0xaa)
~~~~~~ ^ ~~~~
drivers/fpga/zynq-fpga.c:245:50: warning: result of comparison of constant 153 with expression of type 'const char' is always false [-Wtautological-constant-out-of-range-compare]
if (buf[0] == 0x66 && buf[1] == 0x55 && buf[2] == 0x99 &&
~~~~~~ ^ ~~~~
2 warnings generated.
vim +246 drivers/fpga/zynq-fpga.c
37784706bf9e3b Moritz Fischer 2015-10-16 237
b496df86ac1bbe Jason Gunthorpe 2017-02-01 238 /* Sanity check the proposed bitstream. It must start with the sync word in
b496df86ac1bbe Jason Gunthorpe 2017-02-01 239 * the correct byte order, and be dword aligned. The input is a Xilinx .bin
b496df86ac1bbe Jason Gunthorpe 2017-02-01 240 * file with every 32 bit quantity swapped.
b496df86ac1bbe Jason Gunthorpe 2017-02-01 241 */
ada14a023a6411 Nava kishore Manne 2022-04-21 242 static bool zynq_fpga_has_sync(const char *buf, size_t count)
b496df86ac1bbe Jason Gunthorpe 2017-02-01 243 {
b496df86ac1bbe Jason Gunthorpe 2017-02-01 244 for (; count >= 4; buf += 4, count -= 4)
b496df86ac1bbe Jason Gunthorpe 2017-02-01 245 if (buf[0] == 0x66 && buf[1] == 0x55 && buf[2] == 0x99 &&
b496df86ac1bbe Jason Gunthorpe 2017-02-01 @246 buf[3] == 0xaa)
b496df86ac1bbe Jason Gunthorpe 2017-02-01 247 return true;
b496df86ac1bbe Jason Gunthorpe 2017-02-01 248 return false;
b496df86ac1bbe Jason Gunthorpe 2017-02-01 249 }
b496df86ac1bbe Jason Gunthorpe 2017-02-01 250
:::::: The code at line 246 was first introduced by commit
:::::: b496df86ac1bbe393a55ddbfed35d46e74ef9767 fpga zynq: Check the bitstream for validity
:::::: TO: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-04-27 12:29 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=202204272019.5oBcDYmF-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=mdf@kernel.org \
--cc=nava.manne@xilinx.com \
/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;
as well as URLs for NNTP newsgroup(s).