devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: re: pinctrl: add TB10x pin control driver
Date: Wed, 2 Apr 2014 14:13:58 +0300	[thread overview]
Message-ID: <20140402111358.GA23000@mwanda> (raw)

Hello Christian Ruppert,

The patch 5aad0db1c1eb: "pinctrl: add TB10x pin control driver" from
Oct 15, 2013, leads to the following static checker warning:

	drivers/pinctrl/pinctrl-tb10x.c:640 tb10x_gpio_request_enable()
	warn: unsigned 'port' is never less than zero.

drivers/pinctrl/pinctrl-tb10x.c
   624          /*
   625           * Figure out to which port the requested GPIO belongs and how to
   626           * configure that port.
   627           * This loop also checks for pin conflicts between GPIOs and other
   628           * functions.
   629           */
   630          for (i = 0; i < state->pinfuncgrpcnt; i++) {
   631                  const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i];
   632                  unsigned int port = pfg->port;
   633                  unsigned int mode = pfg->mode;
   634                  int j;
   635  
   636                  /*
   637                   * Skip pin groups which are always mapped and don't need
   638                   * to be configured.
   639                   */
   640                  if (port < 0)
                            ^^^^^^^^

"pfg->port" is an int so probably "port" should be as well.

   641                          continue;
   642  
   643                  for (j = 0; j < pfg->pincnt; j++) {
   644                          if (pin == pfg->pins[j]) {
   645                                  if (pfg->isgpio) {

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-04-02 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 11:13 Dan Carpenter [this message]
2014-04-11 14:46 ` [PATCH] pinctrl/TB10x: Fix signedness bug Christian Ruppert
2014-04-22 12:55   ` Linus Walleij

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=20140402111358.GA23000@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).