[linux-next:master 3938/4500] drivers/soc/qcom/socinfo.c:322:36: sparse: sparse: cast to restricted __le32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   93bf8b946e5f9a0b0c68155597b53fd8ccce2827
commit: 734c78e7febf879a79e9b34e38df35cc63794350 [3938/4500] soc: qcom: socinfo: add info from PMIC models array
config: i386-randconfig-s002-20210118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=734c78e7febf879a79e9b34e38df35cc63794350
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 734c78e7febf879a79e9b34e38df35cc63794350
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/soc/qcom/socinfo.c:322:36: sparse: sparse: cast to restricted __le32
   drivers/soc/qcom/socinfo.c:323:36: sparse: sparse: cast to restricted __le32

vim +322 drivers/soc/qcom/socinfo.c

   304	
   305	static int qcom_show_pmic_model_array(struct seq_file *seq, void *p)
   306	{
   307		struct socinfo *socinfo = seq->private;
   308		unsigned int num_pmics = le32_to_cpu(socinfo->num_pmics);
   309		unsigned int pmic_array_offset = le32_to_cpu(socinfo->pmic_array_offset);
   310		int i;
   311		void *ptr = socinfo;
   312	
   313		ptr += pmic_array_offset;
   314	
   315		/* No need for bounds checking, it happened at socinfo_debugfs_init */
   316		for (i = 0; i < num_pmics; i++) {
   317			unsigned int model = SOCINFO_MINOR(get_unaligned_le32(ptr + 2 * i * sizeof(u32)));
   318			unsigned int die_rev = get_unaligned_le32(ptr + (2 * i + 1) * sizeof(u32));
   319	
   320			if (model <= ARRAY_SIZE(pmic_models) && pmic_models[model])
   321				seq_printf(seq, "%s %u.%u\n", pmic_models[model],
 > 322					   SOCINFO_MAJOR(le32_to_cpu(die_rev)),
   323					   SOCINFO_MINOR(le32_to_cpu(die_rev)));
   324			else
   325				seq_printf(seq, "unknown (%d)\n", model);
   326		}
   327	
   328		return 0;
   329	}
   330	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux