mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: macroalpha82@gmail.com, hjc@rock-chips.com, heiko@sntech.de
Cc: airlied@gmail.com, Dan Carpenter <dan.carpenter@oracle.com>,
	daniel@ffwll.ch, dri-devel@lists.freedesktop.org,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	harshit.m.mogalapalli@gmail.com
Subject: [bug-report] Smatch warns unsigned comparison with zero in dw_mipi_dsi_rockchip_set_lcdsel()
Date: Mon, 17 Oct 2022 20:33:28 +0530	[thread overview]
Message-ID: <364c0959-c82f-a93c-df02-87a04e1c2cea@oracle.com> (raw)

Hi,


Smatch warns:
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:755 
dw_mipi_dsi_rockchip_set_lcdsel() warn: unsigned 
'dsi->cdata->lcdsel_grf_reg'
is never less than zero.

static void dw_mipi_dsi_rockchip_set_lcdsel(struct dw_mipi_dsi_rockchip 
*dsi,
                                             int mux)
{
         if (dsi->cdata->lcdsel_grf_reg < 0)
                 regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg,
                         mux ? dsi->cdata->lcdsel_lit : 
dsi->cdata->lcdsel_big);
}

'dsi->cdata->lcdsel_grf_reg' is of u32 type, it can never be less than zero.
So the above if condition is an impossible one.

Note: 'lcdsel_grf_reg' is set to -1 at other places.


Thanks,
Harshit

                 reply	other threads:[~2022-10-17 15:09 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=364c0959-c82f-a93c-df02-87a04e1c2cea@oracle.com \
    --to=harshit.m.mogalapalli@oracle.com \
    --cc=airlied@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harshit.m.mogalapalli@gmail.com \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=macroalpha82@gmail.com \
    /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

all inboxes | Powered by JetHome®