All of lore.kernel.org
 help / color / mirror / Atom feed
* [frank-w-bpi-r2-4.14:7.2-rc 35/160] drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:158:27: sparse: sparse: cast to restricted __le16
@ 2026-06-30  8:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-30  8:14 UTC (permalink / raw)
  To: Frank Wunderlich; +Cc: oe-kbuild-all

tree:   https://github.com/frank-w/BPI-R2-4.14 7.2-rc
head:   39cd8d05e83250c6294b8e0da3ca69359eff8a3c
commit: 96aefe538fdf60924d25ab9ee28d665648458ddc [35/160] net: dsa: add mxl downstream driver from 6.19-main
config: alpha-randconfig-r131-20260630 (https://download.01.org/0day-ci/archive/20260630/202606301619.ssT57BLC-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 14.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260630/202606301619.ssT57BLC-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/202606301619.ssT57BLC-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:158:27: sparse: sparse: cast to restricted __le16
>> drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:193:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __le16 [usertype] @@
   drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:193:33: sparse:     expected unsigned short [usertype]
   drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:193:33: sparse:     got restricted __le16 [usertype]

vim +158 drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c

   128	
   129	int mxl862xx_api_wrap(struct mxl862xx_priv *priv, u16 cmd, void *_data,
   130			      u16 size, bool read)
   131	{
   132		u16 *data = _data;
   133		int16_t result = 0;
   134		u16 max, i;
   135		int ret;
   136	
   137		mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
   138	
   139		max = (size + 1) / 2;
   140	
   141		ret = mxl862xx_busy_wait(priv);
   142		if (ret < 0)
   143			goto out;
   144	
   145		for (i = 0; i < max; i++) {
   146			u16 off = i % MXL862XX_MMD_REG_DATA_MAX_SIZE;
   147	
   148			if (i && off == 0) {
   149				/* Send command to set data when every
   150				 * MXL862XX_MMD_REG_DATA_MAX_SIZE of WORDs are written.
   151				 */
   152				ret = mxl862xx_set_data(priv, i);
   153				if (ret < 0)
   154					goto out;
   155			}
   156	
   157			mxl862xx_write(priv, MXL862XX_MMD_REG_DATA_FIRST + off,
 > 158				  le16_to_cpu(data[i]));
   159		}
   160	
   161		ret = mxl862xx_send_cmd(priv, cmd, size, &result);
   162		if (ret < 0)
   163			goto out;
   164	
   165		if (result < 0) {
   166			ret = result;
   167			goto out;
   168		}
   169	
   170		for (i = 0; i < max && read; i++) {
   171			u16 off = i % MXL862XX_MMD_REG_DATA_MAX_SIZE;
   172	
   173			if (i && off == 0) {
   174				/* Send command to fetch next batch of data
   175				 * when every MXL862XX_MMD_REG_DATA_MAX_SIZE of WORDs
   176				 * are read.
   177				 */
   178				ret = mxl862xx_get_data(priv, i);
   179				if (ret < 0)
   180					goto out;
   181			}
   182	
   183			ret = mxl862xx_read(priv, MXL862XX_MMD_REG_DATA_FIRST + off);
   184			if (ret < 0)
   185				goto out;
   186	
   187			if ((i * 2 + 1) == size) {
   188				/* Special handling for last BYTE
   189				 * if it's not WORD aligned.
   190				 */
   191				*(uint8_t *)&data[i] = ret & 0xFF;
   192			} else {
 > 193				data[i] = cpu_to_le16((u16)ret);

--
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-06-30  8:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  8:14 [frank-w-bpi-r2-4.14:7.2-rc 35/160] drivers/net/dsa/mxl862xx_downstream/mxl862xx-host.c:158:27: sparse: sparse: cast to restricted __le16 kernel test robot

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.