From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, mtk22730 <Cloud.Zhang@mediatek.com>,
Mark Brown <broonie@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Project_Global_Chrome_Upstream_Group@mediatek.com,
Cloud Zhang <cloud.zhang@mediatek.com>
Subject: Re: [PATCH] [v1] spi: spi-mtk-nor: Modify the clock architecture of nor controller
Date: Mon, 6 Jan 2025 12:47:12 +0300 [thread overview]
Message-ID: <63ddb297-822c-47bd-a33b-e2203fe1fad1@stanley.mountain> (raw)
In-Reply-To: <20241212092206.14071-1-Cloud.Zhang@mediatek.com>
Hi mtk22730,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/mtk22730/spi-spi-mtk-nor-Modify-the-clock-architecture-of-nor-controller/20241212-172704
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link: https://lore.kernel.org/r/20241212092206.14071-1-Cloud.Zhang%40mediatek.com
patch subject: [PATCH] [v1] spi: spi-mtk-nor: Modify the clock architecture of nor controller
config: parisc-randconfig-r073-20241223 (https://download.01.org/0day-ci/archive/20241223/202412232136.cWvRuwoD-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 14.2.0
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 <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202412232136.cWvRuwoD-lkp@intel.com/
smatch warnings:
drivers/spi/spi-mtk-nor.c:746 mtk_nor_parse_clk() warn: impossible condition '(cnt == -22) => (1-255 == (-22))'
vim +746 drivers/spi/spi-mtk-nor.c
87d65a23444841 Cloud Zhang 2024-12-12 738 static int mtk_nor_parse_clk(struct device *dev, struct mtk_nor *sp)
87d65a23444841 Cloud Zhang 2024-12-12 739 {
87d65a23444841 Cloud Zhang 2024-12-12 740 struct device_node *np = dev->of_node;
87d65a23444841 Cloud Zhang 2024-12-12 741 int ret;
87d65a23444841 Cloud Zhang 2024-12-12 742 const char *name;
87d65a23444841 Cloud Zhang 2024-12-12 743 u8 cnt, i;
^^^^^^
87d65a23444841 Cloud Zhang 2024-12-12 744
87d65a23444841 Cloud Zhang 2024-12-12 745 cnt = of_property_count_strings(np, "clock-names");
87d65a23444841 Cloud Zhang 2024-12-12 @746 if (!cnt || (cnt == -EINVAL)) {
^^^^^^^^^^^^^^
cnt needs to be declared as an int.
87d65a23444841 Cloud Zhang 2024-12-12 747 dev_err(dev, "Unable to find clocks\n");
87d65a23444841 Cloud Zhang 2024-12-12 748 ret = -EINVAL;
87d65a23444841 Cloud Zhang 2024-12-12 749 goto out;
87d65a23444841 Cloud Zhang 2024-12-12 750 } else if (cnt < 0) {
^^^^^^^
It's weird that this doesn't trigger a warning.
87d65a23444841 Cloud Zhang 2024-12-12 751 dev_err(dev, "Count clock strings failed, err %d\n", cnt);
87d65a23444841 Cloud Zhang 2024-12-12 752 ret = cnt;
87d65a23444841 Cloud Zhang 2024-12-12 753 goto out;
87d65a23444841 Cloud Zhang 2024-12-12 754 } else if (cnt > MAX_CLOCK_CNT) {
87d65a23444841 Cloud Zhang 2024-12-12 755 ret = -EINVAL;
87d65a23444841 Cloud Zhang 2024-12-12 756 goto out;
87d65a23444841 Cloud Zhang 2024-12-12 757 }
87d65a23444841 Cloud Zhang 2024-12-12 758
87d65a23444841 Cloud Zhang 2024-12-12 759 sp->clock_cnt = cnt;
87d65a23444841 Cloud Zhang 2024-12-12 760
87d65a23444841 Cloud Zhang 2024-12-12 761 for (i = 0; i < cnt; i++) {
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-01-06 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 9:20 [PATCH] [v1] spi: spi-mtk-nor: Modify the clock architecture of nor controller mtk22730
2024-12-20 18:26 ` kernel test robot
2025-01-06 9:47 ` Dan Carpenter [this message]
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=63ddb297-822c-47bd-a33b-e2203fe1fad1@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=Cloud.Zhang@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=matthias.bgg@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox