All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Anup Patel <anup.patel@oss.qualcomm.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Subject: [avpatel:riscv_trace_support_v5 92/104] drivers/hwtracing/gtrace/gtrace-core.c:343:7: warning: assignment to 'struct gtrace_component *' from 'int' makes pointer from integer without a cast
Date: Wed, 12 Aug 2026 15:29:31 +0800	[thread overview]
Message-ID: <202608121554.tw488HTf-lkp@intel.com> (raw)

tree:   https://github.com/avpatel/linux.git riscv_trace_support_v5
head:   1d99b155d3c1ca9a30209d51590db002a606f30c
commit: d3f10d6966418cbed0f472d36d4567b369e9bc53 [92/104] hwtracing: gtrace: Initial implementation of gtrace framework
config: csky-randconfig-r051-20260812 (https://download.01.org/0day-ci/archive/20260812/202608121554.tw488HTf-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260812/202608121554.tw488HTf-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/202608121554.tw488HTf-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/hwtracing/gtrace/gtrace-core.c: In function 'gtrace_component_release':
   drivers/hwtracing/gtrace/gtrace-core.c:300:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
     300 |  kfree(comp);
         |  ^~~~~
   drivers/hwtracing/gtrace/gtrace-core.c: In function 'gtrace_register_component':
   drivers/hwtracing/gtrace/gtrace-core.c:343:9: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
     343 |  comp = kzalloc(sizeof(*comp), GFP_KERNEL);
         |         ^~~~~~~
>> drivers/hwtracing/gtrace/gtrace-core.c:343:7: warning: assignment to 'struct gtrace_component *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     343 |  comp = kzalloc(sizeof(*comp), GFP_KERNEL);
         |       ^
   cc1: some warnings being treated as errors


vim +343 drivers/hwtracing/gtrace/gtrace-core.c

   302	
   303	struct gtrace_component *gtrace_register_component(struct gtrace_component_id *id,
   304							   const char *name,
   305							   struct gtrace_platform_data *pdata)
   306	{
   307		struct gtrace_connection *conn;
   308		struct gtrace_component *comp;
   309		int i, ret = 0;
   310	
   311		if (!id || id->type >= GTRACE_COMPONENT_TYPE_MAX) {
   312			ret = -EINVAL;
   313			goto err_out;
   314		}
   315	
   316		if (!pdata || !pdata->dev) {
   317			ret = -EINVAL;
   318			goto err_out;
   319		}
   320	
   321		for (i = 0; i < pdata->nr_inconns; i++) {
   322			if (pdata->inconns[i]) {
   323				ret = -EINVAL;
   324				goto err_out;
   325			}
   326		}
   327	
   328		for (i = 0; i < pdata->nr_outconns; i++) {
   329			conn = pdata->outconns[i];
   330			if (!conn || conn->src_port < 0 || conn->src_comp ||
   331			    !device_match_fwnode(pdata->dev, conn->src_fwnode) ||
   332			    conn->dest_port < 0 || !conn->dest_fwnode || !conn->dest_comp) {
   333				ret = -EINVAL;
   334				goto err_out;
   335			}
   336		}
   337	
   338		if (pdata->bound_cpu >= 0 && !cpu_present(pdata->bound_cpu)) {
   339			ret = -EINVAL;
   340			goto err_out;
   341		}
   342	
 > 343		comp = kzalloc(sizeof(*comp), GFP_KERNEL);
   344		if (!comp) {
   345			ret = -ENOMEM;
   346			goto err_out;
   347		}
   348		comp->pdata = pdata;
   349		comp->id = *id;
   350		ret = gtrace_alloc_type_idx(comp);
   351		if (ret) {
   352			kfree(comp);
   353			goto err_out;
   354		}
   355	
   356		comp->dev.parent = pdata->dev;
   357		comp->dev.coherent_dma_mask = pdata->dev->coherent_dma_mask;
   358		comp->dev.release = gtrace_component_release;
   359		comp->dev.bus = &gtrace_bustype;
   360		comp->dev.fwnode = fwnode_handle_get(dev_fwnode(pdata->dev));
   361		dev_set_name(&comp->dev, "%s-%u", name ? name : "comp", comp->type_idx);
   362	
   363		mutex_lock(&gtrace_mutex);
   364	
   365		ret = device_register(&comp->dev);
   366		if (ret) {
   367			put_device(&comp->dev);
   368			goto err_out_unlock;
   369		}
   370	
   371		for (i = 0; i < pdata->nr_outconns; i++) {
   372			conn = pdata->outconns[i];
   373			conn->src_comp = comp;
   374		}
   375	
   376		ret = gtrace_setup_inconns_from_outconns(comp);
   377		if (ret < 0) {
   378			device_unregister(&comp->dev);
   379			goto err_out_unlock;
   380		}
   381	
   382		if (comp->pdata->bound_cpu >= 0) {
   383			gtrace_get_component(comp);
   384			per_cpu(gtrace_cpu_source_comp, comp->pdata->bound_cpu) = comp;
   385		}
   386	
   387		mutex_unlock(&gtrace_mutex);
   388	
   389		return comp;
   390	
   391	err_out_unlock:
   392		mutex_unlock(&gtrace_mutex);
   393	err_out:
   394		return ERR_PTR(ret);
   395	}
   396	EXPORT_SYMBOL_GPL(gtrace_register_component);
   397	

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

                 reply	other threads:[~2026-08-12  7: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=202608121554.tw488HTf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anup.patel@oss.qualcomm.com \
    --cc=mayuresh.chitale@oss.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.