linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dan Carpenter <error27@gmail.com>,
	Bjorn Andersson <andersson@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] remoteproc: mtk_scp:  remove unnecessary checking
Date: Thu, 23 Oct 2025 17:58:39 +0800	[thread overview]
Message-ID: <202510231714.dlrsh9El-lkp@intel.com> (raw)
In-Reply-To: <aPi6eBlFLH43A4C0@stanley.mountain>

Hi Dan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on remoteproc/rproc-next]
[also build test WARNING on next-20251023]
[cannot apply to linus/master v6.18-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Dan-Carpenter/remoteproc-mtk_scp-remove-unnecessary-checking/20251022-200619
base:   https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rproc-next
patch link:    https://lore.kernel.org/r/aPi6eBlFLH43A4C0%40stanley.mountain
patch subject: [PATCH] remoteproc: mtk_scp:  remove unnecessary checking
config: arm-randconfig-003-20251023 (https://download.01.org/0day-ci/archive/20251023/202510231714.dlrsh9El-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/202510231714.dlrsh9El-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510231714.dlrsh9El-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/remoteproc/mtk_scp.c: In function 'scp_rproc_init':
>> drivers/remoteproc/mtk_scp.c:1130:56: warning: '%1d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
      snprintf(scp_fw_file, ARRAY_SIZE(scp_fw_file), "scp_c%1d", core_id);
                                                           ^~~
   drivers/remoteproc/mtk_scp.c:1130:50: note: directive argument in the range [0, 1073741824]
      snprintf(scp_fw_file, ARRAY_SIZE(scp_fw_file), "scp_c%1d", core_id);
                                                     ^~~~~~~~~~
   drivers/remoteproc/mtk_scp.c:1130:3: note: 'snprintf' output between 7 and 16 bytes into a destination of size 7
      snprintf(scp_fw_file, ARRAY_SIZE(scp_fw_file), "scp_c%1d", core_id);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +1130 drivers/remoteproc/mtk_scp.c

  1096	
  1097	/**
  1098	 * scp_get_default_fw_path() - Get default SCP firmware path
  1099	 * @dev:     SCP Device
  1100	 * @core_id: SCP Core number
  1101	 *
  1102	 * This function generates a path based on the following format:
  1103	 *     mediatek/(soc_model)/scp(_cX).img; for multi-core or
  1104	 *     mediatek/(soc_model)/scp.img for single core SCP HW
  1105	 *
  1106	 * Return: A devm allocated string containing the full path to
  1107	 *         a SCP firmware or an error pointer
  1108	 */
  1109	static const char *scp_get_default_fw_path(struct device *dev, int core_id)
  1110	{
  1111		struct device_node *np = core_id < 0 ? dev->of_node : dev->parent->of_node;
  1112		const char *compatible, *soc;
  1113		char scp_fw_file[7];
  1114		int ret;
  1115	
  1116		/* Use only the first compatible string */
  1117		ret = of_property_read_string_index(np, "compatible", 0, &compatible);
  1118		if (ret)
  1119			return ERR_PTR(ret);
  1120	
  1121		/* If the compatible string's length is implausible bail out early */
  1122		if (strlen(compatible) < strlen("mediatek,mtXXXX-scp"))
  1123			return ERR_PTR(-EINVAL);
  1124	
  1125		/* If the compatible string starts with "mediatek,mt" assume that it's ok */
  1126		if (!str_has_prefix(compatible, "mediatek,mt"))
  1127			return ERR_PTR(-EINVAL);
  1128	
  1129		if (core_id >= 0)
> 1130			snprintf(scp_fw_file, ARRAY_SIZE(scp_fw_file), "scp_c%1d", core_id);
  1131		else
  1132			snprintf(scp_fw_file, ARRAY_SIZE(scp_fw_file), "scp");
  1133	
  1134		/* Not using strchr here, as strlen of a const gets optimized by compiler */
  1135		soc = &compatible[strlen("mediatek,")];
  1136	
  1137		return devm_kasprintf(dev, GFP_KERNEL, "mediatek/%.*s/%s.img",
  1138				      (int)strlen("mtXXXX"), soc, scp_fw_file);
  1139	}
  1140	

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


  reply	other threads:[~2025-10-23  9:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 11:05 [PATCH] remoteproc: mtk_scp: remove unnecessary checking Dan Carpenter
2025-10-23  9:58 ` kernel test robot [this message]
2025-10-23 10:10 ` Zhongqiu Han

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=202510231714.dlrsh9El-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=oe-kbuild-all@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;
as well as URLs for NNTP newsgroup(s).