Re: [PATCH v2 2/3] coresight: Add source filtering for multi-port output

From: kernel test robot
Date: Fri Jul 12 2024 - 03:13:34 EST


Hi Tao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.10-rc7 next-20240711]
[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/Tao-Zhang/dt-bindings-arm-qcom-coresight-static-replicator-Add-property-for-source-filtering/20240711-162200
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20240711081750.21792-3-quic_taozha%40quicinc.com
patch subject: [PATCH v2 2/3] coresight: Add source filtering for multi-port output
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20240712/202407121435.uBdrJO8u-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240712/202407121435.uBdrJO8u-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407121435.uBdrJO8u-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from include/linux/device.h:15,
from include/linux/acpi.h:14,
from drivers/hwtracing/coresight/coresight-platform.c:6:
drivers/hwtracing/coresight/coresight-platform.c: In function 'of_coresight_parse_endpoint':
>> drivers/hwtracing/coresight/coresight-platform.c:261:35: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
261 | "Filter source %s is not a source device\n");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:156:61: note: in expansion of macro 'dev_fmt'
156 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/hwtracing/coresight/coresight-platform.c:260:33: note: in expansion of macro 'dev_warn'
260 | dev_warn(&conn.filter_src_dev->dev,
| ^~~~~~~~
drivers/hwtracing/coresight/coresight-platform.c:261:51: note: format string is defined here
261 | "Filter source %s is not a source device\n");
| ~^
| |
| char *


vim +261 drivers/hwtracing/coresight/coresight-platform.c

185
186 /*
187 * of_coresight_parse_endpoint : Parse the given output endpoint @ep
188 * and fill the connection information in @pdata->out_conns
189 *
190 * Parses the local port, remote device name and the remote port.
191 *
192 * Returns :
193 * 0 - If the parsing completed without any fatal errors.
194 * -Errno - Fatal error, abort the scanning.
195 */
196 static int of_coresight_parse_endpoint(struct device *dev,
197 struct device_node *ep,
198 struct coresight_platform_data *pdata)
199 {
200 int ret = 0;
201 struct of_endpoint endpoint, rendpoint;
202 struct device_node *rparent = NULL;
203 struct device_node *rep = NULL;
204 struct device *rdev = NULL;
205 struct fwnode_handle *rdev_fwnode;
206 struct coresight_connection conn = {};
207 struct coresight_connection *new_conn;
208
209 do {
210 /* Parse the local port details */
211 if (of_graph_parse_endpoint(ep, &endpoint))
212 break;
213 /*
214 * Get a handle on the remote endpoint and the device it is
215 * attached to.
216 */
217 rep = of_graph_get_remote_endpoint(ep);
218 if (!rep)
219 break;
220 rparent = of_coresight_get_port_parent(rep);
221 if (!rparent)
222 break;
223 if (of_graph_parse_endpoint(rep, &rendpoint))
224 break;
225
226 rdev_fwnode = of_fwnode_handle(rparent);
227 /* If the remote device is not available, defer probing */
228 rdev = coresight_find_device_by_fwnode(rdev_fwnode);
229 if (!rdev) {
230 ret = -EPROBE_DEFER;
231 break;
232 }
233
234 conn.src_port = endpoint.port;
235 /*
236 * Hold the refcount to the target device. This could be
237 * released via:
238 * 1) coresight_release_platform_data() if the probe fails or
239 * this device is unregistered.
240 * 2) While removing the target device via
241 * coresight_remove_match()
242 */
243 conn.dest_fwnode = fwnode_handle_get(rdev_fwnode);
244 conn.dest_port = rendpoint.port;
245
246 /*
247 * Get the firmware node of the filter source through the
248 * reference. This could be used to filter the source in
249 * building path.
250 */
251 conn.filter_src_fwnode =
252 fwnode_find_reference(&ep->fwnode, "filter-src", 0);
253 if (IS_ERR(conn.filter_src_fwnode))
254 conn.filter_src_fwnode = NULL;
255 else {
256 conn.filter_src_dev =
257 coresight_find_csdev_by_fwnode(conn.filter_src_fwnode);
258 if (conn.filter_src_dev && (conn.filter_src_dev->type
259 != CORESIGHT_DEV_TYPE_SOURCE))
260 dev_warn(&conn.filter_src_dev->dev,
> 261 "Filter source %s is not a source device\n");
262 }
263
264 new_conn = coresight_add_out_conn(dev, pdata, &conn);
265 if (IS_ERR_VALUE(new_conn)) {
266 fwnode_handle_put(conn.dest_fwnode);
267 return PTR_ERR(new_conn);
268 }
269 /* Connection record updated */
270 } while (0);
271
272 of_node_put(rparent);
273 of_node_put(rep);
274 put_device(rdev);
275
276 return ret;
277 }
278

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