All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: oe-kbuild-all@lists.linux.dev,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	"Jernej Škrabec" <jernej.skrabec@gmail.com>
Subject: [linux-next:master 602/1199] drivers/cpufreq/sun50i-cpufreq-nvmem.c:229:20: sparse: sparse: cast to restricted __le32
Date: Tue, 8 Apr 2025 00:01:38 +0800	[thread overview]
Message-ID: <202504072322.EwPvc4ch-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2bdde620f7f2bff2ff1cb7dc166859eaa0c78a7c
commit: 1efdea0517384d30316acdfb006c0650804dc2ff [602/1199] cpufreq: sun50i: prevent out-of-bounds access
config: riscv-randconfig-r111-20250407 (https://download.01.org/0day-ci/archive/20250407/202504072322.EwPvc4ch-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce: (https://download.01.org/0day-ci/archive/20250407/202504072322.EwPvc4ch-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/202504072322.EwPvc4ch-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> drivers/cpufreq/sun50i-cpufreq-nvmem.c:229:20: sparse: sparse: cast to restricted __le32

vim +229 drivers/cpufreq/sun50i-cpufreq-nvmem.c

   184	
   185	/**
   186	 * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value
   187	 *
   188	 * Returns non-negative speed bin index on success, a negative error
   189	 * value otherwise.
   190	 */
   191	static int sun50i_cpufreq_get_efuse(void)
   192	{
   193		const struct sunxi_cpufreq_data *opp_data;
   194		struct nvmem_cell *speedbin_nvmem;
   195		const struct of_device_id *match;
   196		struct device *cpu_dev;
   197		void *speedbin_ptr;
   198		u32 speedbin = 0;
   199		size_t len;
   200		int ret;
   201	
   202		cpu_dev = get_cpu_device(0);
   203		if (!cpu_dev)
   204			return -ENODEV;
   205	
   206		struct device_node *np __free(device_node) =
   207			dev_pm_opp_of_get_opp_desc_node(cpu_dev);
   208		if (!np)
   209			return -ENOENT;
   210	
   211		match = of_match_node(cpu_opp_match_list, np);
   212		if (!match)
   213			return -ENOENT;
   214	
   215		opp_data = match->data;
   216	
   217		speedbin_nvmem = of_nvmem_cell_get(np, NULL);
   218		if (IS_ERR(speedbin_nvmem))
   219			return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
   220					     "Could not get nvmem cell\n");
   221	
   222		speedbin_ptr = nvmem_cell_read(speedbin_nvmem, &len);
   223		nvmem_cell_put(speedbin_nvmem);
   224		if (IS_ERR(speedbin_ptr))
   225			return PTR_ERR(speedbin_ptr);
   226	
   227		if (len <= 4)
   228			memcpy(&speedbin, speedbin_ptr, len);
 > 229		speedbin = le32_to_cpu(speedbin);
   230	
   231		ret = opp_data->efuse_xlate(speedbin);
   232	
   233		kfree(speedbin_ptr);
   234	
   235		return ret;
   236	};
   237	

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

                 reply	other threads:[~2025-04-07 16:01 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=202504072322.EwPvc4ch-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andre.przywara@arm.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=viresh.kumar@linaro.org \
    /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.