All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: nm@ti.com
Cc: linux-gpio@vger.kernel.org
Subject: [bug report] pinctrl: Introduce TI IOdelay configuration driver
Date: Thu, 12 Jan 2017 22:14:25 +0300	[thread overview]
Message-ID: <20170112191425.GA15070@mwanda> (raw)

Hello Nishanth Menon,

The patch 003910ebc83b: "pinctrl: Introduce TI IOdelay configuration
driver" from Jan 5, 2017, leads to the following static checker
warning:

	drivers/pinctrl/ti/pinctrl-ti-iodelay.c:668 ti_iodelay_pin_dbg_show()
	warn: unsigned 'pin' is never less than zero.

drivers/pinctrl/ti/pinctrl-ti-iodelay.c
   653  static void ti_iodelay_pin_dbg_show(struct pinctrl_dev *pctldev,
   654                                      struct seq_file *s,
   655                                      unsigned int pin)
                                            ^^^^^^^^^^^^^^^^
   656  {
   657          struct ti_iodelay_device *iod;
   658          struct pinctrl_pin_desc *pd;
   659          struct ti_iodelay_cfg *cfg;
   660          const struct ti_iodelay_reg_data *r;
   661          unsigned long offset;
   662          u32 in, oen, out;
   663  
   664          iod = pinctrl_dev_get_drvdata(pctldev);
   665          r = iod->reg_data;
   666  
   667          offset = ti_iodelay_pin_to_offset(iod, pin);
                                                       ^^^
   668          if (pin < 0) {
                    ^^^^^^^
   669                  dev_err(iod->dev, "invalid pin offset for pin%i\n", pin);
   670  
   671                  return;
   672          }

It looks to me like probably this code coulde be safely deleted?

   673  
   674          pd = &iod->pa[pin];

regards,
dan carpenter

             reply	other threads:[~2017-01-12 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 19:14 Dan Carpenter [this message]
2017-01-13 20:44 ` [bug report] pinctrl: Introduce TI IOdelay configuration driver Nishanth Menon

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=20170112191425.GA15070@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=nm@ti.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 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.