public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dmitry Baryshkov <lumag@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Linus Walleij <linusw@kernel.org>
Subject: [drm-misc:drm-misc-next 11/19] drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c:1627 jadard_dsi_probe() warn: unsigned 'dsi->lanes' is never less than zero.
Date: Mon, 20 Apr 2026 09:51:18 +0800	[thread overview]
Message-ID: <202604200838.WvVe32WB-lkp@intel.com> (raw)

tree:   https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
head:   17394e05b295e4936e0ed50d2f02ed7f08fd4f7d
commit: eb019688f2a97bb95384853072de3a88b981f1f3 [11/19] drm/panel: jadard-jd9365da-h3: support variable DSI configuration
config: openrisc-randconfig-r071-20260420 (https://download.01.org/0day-ci/archive/20260420/202604200838.WvVe32WB-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.2.0
smatch: v0.5.0-9007-gcf3ea02b

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/202604200838.WvVe32WB-lkp@intel.com/

smatch warnings:
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c:1627 jadard_dsi_probe() warn: unsigned 'dsi->lanes' is never less than zero.

vim +1627 drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c

  1601	
  1602	static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
  1603	{
  1604		struct device *dev = &dsi->dev;
  1605		const struct jadard_panel_desc *desc;
  1606		struct jadard *jadard;
  1607		int ret;
  1608	
  1609		jadard = devm_drm_panel_alloc(dev, struct jadard, panel, &jadard_funcs,
  1610					      DRM_MODE_CONNECTOR_DSI);
  1611		if (IS_ERR(jadard))
  1612			return PTR_ERR(jadard);
  1613	
  1614		desc = of_device_get_match_data(dev);
  1615	
  1616		if (desc->mode_flags)
  1617			dsi->mode_flags = desc->mode_flags;
  1618		else
  1619			dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
  1620					  MIPI_DSI_MODE_VIDEO_BURST |
  1621					  MIPI_DSI_MODE_NO_EOT_PACKET;
  1622	
  1623		dsi->format = desc->format;
  1624		dsi->lanes = desc->lanes;
  1625		if (!dsi->lanes) {
  1626			dsi->lanes = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
> 1627			if (dsi->lanes < 0)
  1628				return dsi->lanes;
  1629			if (dsi->lanes == 4) {
  1630				if (!desc->mode_4ln) {
  1631					dev_err(&dsi->dev, "4-lane config is not supported\n");
  1632					return -EINVAL;
  1633				}
  1634			} else if (dsi->lanes == 2) {
  1635				if (!desc->mode_2ln) {
  1636					dev_err(&dsi->dev, "2-lane config is not supported\n");
  1637					return -EINVAL;
  1638				}
  1639			} else {
  1640				dev_err(&dsi->dev, "Unsupported number of lanes, %d\n", dsi->lanes);
  1641				return -ENODEV;
  1642			}
  1643		}
  1644		dev_dbg(&dsi->dev, "lanes: %d\n", dsi->lanes);
  1645	
  1646		jadard->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
  1647		if (IS_ERR(jadard->reset))
  1648			return dev_err_probe(&dsi->dev, PTR_ERR(jadard->reset),
  1649					"failed to get our reset GPIO\n");
  1650	
  1651		jadard->vdd = devm_regulator_get(dev, "vdd");
  1652		if (IS_ERR(jadard->vdd))
  1653			return dev_err_probe(&dsi->dev, PTR_ERR(jadard->vdd),
  1654					"failed to get vdd regulator\n");
  1655	
  1656		jadard->vccio = devm_regulator_get(dev, "vccio");
  1657		if (IS_ERR(jadard->vccio))
  1658			return dev_err_probe(&dsi->dev, PTR_ERR(jadard->vccio),
  1659					"failed to get vccio regulator\n");
  1660	
  1661		ret = of_drm_get_panel_orientation(dev->of_node, &jadard->orientation);
  1662		if (ret < 0)
  1663			return dev_err_probe(dev, ret, "failed to get orientation\n");
  1664	
  1665		ret = drm_panel_of_backlight(&jadard->panel);
  1666		if (ret)
  1667			return ret;
  1668	
  1669		drm_panel_add(&jadard->panel);
  1670	
  1671		mipi_dsi_set_drvdata(dsi, jadard);
  1672		jadard->dsi = dsi;
  1673		jadard->desc = desc;
  1674	
  1675		ret = mipi_dsi_attach(dsi);
  1676		if (ret < 0)
  1677			drm_panel_remove(&jadard->panel);
  1678	
  1679		return ret;
  1680	}
  1681	

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

                 reply	other threads:[~2026-04-20  1:51 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=202604200838.WvVe32WB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linusw@kernel.org \
    --cc=lumag@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox