public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [sre-misc:thinkpad-t14s-x1e 20/129] drivers/media/platform/qcom/camss/camss-csiphy.c:821:59: warning: variable 'ret' is uninitialized when used here
@ 2026-02-09 15:37 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-02-09 15:37 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: llvm, oe-kbuild-all, Abel Vesa

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git thinkpad-t14s-x1e
head:   e59893f5d6ef4c024a8ce76f6922057dc52b8a9b
commit: 73974b13359f2522448c9ea16fde5c0d56bba10e [20/129] media: qcom: camss: Add support for PHY API devices
config: powerpc-randconfig-002-20260209 (https://download.01.org/0day-ci/archive/20260209/202602092340.TG38Rxvc-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260209/202602092340.TG38Rxvc-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/202602092340.TG38Rxvc-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/media/platform/qcom/camss/camss-csiphy.c:643:44: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 3)' attribute to the declaration of 'csiphy_match_clock_name' [-Wmissing-format-attribute]
     638 | static bool csiphy_match_clock_name(const char *clock_name, const char *format,
         | __attribute__((format(printf, 2, 3))) 
     639 |                                     int index)
     640 | {
     641 |         char name[16]; /* csiphyXXX_timer\0 */
     642 | 
     643 |         snprintf(name, sizeof(name), format, index);
         |                                                   ^
   drivers/media/platform/qcom/camss/camss-csiphy.c:638:13: note: 'csiphy_match_clock_name' declared here
     638 | static bool csiphy_match_clock_name(const char *clock_name, const char *format,
         |             ^
>> drivers/media/platform/qcom/camss/camss-csiphy.c:821:59: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     821 |                 dev_err(dev, "failed to get phy %s %d\n", csiphy->name, ret);
         |                                                                         ^~~
   drivers/media/platform/qcom/camss/camss-csiphy.c:808:9: note: initialize the variable 'ret' to silence this warning
     808 |         int ret;
         |                ^
         |                 = 0
   2 warnings generated.


vim +/ret +821 drivers/media/platform/qcom/camss/camss-csiphy.c

   637	
 > 638	static bool csiphy_match_clock_name(const char *clock_name, const char *format,
   639					    int index)
   640	{
   641		char name[16]; /* csiphyXXX_timer\0 */
   642	
   643		snprintf(name, sizeof(name), format, index);
   644		return !strcmp(clock_name, name);
   645	}
   646	
   647	/*
   648	 * msm_csiphy_subdev_init_legacy - Initialize CSIPHY device structure and resources
   649	 * @csiphy: CSIPHY device
   650	 * @res: CSIPHY module resources table
   651	 * @id: CSIPHY module id
   652	 *
   653	 * Return 0 on success or a negative error code otherwise
   654	 */
   655	int msm_csiphy_subdev_init_legacy(struct camss *camss,
   656					  struct csiphy_device *csiphy,
   657					  const struct camss_subdev_resources *res, u8 id)
   658	{
   659		struct device *dev = camss->dev;
   660		struct platform_device *pdev = to_platform_device(dev);
   661		int i, j;
   662		int ret;
   663	
   664		csiphy->camss = camss;
   665		csiphy->id = id;
   666		csiphy->cfg.combo_mode = 0;
   667		csiphy->res = &res->csiphy;
   668	
   669		ret = csiphy->res->hw_ops->init(csiphy);
   670		if (ret)
   671			return ret;
   672	
   673		/* Memory */
   674	
   675		csiphy->base = devm_platform_ioremap_resource_byname(pdev, res->reg[0]);
   676		if (IS_ERR(csiphy->base))
   677			return PTR_ERR(csiphy->base);
   678	
   679		if (camss->res->version == CAMSS_8x16 ||
   680		    camss->res->version == CAMSS_8x53 ||
   681		    camss->res->version == CAMSS_8x96) {
   682			csiphy->base_clk_mux =
   683				devm_platform_ioremap_resource_byname(pdev, res->reg[1]);
   684			if (IS_ERR(csiphy->base_clk_mux))
   685				return PTR_ERR(csiphy->base_clk_mux);
   686		} else {
   687			csiphy->base_clk_mux = NULL;
   688		}
   689	
   690		/* Interrupt */
   691	
   692		ret = platform_get_irq_byname(pdev, res->interrupt[0]);
   693		if (ret < 0)
   694			return ret;
   695	
   696		csiphy->irq = ret;
   697		snprintf(csiphy->irq_name, sizeof(csiphy->irq_name), "%s_%s%d",
   698			 dev_name(dev), MSM_CSIPHY_NAME, csiphy->id);
   699	
   700		ret = devm_request_irq(dev, csiphy->irq, csiphy->res->hw_ops->isr,
   701				       IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN,
   702				       csiphy->irq_name, csiphy);
   703		if (ret < 0) {
   704			dev_err(dev, "request_irq failed: %d\n", ret);
   705			return ret;
   706		}
   707	
   708		/* Clocks */
   709	
   710		csiphy->nclocks = 0;
   711		while (res->clock[csiphy->nclocks])
   712			csiphy->nclocks++;
   713	
   714		csiphy->clock = devm_kcalloc(dev,
   715					     csiphy->nclocks, sizeof(*csiphy->clock),
   716					     GFP_KERNEL);
   717		if (!csiphy->clock)
   718			return -ENOMEM;
   719	
   720		csiphy->rate_set = devm_kcalloc(dev,
   721						csiphy->nclocks,
   722						sizeof(*csiphy->rate_set),
   723						GFP_KERNEL);
   724		if (!csiphy->rate_set)
   725			return -ENOMEM;
   726	
   727		for (i = 0; i < csiphy->nclocks; i++) {
   728			struct camss_clock *clock = &csiphy->clock[i];
   729	
   730			clock->clk = devm_clk_get(dev, res->clock[i]);
   731			if (IS_ERR(clock->clk))
   732				return PTR_ERR(clock->clk);
   733	
   734			clock->name = res->clock[i];
   735	
   736			clock->nfreqs = 0;
   737			while (res->clock_rate[i][clock->nfreqs])
   738				clock->nfreqs++;
   739	
   740			if (!clock->nfreqs) {
   741				clock->freq = NULL;
   742				continue;
   743			}
   744	
   745			clock->freq = devm_kcalloc(dev,
   746						   clock->nfreqs,
   747						   sizeof(*clock->freq),
   748						   GFP_KERNEL);
   749			if (!clock->freq)
   750				return -ENOMEM;
   751	
   752			for (j = 0; j < clock->nfreqs; j++)
   753				clock->freq[j] = res->clock_rate[i][j];
   754	
   755			csiphy->rate_set[i] = csiphy_match_clock_name(clock->name,
   756								      "csiphy%d_timer",
   757								      csiphy->id);
   758			if (csiphy->rate_set[i])
   759				continue;
   760	
   761			if (camss->res->version == CAMSS_660) {
   762				csiphy->rate_set[i] = csiphy_match_clock_name(clock->name,
   763									      "csi%d_phy",
   764									       csiphy->id);
   765				if (csiphy->rate_set[i])
   766					continue;
   767			}
   768	
   769			csiphy->rate_set[i] = csiphy_match_clock_name(clock->name, "csiphy%d", csiphy->id);
   770		}
   771	
   772		/* CSIPHY supplies */
   773		for (i = 0; i < ARRAY_SIZE(res->regulators); i++) {
   774			if (res->regulators[i])
   775				csiphy->num_supplies++;
   776		}
   777	
   778		if (csiphy->num_supplies) {
   779			csiphy->supplies = devm_kmalloc_array(camss->dev,
   780							      csiphy->num_supplies,
   781							      sizeof(*csiphy->supplies),
   782							      GFP_KERNEL);
   783			if (!csiphy->supplies)
   784				return -ENOMEM;
   785		}
   786	
   787		for (i = 0; i < csiphy->num_supplies; i++)
   788			csiphy->supplies[i].supply = res->regulators[i];
   789	
   790		ret = devm_regulator_bulk_get(camss->dev, csiphy->num_supplies,
   791					      csiphy->supplies);
   792		return ret;
   793	}
   794	
   795	/*
   796	 * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources
   797	 * @csiphy: CSIPHY device
   798	 * @res: CSIPHY module resources table
   799	 * @id: CSIPHY module id
   800	 *
   801	 * Return 0 on success or a negative error code otherwise
   802	 */
   803	int msm_csiphy_subdev_init(struct camss *camss,
   804				   struct csiphy_device *csiphy,
   805				   const struct camss_subdev_resources *res, u8 id)
   806	{
   807		struct device *dev = camss->dev;
   808		int ret;
   809	
   810		csiphy->camss = camss;
   811		csiphy->id = id;
   812		csiphy->cfg.combo_mode = 0;
   813		csiphy->res = &res->csiphy;
   814	
   815		snprintf(csiphy->name, ARRAY_SIZE(csiphy->name), "csiphy%d",
   816			 csiphy->id);
   817	
   818		csiphy->phy = devm_phy_get(dev, csiphy->name);
   819	
   820		if (IS_ERR(csiphy->phy)) {
 > 821			dev_err(dev, "failed to get phy %s %d\n", csiphy->name, ret);
   822			return PTR_ERR(csiphy->phy);
   823		}
   824	
   825		ret = phy_init(csiphy->phy);
   826		if (ret)
   827			dev_err(dev, "phy %s init fail %d\n", csiphy->name, ret);
   828	
   829		return ret;
   830	}
   831	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-09 15:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 15:37 [sre-misc:thinkpad-t14s-x1e 20/129] drivers/media/platform/qcom/camss/camss-csiphy.c:821:59: warning: variable 'ret' is uninitialized when used here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox